This repository contains a BDD test framework example using Playwright, playwright-bdd and Page Object Model pattern with Playwright Fixtures.
-
Download the zip file or clone this repository.
-
Change the directory to
playwright-with-bdd
.cd playwright-with-bdd
-
Install
pnpm
. If you have already installed or want to installpnpm
using another installer/package manager, skip this command.npm i -g pnpm
-
Install dependencies.
pnpm install
-
Install browsers.
pnpm playwright install
-
Run tests.
# Run all the tests/scenarios. pnpm test # Run specific test(s)/scenario(s) using specific tag(s). # You can use Feature file level, # or test scenario level tags to fine control the execution. # Run all tests with @login tag. pnpm tagged-test "login" # Run all tests NOT having @cart tag. pnpm not-tagged-test "cart"
-
View nice HTML report(s).
# This command will show the HTML report generated by # Cucumber 'html' reporter. pnpm report # To view the HTML report generated by Playwright's default "html" reporter # use below command pnpm report:debug