question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] How can I run playwright in github-actions successfully?

See original GitHub issue

I 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:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pavelfeldmancommented, Sep 2, 2022

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.

0reactions
dgozmancommented, Sep 9, 2022

Closing as per above.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found