playwright commands - IliaKobalia/QA-program GitHub Wiki

Playwright Console Cheat Sheet

Run Tests

Link: Command Line

Run test to execute all tests following playwright configuration:

npx playwright test

To run all tests in a headed mode, use option --headed

npx playwright test --headed

To run a specific project from the configuration, specify the project name:

npx playwright test --project chromium

To run a test file, specify the full file name, or a part of its name:

npx playwright test example

To run a single test with a specific title, use the -g option:

npx playwright test -g "has title"

Run Tests in UI mode

Run tests using any of the options from above together with --ui option

Link: UI Mode

npx playwright test --ui

Record a Test

Link: Codegen

Run codegen to open a specified website and start recording the test:

npx playwright codegen https://en.wikipedia.org/