[1508] Add Playwright for e2e testing (attempt 2) #1554
Merged
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
Issue: #1508
This PR adds Playwright for e2e testing, a simple test for the MAPLE homepage. A redo of #1535
I realized the initial issues I ran into that led me to updating package versions was likely due to using the wrong version of yarn. I started over, set my yarn version to v1.22.19 (same as the CI build), and reinstalled playwright without the extra changes. This is a much simpler PR now!
How to run tests
There are two ways you can run the e2e tests, with the Playwright UI or headless in your terminal. This will automatically start the application so you don't need to do it before running tests.
With Playwright UI
To run the e2e tests with the Playwright UI, run
yarn test:e2e
. Once the UI pops up and the tests have loaded, press the play button in the "TESTS" bar to run all the tests. To run individual tests or test suites, you can hover over the test name to reveal a play button that will run only that test/suite when clicked.Headless
To run the e2e tests headless in your terminal, run
yarn test:e2e:headless
. The results of this test run will show on your terminal, and it will also generate an HTML report that will open in your browser.Screenshots
Note: My macbook is old and I can't update it anymore. The screenshot shows the webkit test is failing, but it's because the version I have is incompatible 😓