-
Notifications
You must be signed in to change notification settings - Fork 13
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: adds E2E tests for the frontend static site and runs them as part of CI #1392
Conversation
/test-results/ | ||
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ |
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.
👍
2. Follow the [instructions](https://playwright.dev/docs/getting-started-vscode#running-tests) Playwright provides | ||
|
||
In CI, the "Front-end Checks" workflow (`.github/workflows/ci-frontend.yml`) summary will include an "Artifacts" section where there is an attached "playwright-report". [Playwright docs](https://playwright.dev/docs/ci-intro#html-report) describe how to view HTML Report in more detail. | ||
|
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.
Would it make sense to document what we're trying to test here - the entire flow with mock db data? How does it differ from the jest unit tests we write?
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.
How it's set up now is a proof-of-concept with tests for published pages that mirror the jest ones. Once more features like /search
are built out, I would argue that another workflow specifically for E2E tests is going to be necessary because "Front-end Checks" workflow isn't currently spinning up the rest of the application.
I'm happy to take that on as part of this PR if that corresponds to how others are reasoning about the purpose of this test suite.
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.
Looks great! Amazing work, thank you. Let's create a ticket for the sendy mock issue.
Co-authored-by: Aaron Couch <acinternets@gmail.com>
Summary
(To add ticket)
Time to review: 20 mins
Changes proposed
@playwright/test
as a dev dependencyContext for reviewers
The playwright config added in this PR is largely based on the default provided by running
npm init playwright@latest
. The options run the gambit for customizing the configuration. For instance, it's possible to add tracing artifacts (e.g. screenshots or videos) when tests fail during CI.To run via command line:
npm run test:e2e
Instructions on using the VS Code extension: https://playwright.dev/docs/getting-started-vscode
Additional information
Running
npm run test:e2e:ui
will result in opening up the Playwright UI, which looks like this: