Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.3 KB

README.md

File metadata and controls

57 lines (41 loc) · 1.3 KB

About

This repository contains a BDD test framework example using Playwright, playwright-bdd and Page Object Model pattern with Playwright Fixtures.

Usage

  1. Download the zip file or clone this repository.

  2. Change the directory to playwright-with-bdd.

    cd playwright-with-bdd
  3. Install pnpm. If you have already installed or want to install pnpm using another installer/package manager, skip this command.

    npm i -g pnpm
  4. Install dependencies.

    pnpm install
  5. Install browsers.

    pnpm playwright install
  6. 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"
  7. 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