npx playwright test: headless mode npx playwright test: headed: head mode.
Note: If you run your test cases, by default, run all your test cases in headless mode. Once all the test cases are executed, html report is generated. You can run the below command to see the HTML.
Report: npx playwright show-report
Execute a specific test case and browser:
npx playwright codegen
npx playwright codegen --help
npx playwright codegen --save-storage=auth.json
npx playwright codegen --load-storage=auth.json [<http://localhost:3000>](<http://localhost:3000/>)
Debugging: debugging a test script is the process of finding and fixing errors in a script.
npx playwright --debug
npx playwright test signin.spec.ts --debug
npx playwright test signin.spec.ts:9 --debug //line number of specific test case.
npx playwright test signin.spec.ts --debug --project=firefox
npx playwright test signin.spec.ts --project=chromium --headed
npx playwright test sign-up.spec.ts --project=test --headed
npx playwright test e2e-checkout-flow.spec.ts --project=chromium --headed
await page.pause(): You need to manually step over to the next line. const url = page.url()