Skip to content

Commit 0f337d2

Browse files
Simplify to one yml, drop Makefile / config / local-mode
Karan's review (#1, #2, #4) pushed back on the per-mode config files and the Makefile-as-profile-switcher. Aligning with the canonical cucumber-ruby-browserstack shape (one feature run unchanged): - Drop Makefile and config/{single,local}.yml — the Python SDK reads only ./browserstack.yml so the swap was the workaround; aligning instead means one yml, one command. - Drop features/local.feature, local-html/, and local_steps.py. Customers needing the Local tunnel flip browserstackLocal: true and rerun the same command (documented in README). - Drop buildIdentifier from browserstack.yml — pure dashboard UX, not required, and Karan flagged it as noise. - CI workflow runs browserstack-sdk behave directly (no make targets). - README pruned to single-mode setup + Running + Local-toggle note.
1 parent 2ff9314 commit 0f337d2

10 files changed

Lines changed: 22 additions & 157 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,12 @@ jobs:
5858
cache: pip
5959

6060
- name: Install dependencies
61-
run: make install
61+
run: |
62+
pip install -r requirements.txt
63+
playwright install chromium
6264
63-
- name: Run parallel sample on BrowserStack
64-
run: make parallel
65-
66-
- name: Run local sample on BrowserStack
67-
run: make local
65+
- name: Run sample on BrowserStack
66+
run: browserstack-sdk behave features/sample.feature
6867

6968
- if: always()
7069
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.venv/
22
__pycache__/
33
*.pyc
4-
browserstack.yml.bak
54
log/
65
local.log

Makefile

Lines changed: 0 additions & 40 deletions
This file was deleted.

README.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,38 @@ This repo shows how to run [behave](https://behave.readthedocs.io/) tests on Bro
1010
pip install -r requirements.txt
1111
playwright install chromium
1212
```
13-
Or simply: `make install`
14-
* Set `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` as environment variables, or replace `userName` and `accessKey` directly in `browserstack.yml` (and the variants under `config/`) with your [BrowserStack Username and Access Key](https://www.browserstack.com/accounts/settings). Env vars take precedence.
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.
1514

1615
### Running your tests
17-
* Run tests in parallel across the 3 Playwright browser engines (chromium / firefox / webkit): `make parallel`
18-
* Run a single-platform test: `make single`
19-
* Run with the BrowserStack Local tunnel against a local HTTP server: `make local`
16+
Run the sample in parallel across the 3 Playwright browser engines (chromium / firefox / webkit) declared in `browserstack.yml`:
17+
18+
```sh
19+
browserstack-sdk behave features/sample.feature
20+
```
2021

2122
Understand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github).
2223

2324
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.
2425

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+
2529
### How the SDK changes things
26-
- **One `browserstack.yml`** declares platforms; the SDK picks them up automatically — no per-task config switching inside `environment.py`.
30+
- **One `browserstack.yml`** declares platforms; the SDK picks them up automatically.
2731
- **The SDK runs platforms in parallel for you** — no hand-rolled parallel runner; the SDK forks one behave run per `(platform × parallelsPerPlatform)` cell.
2832
- **The SDK monkeypatches Playwright's browser launches** — the test code calls `chromium.launch()` and the SDK transparently routes the launch to the per-platform browser configured in `browserstack.yml` (chromium, firefox, or webkit). No `chromium.connect(wss_url)` plumbing is needed in customer code.
29-
- **The SDK starts and stops BrowserStack Local** when `browserstackLocal: true` — no manual tunnel lifecycle management.
30-
- **The CLI is `browserstack-sdk behave …`** — the `make` targets shell out to that.
33+
- **The CLI is `browserstack-sdk behave …`** — wraps `behave` and injects the SDK at runtime.
3134

3235
### Repo layout
3336
```
3437
.
35-
├── browserstack.yml # 3-platform parallel default
36-
├── config/
37-
│ ├── browserstack.single.yml # 1 platform
38-
│ └── browserstack.local.yml # 1 platform + browserstackLocal: true
38+
├── browserstack.yml # SDK config: credentials, 3 parallel platforms, Local toggle, reporting
3939
├── requirements.txt
40-
├── Makefile
4140
└── features/
42-
├── sample.feature # bstackdemo add-to-cart scenario
43-
├── local.feature # localhost scenario for the Local tunnel
44-
├── local-html/index.html # static page served on :45454 by `make local`
45-
├── environment.py # behave hooks: launch browser, hand to context.page
41+
├── sample.feature # bstackdemo add-to-cart scenario
42+
├── environment.py # behave hooks: launch browser, hand to context.page
4643
└── steps/
47-
├── sample_steps.py
48-
└── local_steps.py
44+
└── sample_steps.py
4945
```
5046

5147
### Further Reading

browserstack.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ accessKey: YOUR_ACCESS_KEY
1212
# ======================
1313
projectName: BrowserStack Samples
1414
buildName: behave-playwright-sdk-build-1
15-
# `buildIdentifier` is a unique id appended to buildName for every run.
16-
# ${BUILD_NUMBER} (default) is an incremental counter; ${DATE_TIME} is a timestamp.
17-
buildIdentifier: '#${BUILD_NUMBER}'
1815

1916
# `framework` lets the SDK send test context (test name, status) to BrowserStack.
2017
framework: behave
@@ -47,7 +44,8 @@ parallelsPerPlatform: 1
4744
# ===================================
4845
# BrowserStack Local (private hosts)
4946
# ===================================
50-
# Default false in this config. The local-mode example sets this true.
47+
# Set to true to test localhost / staging hosts. The SDK starts and stops
48+
# the BrowserStack Local tunnel for you — no manual binary management.
5149
browserstackLocal: false
5250

5351
# ===========

config/browserstack.local.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

config/browserstack.single.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

features/local-html/index.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

features/local.feature

Lines changed: 0 additions & 5 deletions
This file was deleted.

features/steps/local_steps.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)