Skip to content
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

[1508] Add Playwright for e2e testing (attempt 2) #1554

Merged
merged 4 commits into from
May 8, 2024

Conversation

seatuna
Copy link
Contributor

@seatuna seatuna commented May 6, 2024

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.
image

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.
image

image

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 😓
image

Copy link

vercel bot commented May 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
maple-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 6, 2024 8:44pm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This config file was generated by Playwright. I only changed it to run the application before starting tests. There are options to run tests on mobile as well (commented out by default).

@mertbagt
Copy link
Collaborator

mertbagt commented May 8, 2024

image
to_the_moon

@mertbagt mertbagt merged commit 59bb8db into codeforboston:main May 8, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants