JS/TS based Playwright framework
npm innit
- creates node projectnpm install playwright
- installs playwright frameworknpm install playwright-test
- install playwright-test librarynpm install prettier
- installs prettier (styling) framworknpx playwright test
- runs tests in headless modenpx playwright test -headed
- runs tests in browser headed mode (visual test run)npx playwright test --project=chromium
- runs tests in a specific browsernpx playwright test --project=all
- runs tests in a all browsersnpx test path-to-test/test-file.spec.ts
- runs test from a specific test filenpx playwright test --grep @myTag
- use grep to run tests which have a custom tag. Need to be added in test description section (@ symbol required): ietest("description of test @myTag")
npx playwright test --grep=invert @myTag
- runs all text except for the specified tests specified in @myTag tagnpx playwright test --config=playwright.config.ts
= runs tests against specific configuration filenpx playwright test --project=Chromium
= runs tests against specific browsernpx playwright test --reporter=line
= enables line reporting, which is minimal reporting. Not recommendednpx playwright test --reporter=list
= enables list reporting, which is set by default by Playwright. Gives a list of tests run including path & describe description, test line number as, test description as well duration of testnpx playwright test --reporter=dot
= enables dot reporting, shows green or red dots... green for pass and red for fail.npx playwright test --reporter=junit
= enables junit reporting, test details in xml format within terminal.npx playwright test --reporter=html
= enables html reporting, test details in html format and stored within playwright-report directory.
- Use .ts (typescript) file extensions