Automated test suite using TypeScript + Playwright.
To run the project you will need working Node.js (at least version 18.19) environment with npm
package manager. Project is organized into a couple of directories:
page-objects
- contains page object and components that describe web page elements
tests
- test suite files
Inside project directory run NPM to install project dependencies:
npm install
Then install Playwright browsers:
npx playwright install
There are several scripts in package.json
to simplify test execution:
npm run chrome
and
npm run firefox
will run entire suite in corresponding browser.
To view the report run:
npm run report
Report contains test execution details and video recording.
Playwright allows running individual spec files or tests. To run all tests from specific file, use:
npx playwright test coupon.spec.ts --headed --project chromium
To run individual test by its name, use partial or full name:
Valid coupon test case:
npx playwright test -g "valid coupon is applied correctly" --headed --project chromium
Invalid coupon test case
npx playwright test -g "invalid coupon is applied" --headed --project chromium
Subscription plans page test case
npx playwright test -g "subscription plans page" --headed --project chromium
Step navigation test case
npx playwright test -g "step navigation" --headed --project chromium
If test execution is too fast you can slow it down by uncommenting launchOptions: { slowMo: 500 }
option in playwright.config.ts