Skip to content

Repository files navigation

Playwright Cucumber Setup with BrowserStack

This repository demonstrates how to set up end-to-end testing for web applications using Playwright and Cucumber, with BrowserStack for cross-browser and cross-device testing.

Prerequisites

  • Node.js installed on your system.
  • Note: Cucumber can only run on Node.js versions 14 || 16 || >=18
  • BrowserStack account (username and access key).

Installation

npm install

Set BrowserStack Credentials

Set or export your BrowserStack credentials:

export BROWSERSTACK_USERNAME=USERNAME
export BROWSERSTACK_ACCESS_KEY=ACCESS_KEY

Usage

Run a single test

npm run single

Run tests in parallel

npm run parallel

Run a single test with local testing

npm run local-single

Run tests in parallel with local testing

npm run local-parallel

Project Structure

  • features/: Directory containing Cucumber feature files.
  • step_definitions/: Directory containing step definitions for Cucumber.
  • setup/hooks.js: File to setup the browser object and initiate connection with BrowserStack.
  • browserstack.config.js: List of Browsers for cross-browser testing.
  • single.js: Script to run test command for a single test.
  • parallel.js: Script to run multiple test commands for running tests in parallel.
  • globalsetup.js and globalteardown.js: Files to start and stop BrowserStackLocal tunnel respectively

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages