I am new to Playwright and started to write and run my tests by executing
npm init playwright@latest
npx playwright test
as described in the Getting Started.
However, when I wanted to integrate my tests in CI, I got confused about how to run tests in CI, because the CI documentation uses npm run test or npm test in some code snippets, e.g. in the Github Actions section or in the Jenkins section.
This produces the obvious error
npm ERR! Missing script: "test"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
because the package.json does not define any scripts.
It would probably help beginners like myself if the CI documentation would consistently use npx playwright test in its code snippets, if this indeed is the proper way to launch tests in CI.
I am new to Playwright and started to write and run my tests by executing
as described in the Getting Started.
However, when I wanted to integrate my tests in CI, I got confused about how to run tests in CI, because the CI documentation uses
npm run testornpm testin some code snippets, e.g. in the Github Actions section or in the Jenkins section.This produces the obvious error
because the
package.jsondoes not define any scripts.It would probably help beginners like myself if the CI documentation would consistently use
npx playwright testin its code snippets, if this indeed is the proper way to launch tests in CI.