-
Notifications
You must be signed in to change notification settings - Fork 4
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
OAuth migration | Add E2E tests for OAuth authentication #1274
Conversation
d245247
to
6147528
Compare
6147528
to
9e48d23
Compare
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.
As a Retention dev I'm happy with this 👍 but will let someone from Identity approve
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.
I can understand a lot more of this than I expected and I'm relieved that a large part of it was references to moved code. It's very clear and well structured. Great work!
223d5ff
to
ecd03f1
Compare
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.
👍
6e81877
to
52c60b9
Compare
Seen on PROD (merged by @raphaelkabo 11 minutes and 38 seconds ago) Please check your changes! |
What does this change?
This adds a small suite of end-to-end (E2E) Cypress tests to manage-frontend. The existing Cypress tests all mock various API endpoints to allow testing specific user and supporter conditions. However to do this, they entirely skip the authentication middleware, and for our OAuth migration we really want to have that middleware tested end-to-end. Hence these new tests!
A lot of the changes here are refactoring file locations; most of the rest is support to allow end-to-end testing to work on local machines and the GHA runners. Specifically, we borrow from the general strategy in Gateway, using Nginx configs to proxy the CODE locations of Gateway, IDAPI and MDAPI to
.thegulocal.com
domains. This allows a locally running MMA onmanage.thegulocal.com
to interact with, and read cookies set on, CODE services.cypress/tests/mocked
, and rename the GitHub Actions workflow file tocypress-mocked.yml
.cypress/tests/e2e
, and use thecypress-e2e.yml
workflow file.cypress/cypress-nginx.conf
, which is used in GitHub Actions.RUNNING_IN_CYPRESS
environment variable), we skip metrics as these aren't authorised to be added in GHA, and always run the authentication middleware via OAuth/Okta.yarn cypress:mocked:server
: starts a dev server (essentially the same as the standardyarn watch
command but with theCYPRESS
variable set to'SKIP_IDAPI'
, and doesn't open a new browser tab).yarn cypress:mocked:open
: opens the Cypress test runner in mocked mode.yarn cypress:mocked:run
: runs the Cypress tests headless in mocked mode.yarn cypress:e2e:server
: starts a dev server without setting theCYPRESS
variable.yarn cypress:e2e:open
: opens the Cypress test runner in E2E mode.yarn cypress:e2e:run
: runs the Cypress tests headless in E2E mode.Notes