ambuda
ambuda copied to clipboard
Support for testing proofer pages in local and staging envs
Proofer pages are hard to test on staging and local machines:
- Sign up form requires CAPTCHA, which doesn't work on local machines
- Proofer pages need readily available data to locally test capabilities. OCR in particular absent. Is there a way to pre-populate pdf rendered document in lower environments?
You don't need to go through the sign-up page and CAPTCHA: see https://ambuda.readthedocs.io/en/latest/creating-data-from-the-command-line.html
I did something like:
./cli.py create-user # and choose "shreevatsa" as a user
./cli.py add-role --username shreevatsa --role admin
./cli.py create-project --title EpigramsBhartrhari --pdf-path ~/Downloads/Epigrams\ Attributed\ to\ Bhartrhari\ Kosambi\ Bookmarked.pdf
to work on the proofing pages locally.
You don't need to go through the sign-up page and CAPTCHA: see https://ambuda.readthedocs.io/en/latest/creating-data-from-the-command-line.html
I did something like:
./cli.py create-user # and choose "shreevatsa" as a user ./cli.py add-role --username shreevatsa --role admin ./cli.py create-project --title EpigramsBhartrhari --pdf-path ~/Downloads/Epigrams\ Attributed\ to\ Bhartrhari\ Kosambi\ Bookmarked.pdf
to work on the proofing pages locally.
I get the add-role
and create-project
part. I should have written in detail about the testcase. The idea is to test fields on the sign up form http://0.0.0.0:5000/register
and login. Today this error shows up:
So would it be correct to say that the issue you're pointing out is about sign-up / log-in pages, rather than proofer pages? Because the second question in the issue ("Is there a way to pre-populate pdf rendered document") is answered, correct?
(OCR is working locally with
GOOGLE_APPLICATION_CREDENTIALS='/Users/shreevatsa/Downloads/name-of-project.json'
in .env
file, where the name-of-project
is the name of a project I created in google cloud just for this purpose.)
(OCR is working locally with
GOOGLE_APPLICATION_CREDENTIALS='/Users/shreevatsa/Downloads/name-of-project.json'
in
.env
file, where thename-of-project
is the name of a project I created in google cloud just for this purpose.)
I didn't pay attention to that variable. Thanks for sharing.
Thinking more about this, I think it makes sense for a sample proofing project to be part of the default local setup — we can pick some small PDF with say 5 or 6 pages, and make it so that after make docker-start
(say), the local app that comes up should include a user and an in-progress proofing project based on that PDF.
Oh I guess that's what this issue is for, sorry I didn't realize earlier :)
Thinking more about this, I think it makes sense for a sample proofing project to be part of the default local setup — we can pick some small PDF with say 5 or 6 pages, and make it so that after
make docker-start
(say), the local app that comes up should include a user and an in-progress proofing project based on that PDF.
Yes, preset user
and pre-extracted pdf gives a better starting point for automated tests and also new contributors working on proofing.