Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/sdk-sample-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Runs the BrowserStack SDK sample against a given commit and reports a status check.
# Trigger: Actions tab -> "Robot + Playwright SDK sample test" -> Run workflow -> paste the PR's full commit SHA.
# Requires repo secrets: BROWSERSTACK_USERNAME, BROWSERSTACK_ACCESS_KEY.
name: Robot + Playwright SDK sample test

on:
workflow_dispatch:
inputs:
commit_sha:
description: 'The full commit id to build'
required: true

jobs:
sdk-sample:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [ubuntu-latest]
python: ['3.10', '3.11']
name: robot-playwright Python ${{ matrix.python }} sample
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit_sha }}
- name: Mark status check in_progress
uses: actions/github-script@v7
env:
job_name: robot-playwright Python ${{ matrix.python }} sample
commit_sha: ${{ github.event.inputs.commit_sha }}
with:
github-token: ${{ github.token }}
script: |
await github.rest.checks.create({
owner: context.repo.owner, repo: context.repo.repo,
name: process.env.job_name, head_sha: process.env.commit_sha, status: 'in_progress'
}).catch(e => console.log('check create failed:', e.status));
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install
run: |
pip install -r requirements.txt
rfbrowser init
- name: Run sample test
run: |
browserstack-sdk robot test
- name: Mark status check completed
if: always()
uses: actions/github-script@v7
env:
conclusion: ${{ job.status }}
job_name: robot-playwright Python ${{ matrix.python }} sample
commit_sha: ${{ github.event.inputs.commit_sha }}
with:
github-token: ${{ github.token }}
script: |
await github.rest.checks.create({
owner: context.repo.owner, repo: context.repo.repo,
name: process.env.job_name, head_sha: process.env.commit_sha,
status: 'completed', conclusion: process.env.conclusion
}).catch(e => console.log('check create failed:', e.status));
9 changes: 8 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
robotframework-browser
# Pinned: robotframework-browser 19.14+ bundles Playwright Node core 1.60.x, whose
# client classes moved out of `playwright-core/lib/client/`. The BrowserStack SDK's
# injected Playwright wrapper still requires `playwright-core/lib/client/browserContext`,
# so on 1.60 the Node sidecar crashes at startup ("Could not connect to the playwright
# process") and no BrowserStack session is created. 19.13.0 resolves Node core to 1.59.x
# (which keeps `lib/client/`) and stays compatible with the SDK. Unpin once the SDK
# wrapper is updated for Playwright 1.60's bundled core.
robotframework-browser==19.13.0
robotframework
robotframework-pabot
browserstack-sdk
Expand Down
Loading