How to test Puppeteer on localhost in GitHub Actions (React App)

Viewed 19

Here is the link to my repo. Try running it yourself: https://github.com/rsg71/puppeteer-testing

I want to test my end to end test in a CI/CD pipeline. The problem is I need to start a server first so that I can test on localhost, rather than a deployed site.

In a puppeteer test I want to go to "http://localhost:3000", rather than site like "google.com".

For this reason in my workflow file in .github/workflows/build.yml I try telling GitHub to run npm run start in the workflow (this runs in Actions) and then npm run test:e2e (this never seems to actually run in Actions). How can I make this command run in the workflow so that GitHub both runs npm run start and afterwards runs my tests locally?

enter image description here

^ Here you will see that GitHub has successfully run npm run start, but I never end up seeing the result of the tests that I have asked GitHub to run

0 Answers
Related