ambuda icon indicating copy to clipboard operation
ambuda copied to clipboard

Support for testing proofer pages in local and staging envs

Open kvchitrapu opened this issue 2 years ago • 8 comments

Proofer pages are hard to test on staging and local machines:

  1. Sign up form requires CAPTCHA, which doesn't work on local machines
  2. 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?

kvchitrapu avatar Feb 21 '23 13:02 kvchitrapu

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.

shreevatsa avatar Feb 21 '23 15:02 shreevatsa

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:

Screenshot 2023-02-21 at 9 50 37 PM

kvchitrapu avatar Feb 22 '23 02:02 kvchitrapu

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?

shreevatsa avatar Feb 22 '23 06:02 shreevatsa

(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.)

shreevatsa avatar Feb 22 '23 06:02 shreevatsa

(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.)

I didn't pay attention to that variable. Thanks for sharing.

kvchitrapu avatar Feb 22 '23 16:02 kvchitrapu

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.

shreevatsa avatar Feb 24 '23 15:02 shreevatsa

Oh I guess that's what this issue is for, sorry I didn't realize earlier :)

shreevatsa avatar Feb 24 '23 15:02 shreevatsa

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.

kvchitrapu avatar Feb 24 '23 18:02 kvchitrapu