Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for testing proofer pages in local and staging envs #458

Open
kvchitrapu opened this issue Feb 21, 2023 · 8 comments
Open

Support for testing proofer pages in local and staging envs #458

kvchitrapu opened this issue Feb 21, 2023 · 8 comments
Assignees
Labels
type:backend Python, Flask, etc.

Comments

@kvchitrapu
Copy link
Collaborator

kvchitrapu commented Feb 21, 2023

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 kvchitrapu added the type:backend Python, Flask, etc. label Feb 21, 2023
@kvchitrapu kvchitrapu self-assigned this Feb 21, 2023
@shreevatsa
Copy link
Contributor

shreevatsa commented Feb 21, 2023

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.

@kvchitrapu
Copy link
Collaborator Author

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

@shreevatsa
Copy link
Contributor

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
Copy link
Contributor

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

@kvchitrapu
Copy link
Collaborator Author

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

@shreevatsa
Copy link
Contributor

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
Copy link
Contributor

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

@kvchitrapu
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:backend Python, Flask, etc.
Projects
None yet
Development

No branches or pull requests

2 participants