Playwright boilerplate with test examples for several components.
- git
- brew (https://brew.sh)
brew install nvm
Clone the project and then run the following commands:
nvm use
npm install
- if you are using
Visual Studio Code
as your IDE, please consider installing the following extensions to make your life easier:GitLens
,Path Autocomplete
and the official extension for Playwright calledPlaywright Test for VSCode
.
npx playwright test --project=foobar
Summary of command line arguments:
yarn playwright test
-> the command used by Playwright to run all the tests from the tests
folder. If you want to run a specific test and not the whole suite, please refer to this documentation.
--project=foobar
-> where foobar is the browser on which you want to run your tests (e.g. chromium
, firefox
, etc.). Please refer to this documentation for more information.
Please note that Playwright supports several flags when running tests, such as --workers
, --debug
, etc. Please check the official documentation if you want to customise your command further.
Read more about configuring Playwright.