Skip to content
  1. Install Playwright
bash
npm install -D playwright
  1. Install the Playwright browsers
bash
npx playwright install
  1. Run Playwright tests
bash
npx playwright test
  1. Run Playwright tests in headless mode
bash
npx playwright test --headed
  1. Run Playwright tests in a specific browser
bash
npx playwright test --browser=firefox
  1. Run Playwright tests with a specific configuration file
bash
npx playwright test --config=playwright.config.ts
  1. Run Playwright tests with a specific test file
bash
npx playwright test tests/example.spec.ts
  1. Run Playwright tests with a specific test file and line number
bash
npx playwright test tests/example.spec.ts:10
  1. Run Playwright tests with a specific test file and line number in headless mode
bash
npx playwright test tests/example.spec.ts:10 --headed
  1. Run Playwright tests with a specific test file and line number in a specific browser
bash
npx playwright test tests/example.spec.ts:10 --browser=firefox
  1. Run Playwright tests with a specific test file and line number in a specific browser and headless mode
bash
npx playwright test tests/example.spec.ts:10 --browser=firefox --headed
  1. Run Playwright tests with a specific test file and line number in a specific browser and headless mode and configuration file
bash
npx playwright test tests/example.spec.ts:10 --browser=firefox --headed --config=playwright.config.ts
  1. Run Playwright tests with a specific test file and line number in a specific browser and headless mode and configuration file and test name
bash
npx playwright test tests/example.spec.ts:10 --browser=firefox --headed --config=playwright.config.ts --test-name="example test"
  1. Run Playwright tests with a specific test file and line number in a specific browser and headless mode and configuration file and test name and test project
bash
npx playwright test tests/example.spec.ts:10 --browser=firefox --headed --config=playwright.config.ts --test-name="example test" --project="example project"
  1. Run Playwright tests with a specific test file and line number in a specific browser and headless mode and configuration file and test name and test project and test group
bash
npx playwright test tests/example.spec.ts:10 --browser=firefox --headed --config=playwright.config.ts --test-name="example test" --project="example project" --group="example group"
  1. Run Playwright tests with a specific test file and line number in a specific browser and headless mode and configuration file and test name and test project and test group and test tag
bash
npx playwright test tests/example.spec.ts:10 --browser=firefox --headed --config=playwright.config.ts --test-name="example test" --project="example project" --group="example group" --tag="example tag"
  1. Run Playwright tests with a specific test file and line number in a specific browser and headless mode and configuration file and test name and test project and test group and test tag and test run
bash
npx playwright test tests/example.spec.ts:10 --browser=firefox --headed --config=playwright.config.ts --test-name="example test" --project="example project" --group="example group" --tag="example tag" --run="example run"
  1. Run Playwright tests with a specific test file and line number in a specific browser and headless mode and configuration file and test name and test project and test group and test tag and test run and test suite
bash
npx playwright test tests/example.spec.ts:10 --browser=firefox --headed --config=playwright.config.ts --test-name="example test" --project="example project" --group="example group" --tag="example tag" --run="example run" --suite="example suite"
  1. Run Playwright tests with a specific test file and line number in a specific browser and headless mode and configuration file and test name and test project and test group and test tag and test run and test suite and test case
bash
npx playwright test tests/example.spec.ts:10 --browser=firefox --headed --config=playwright.config.ts --test-name="example test" --project="example project" --group="example group" --tag="example tag" --run="example run" --suite="example suite" --case="example case"
  1. Run Playwright tests with a specific test file and line number in a specific browser and headless mode and configuration file and test name and test project and test group and test tag and test run and test suite and test case and test step
bash
npx playwright test tests/example.spec.ts:10 --browser=firefox --headed --config=playwright.config.ts --test-name="example test" --project="example project" --group="example group" --tag="example tag" --run="example run" --suite="example suite" --case="example case" --step="example step"
  1. Run Playwright tests with a specific test file and line number in a specific browser and headless mode and configuration file and test name and test project and test group and test tag and test run and test suite and test case and test step and test assertion
bash
npx playwright test tests/example.spec.ts:10 --browser=firefox --headed --config=playwright.config.ts --test-name="example test" --project="example project" --group="example group" --tag="example tag" --run="example run" --suite="example suite" --case="example case" --step="example step" --assertion="example assertion"
  1. Run Playwright tests with a specific test file and line number in a specific browser and headless mode and configuration file and test name and test project and test group and test tag and test run and test suite and test case and test step and test assertion and test result
bash
npx playwright test tests/example.spec.ts:10 --browser=firefox --headed --config=playwright.config.ts --test-name="example test" --project="example project" --group="example group" --tag="example tag" --run="example run" --suite="example suite" --case="example case" --step="example step" --assertion="example assertion" --result="example result"