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.
- Node.js installed on your system.
- Note: Cucumber can only run on Node.js versions 14 || 16 || >=18
- BrowserStack account (username and access key).
npm installSet or export your BrowserStack credentials:
export BROWSERSTACK_USERNAME=USERNAME
export BROWSERSTACK_ACCESS_KEY=ACCESS_KEYnpm run singlenpm run parallelnpm run local-singlenpm run local-parallelfeatures/: 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.jsandglobalteardown.js: Files to start and stop BrowserStackLocal tunnel respectively