Skip to content

SigitasR/surf-task

Repository files navigation

Tech task solution

Automated test suite using TypeScript + Playwright.

Project setup and structure

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

Running tests

Entire suite:

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.

Individual tests:

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published