/playwright-boilerplate

A simple boilerplate for getting started with Playwright, a powerful browser automation library. This repository provides an initial setup for writing and running end-to-end tests using Playwright, with an example test included to verify that the setup works correctly.

Primary LanguageJavaScript

Testing Playwright with TypeScript on LambdaTest or Local Machine

Setup

  • Clone the repository:
   git clone https://github.com/Gobinath90/playwright-boilerplate.git
  • Navigate to the project directory:
cd playwright-boilerplate
  • Install project dependencies:
npm install
  • Install Playwright browsers: Playwright requires browser binaries to run. You can install them with the following command:
npx playwright install

If you only want to install Chromium, use:

npx playwright install chromium

Running your tests

  • To run all tests, use, run
npm run test

Running Your Allure Report

  • Run the tests with the Allure reporter:
playwright test --reporter=allure-playwright
  • Generate the Allure report:
allure generate allure-results --clean -o allure-report
  • Open the Allure report:
allure open allure-report