Skip to content

E2E testing setup that can be applied in the real world.

License

Notifications You must be signed in to change notification settings

danilofeijo/playwright-lab

Repository files navigation

Badge ServeRest GitHub

playwright-lab

Icon Playwright Icon laboratory

A E2E test automation setup that you can apply in the real world.

This project was inspired by the cypress-lab repo which has the same purpose but using Cypress framework.

Features

Test suite

  • Playwright, to create and run E2E tests
  • ServeRest, an amazing server that simulates an e-commerce to be tested
  • Faker, to generate randon data for tests
  • ✅ Page Object model, to organize test structure
  • Environment config, to run tests in multiple environment
  • Test retry , to repeat failed tests and avoid flakiness

Code quality

CI/CD

Setup

  1. Clone repo and access project folder

    https://github.com/danilofeijo/playwright-lab.git && cd playwright-lab

  2. Install project dependencies

    npm install

CLI commands

Tests Execution

npx playwright test is the default command. It runs tests in headless mode (default)

Relevant parameters

  • --ui run tests in UI mode (better dev experience)
  • --project firefox specify which browser you would like to run the tests
  • --headed show you how Playwright interacts with the website.
  • -g "critical" run a test with a specific title
  • --loremIpsum specify which environment you would like to run the tests

The full list of parameters is available at Running Tests page on Playwright docs.

References

About

E2E testing setup that can be applied in the real world.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published