Skip to content
This repository has been archived by the owner on Jan 17, 2025. It is now read-only.

Allow assigning our own reference to Notify emails #298

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

samuelhwilliams
Copy link
Contributor

@samuelhwilliams samuelhwilliams commented Nov 28, 2024

https://mhclgdigital.atlassian.net/browse/FSPT-137

Change description

Our end-to-end test suite is currently taking quite a long time to run, as many of the tests run sequentially. The main reason for needing them to run sequentially is that some tests login as the same user, and the login attempts are in conflict. This conflict is not handled well by the end-to-end tests and concurrent logins are not well supported by authenticator. Authenticator allows multiple login sessions to exist at once, but does not allow multiple unredeemed magic links to exist for one account at the same time. Furthermore, the end-to-end tests use a "list all magic links" endpoint on authenticator and then grab the top magic link off the stack. This link isn't necessarily associated with the account that they are trying to log in as, which is bad.

This patch allows a reference to be associated with an email sent via GOV.UK Notify. When a magic link email is sent, the calling code can set a reference which the e2e tests can then scan for. This will let the e2e tests retrieve the correct magic link from Notify for the account it was trying to log into.

https://mhclgdigital.atlassian.net/browse/FSPT-137

Our end-to-end test suite is currently taking quite a long time to run,
as many of the tests run sequentially. The main reason for needing them
to run sequentially is that some tests login as the same user, and the
login attempts are in conflict. This conflict is not handled well by the
end-to-end tests and concurrent logins are not well supported by
authenticator. Authenticator allows multiple login sessions to exist at
once, but does not allow multiple unredeemed magic links to exist for
one account at the same time. Furthermore, the end-to-end tests use a
"list all magic links" endpoint on authenticator and then grab the top
magic link off the stack. This link isn't necessarily associated with
the account that they are trying to log in as, which is bad.

This patch allows a reference to be associated with an email sent via
GOV.UK Notify. When a magic link email is sent, the calling code can set
a reference which the e2e tests can then scan for. This will let the e2e
tests retrieve the _correct_ magic link from Notify for the account it
was trying to log into.
Copy link
Contributor

@sfount sfount left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really clear change description and a very neat solution for the current setup 👍

@samuelhwilliams samuelhwilliams merged commit f1a7418 into main Dec 3, 2024
15 checks passed
@samuelhwilliams samuelhwilliams deleted the e2e/govuk-notify-reference branch December 3, 2024 11:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants