Skip to content

Commit 40b42de

Browse files
author
Thomas Schoemaecker
committed
Update README.md
1 parent 1f09c5d commit 40b42de

1 file changed

Lines changed: 34 additions & 13 deletions

File tree

README.md

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ Cucumber.js + Playwright integration with BrowserStack for E2E functional testin
66

77
```
88
├── browserstack.yml # BrowserStack configuration (platforms, credentials, etc.)
9-
├── cucumber.js # Cucumber configuration
9+
├── cucumber.js # Cucumber runner configuration
1010
├── features/
11-
│ ├── search.feature # Sample product search / navigation tests
12-
│ ├── cart.feature # Sample add-to-cart test
11+
│ ├── search.feature # Product search & vendor filtering scenarios
12+
│ ├── cart.feature # Add-to-cart scenario
1313
│ ├── local.feature # BrowserStack Local tunnel test
1414
│ ├── step_definitions/
1515
│ │ ├── search-steps.js # Step definitions for search scenarios
1616
│ │ ├── cart-steps.js # Step definitions for cart scenarios
1717
│ │ └── local-steps.js # Step definitions for local testing
1818
│ └── support/
19-
│ ├── world.js # Custom World: Playwright browser lifecycle + BrowserStack CDP
19+
│ ├── world.js # Custom World: Playwright browser lifecycle
2020
│ └── hooks.js # Before/After hooks (browser setup, screenshot on failure)
2121
├── package.json
2222
└── README.md
@@ -27,6 +27,8 @@ Cucumber.js + Playwright integration with BrowserStack for E2E functional testin
2727
1. Clone the repo and install dependencies:
2828

2929
```bash
30+
git clone <repo-url>
31+
cd cucumber-playwright-browserstack
3032
npm install
3133
```
3234

@@ -41,9 +43,9 @@ Or update `userName` and `accessKey` in `browserstack.yml`.
4143

4244
## Running Tests
4345

44-
### Run sample tests on BrowserStack
46+
### Run search tests on BrowserStack
4547

46-
Runs the search and product features against [bstackdemo.com](https://bstackdemo.com/) on the platforms defined in `browserstack.yml`:
48+
Runs `search.feature` against [bstackdemo.com](https://bstackdemo.com/) across all platforms defined in `browserstack.yml`:
4749

4850
```bash
4951
npm run sample-test
@@ -57,30 +59,49 @@ Verifies that the BrowserStack Local tunnel is working:
5759
npm run sample-local-test
5860
```
5961

62+
### Run all tests on BrowserStack
63+
64+
Runs every feature file (search, cart, local) across all platforms:
65+
66+
```bash
67+
npm run sample-all-test
68+
```
69+
6070
### Run tests locally (without BrowserStack)
6171

62-
If you want to run the Cucumber tests directly (connects to BrowserStack CDP by default — you can modify `world.js` to launch a local browser instead):
72+
Runs the Cucumber tests directly using a local Playwright browser:
6373

6474
```bash
6575
npm test
6676
```
6777

6878
## How It Works
6979

70-
- **Cucumber.js** provides the BDD test structure with Gherkin feature files.
71-
- **Playwright** handles all browser automation (navigation, clicks, assertions).
72-
- **BrowserStack SDK** (`browserstack-node-sdk`) wraps the Cucumber runner to manage platform distribution, parallel execution, BrowserStack Local tunneling, and test reporting.
73-
- The custom `World` class in `features/support/world.js` connects Playwright to BrowserStack via the CDP WebSocket endpoint (`wss://cdp.browserstack.com/playwright`).
80+
- **Cucumber.js** provides the BDD layer with Gherkin feature files and step definitions.
81+
- **Playwright** handles browser automation (navigation, clicks, assertions) via `chromium.launch()`.
82+
- **BrowserStack SDK** (`browserstack-node-sdk`) wraps the Cucumber runner and intercepts Playwright's browser launch. It routes execution to BrowserStack, managing platform distribution, parallel execution, Local tunneling, and test reporting — all configured through `browserstack.yml`.
7483

7584
## Configuration
7685

7786
### Platforms
7887

79-
Edit `browserstack.yml` to change which browsers / OS combinations to test on. See the [full platform list](https://www.browserstack.com/list-of-browsers-and-platforms/automate).
88+
Edit the `platforms` section in `browserstack.yml` to change which browsers and OS combinations to test on. The default configuration runs on:
89+
90+
| OS | Browser |
91+
|-------------|---------------------|
92+
| Windows 11 | Chrome (latest) |
93+
| macOS Ventura | WebKit (latest) |
94+
| Windows 11 | Firefox (latest) |
95+
96+
See the [full platform list](https://www.browserstack.com/list-of-browsers-and-platforms/automate).
97+
98+
### Parallelism
99+
100+
Adjust `parallelsPerPlatform` in `browserstack.yml` to control how many parallel sessions run per platform.
80101

81102
### Timeouts
82103

83-
The default Cucumber timeout is set to 60 seconds in `features/support/world.js`. Adjust via `setDefaultTimeout()`.
104+
The default Cucumber step timeout is 60 seconds, set in `features/support/world.js` via `setDefaultTimeout()`.
84105

85106
## Viewing Results
86107

0 commit comments

Comments
 (0)