You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add second sample: BrowserStack Local test (features/local.feature)
Mirrors the 2-sample pattern from cucumber-java-browserstack and
junit-browserstack so customers get one public-site sample plus one
BrowserStack Local sample.
- features/local.feature — navigates http://bs-local.com:45454/ and asserts
the page title contains "BrowserStack Local".
- features/steps/local_steps.py — two steps.
- features/local-html/index.html — title-matching page; start with
`python3 -m http.server 45454 --directory features/local-html` before
running the local feature.
- browserstack.yml — browserstackLocal: true (matches cucumber-java-browserstack
canonical so the SDK starts and stops the tunnel for every run).
- README.md — repo layout updated; Running section split into "Sample test"
and "Local test" subsections with explicit local-server start command.
Live-verified end-to-end: build 03f2c770c3b15871829075c20f45ad4a826b56cf
returns status=passed for all 6 sessions (2 scenarios x 3 Playwright engines:
chromium 148, playwright-firefox 148, playwright-webkit 18.2).
Copy file name to clipboardExpand all lines: README.md
+29-5Lines changed: 29 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,19 +13,39 @@ This repo shows how to run [behave](https://behave.readthedocs.io/) tests on Bro
13
13
* Set `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` as environment variables, or replace `userName` and `accessKey` directly in `browserstack.yml` with your [BrowserStack Username and Access Key](https://www.browserstack.com/accounts/settings). Env vars take precedence.
14
14
15
15
### Running your tests
16
-
Run the sample in parallel across the 3 Playwright browser engines (chromium / firefox / webkit) declared in `browserstack.yml`:
16
+
There are two sample scenarios in `features/`:
17
+
18
+
***`features/sample.feature`** — drives `https://www.bstackdemo.com` (a public site) and adds a product to the cart.
19
+
***`features/local.feature`** — drives `http://bs-local.com:45454/` through the BrowserStack Local tunnel; verifies the page title contains "BrowserStack Local".
20
+
21
+
`browserstack.yml` enables `browserstackLocal: true`, so the SDK starts and stops the BrowserStack Local tunnel for you on every run — no manual binary lifecycle.
22
+
23
+
#### Sample test (public site)
24
+
Runs in parallel across the 3 Playwright browser engines (chromium / firefox / webkit) declared in `browserstack.yml`:
17
25
18
26
```sh
19
27
browserstack-sdk behave features/sample.feature
20
28
```
21
29
30
+
#### Local test (private / localhost host)
31
+
Start a local HTTP server first — `features/local-html/` contains a tiny page titled "BrowserStack Local Test Page":
`bs-local.com` is a hostname BrowserStack Local resolves to your machine inside the remote browser — for your own app, point your scenarios at `http://bs-local.com:<port>/` instead of a public URL.
44
+
22
45
Understand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github).
23
46
24
47
Alternatively the variables can be set in the environment using env or your CI framework (like GitHub Actions or Jenkins). See `.github/workflows/build.yml` for a GitHub Actions example — it runs on `workflow_dispatch` (manual trigger) with a commit SHA input and posts a status check back to that commit.
25
48
26
-
### Testing a private host (BrowserStack Local)
27
-
If your app lives on `localhost`, a staging host, or behind a firewall, set `browserstackLocal: true` in `browserstack.yml` and rerun the same command. The SDK starts and stops the BrowserStack Local tunnel for you — no manual binary download or lifecycle management. Then point your scenarios at `http://bs-local.com:<port>/` (a hostname BrowserStack Local resolves to your machine) instead of a public URL.
28
-
29
49
### How the SDK changes things
30
50
-**One `browserstack.yml`** declares platforms; the SDK picks them up automatically.
31
51
-**The SDK runs platforms in parallel for you** — no hand-rolled parallel runner; the SDK forks one behave run per `(platform × parallelsPerPlatform)` cell.
@@ -39,9 +59,13 @@ If your app lives on `localhost`, a staging host, or behind a firewall, set `bro
0 commit comments