-
Notifications
You must be signed in to change notification settings - Fork 12
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
Experiment/create ephemeral UI test accts #1898
base: main
Are you sure you want to change the base?
Conversation
…int on the API to create a UI testing account with it
…tore the email address while cypress is running
🧪 Review environmenthttps://awsm5zbzpkf7rxpmqpt3oey4gy0ytieq.lambda-url.ca-central-1.on.aws/ |
…tions are always closed and not dangling
…word since API already has this secret
🧪 Review environmenthttps://hu4pteypukhnutyk2w6ancyfde0kjhja.lambda-url.ca-central-1.on.aws/ |
🧪 Review environmenthttps://b2xc3okljybta7biudmui2keti0hffli.lambda-url.ca-central-1.on.aws/ |
… for language to change
…ithub.com/cds-snc/notification-admin into experiment/create-ephemeral-ui-test-accts
…ithub.com/cds-snc/notification-admin into experiment/create-ephemeral-ui-test-accts
…ithub.com/cds-snc/notification-admin into experiment/create-ephemeral-ui-test-accts
}, | ||
deleteAllEmails() { | ||
return emailAccount.deleteAllEmails() | ||
}, | ||
fetchEmail(acct) { | ||
return emailAccount.fetchEmail(acct) | ||
}, | ||
createEmailAccount() { | ||
return emailAccount.createEmailAccount(); | ||
createAccount({ baseUrl, username, secret }) { |
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.
The result of this call is "cached" in the global
object here, which means only one set of test users is generated for every test run or every time you launch the cypress UI. To get a new user, just quit cypress and launch it again.
@@ -82,7 +82,7 @@ const pages = [ | |||
describe(`A11Y - App pages [${config.CONFIG_NAME}]`, () => { | |||
for (const page of pages) { | |||
it(`${page.name}`, () => { | |||
cy.login(Cypress.env("NOTIFY_USER"), Cypress.env("NOTIFY_PASSWORD")); | |||
cy.login(); |
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.
The login command has been simplified to use the generated user and the password automatically.
const mail = await simpleParser(message.parts[0].body); | ||
const to_address = mail.to.value[0].address; | ||
|
||
if (to_address == emailAddress) { |
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.
Only get 2FA codes for the specific email alias we are testing with 🎉
Summary | Résumé
This PR hooks into the new
/cypress
endpoints introduced in #2286 in order to create UI testing alias accounts on the fly.The end result is that test runs will no longer interfere with each other, meaning we can run as many suites concurrently as we want on the same environment.
Notes
/cypress
endpoint on the backend to get new accounts createdlogin
(regular user) and loginAsPlatformAdmin (platform admin user)