-
Notifications
You must be signed in to change notification settings - Fork 18
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
Feat/scaffold UI test user on demand #2286
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- add safeguards to ensure this cant run in prod - hash the password on the fly instead of storing another secret
- add safeguards to ensure this cant run in prod - remove/update related tables
…et in this repo; create an admin user at the same time as a regular user
… users and templates
…materize email address; ensure passed in param is alphanumeric
5 tasks
whabanks
reviewed
Nov 8, 2024
@@ -0,0 +1,205 @@ | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this addition + the Cypress auth, I'll be sure to move the utility method from that PR in here too!
whabanks
approved these changes
Nov 8, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, exciting changes!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary | Résumé
API Changes
This PR adds a new API endpoint, secured by the
admin_auth
mechanism, at/cypress
:/cypress/create_user/<email_name>
/cypress/cleanup
At the start of each UI test session, both methods will be called:
/create_user
will be called to generate a unique set of accounts (regular + platform admin) for the test run./cleanup
will be called to remove any test accounts older than 3 hoursNote: these endpoints will be blocked from running in PROD in code, as well as by the WAF.
/create_user
[email protected]
[email protected]
[email protected]
/cleanup
notify-ui-tests+ag_
) that are older than 3 hours and removes them and their related entities.Migration
This PR also adds a migration to create the a base UI test service and user that will be used for all tests, and introduces some new config variables to keep track of these:
CYPRESS_SERVICE_ID
: ID of the cypress service used in UI testsCYPRESS_TEST_USER_ID
: ID of the base cypress ui test user (this will not get removed between tests)CYPRESS_TEST_USER_ADMIN_ID
: ID of the base cypress ui platform admin test user (this will not get removed between tests)CYPRESS_SMOKE_TEST_EMAIL_TEMPLATE_ID
: ID of base email template used in testsCYPRESS_SMOKE_TEST_SMS_TEMPLATE_ID
: ID of base SMS template used in testsCYPRESS_USER_PW_SECRET
: password of generated UI test usersRelated Issues | Cartes liées
Test instructions | Instructions pour tester la modification
TODO: Fill in test instructions for the reviewer.
Release Instructions | Instructions pour le déploiement
None.
Reviewer checklist | Liste de vérification du réviseur