[Question] How can I run playwright in github-actions successfully?
See original GitHub issueI am trying to run E2E tests during github-actions but have been unsuccessful so far.
- name: Run build and start
run: |
yarn build:e2e
yarn start:e2e &
- name: Run e2e
run: |
yarn e2e
I don’t think the server is running when playwright
runs because all the e2e tests end up failing.
Run build and start
Done in 192.91s.
yarn run v1.22.19
$ env-cmd -f environments/.env.e2e next start
ready - started server on 0.0.0.0:3000, url: ***
Run e2e
Test timeout of 270000ms exceeded while running "beforeEach" hook.
I am pretty certain that playwright cannot connect to http://localhost:3000
from the previous step and that’s why all the tests timeout.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
003 | Let's Automate Playwright Testing With GitHub Actions
We just need to add a Test site using Playwright job that is run after the build/deploy completes successfully. This is what my...
Read more >How to add Playwright tests to your pull request CI with GitHub ...
Then you can run the command npm run test:e2e to ensure that Playwright tests can run and complete successfully. Hurray! We have a...
Read more >Playwright Github Action | Playwright - part 30 - YouTube
Playwright Github Action - CI/CDSet up GitHub Actions to run cross-browser tests on Chromium, WebKit, and Firefox with Playwright.
Read more >Using Playwright E2E to validate Github Pull Requests | Armory
This article walks you through integrating and troubleshooting Playwright end-to-end tests into your React project and its pull requests in ...
Read more >Using Next.js + Playwright + GitHub Actions to Make a To-Do ...
Choose JavaScript (you can also choose Typescript) · Name of your Tests folder · Add a GitHub Actions workflow to easily run tests...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can use
npm create playwright@latest
and say Yes when it offers to create a GHA workflow file. Your problem seems to rather be around ability to run your server on GHA and using yarn.Closing as per above.