-
Notifications
You must be signed in to change notification settings - Fork 48
65 lines (54 loc) · 2.14 KB
/
browserstack.yml
File metadata and controls
65 lines (54 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: BrowserStack
on:
workflow_dispatch: # Manual trigger only
push:
branches: [main] # Run on merge to main
pull_request:
branches: [main]
types: [labeled] # Trigger by adding label 'browserstack'
jobs:
cross-browser:
name: Cross-Browser Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install flask pytest pytest-playwright requests browserstack-sdk
- name: Install Playwright browsers
run: python3 -m playwright install chromium
- name: Start ClawMetry server
run: |
OPENCLAW_GATEWAY_TOKEN=ci-test-token python3 dashboard.py --port 8900 --no-debug &
for i in $(seq 1 30); do
curl -sf -H "Authorization: Bearer ci-test-token" http://localhost:8900/api/health && echo "Server ready" && break
sleep 1
done
- name: Set up BrowserStack env
uses: browserstack/github-actions/setup-env@master
with:
username: ${{ secrets.BROWSERSTACK_USERNAME }}
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
- name: Start BrowserStack Local Tunnel
uses: browserstack/github-actions/setup-local@master
with:
local-testing: start
local-identifier: clawmetry-${{ github.run_id }}
- name: Run tests via BrowserStack SDK
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
BROWSERSTACK_LOCAL_IDENTIFIER: clawmetry-${{ github.run_id }}
CLAWMETRY_URL: http://localhost:8900
CLAWMETRY_TOKEN: ci-test-token
run: |
BUILD_NUMBER=${{ github.run_number }} browserstack-sdk python3 -m pytest tests/test_e2e_browserstack.py -v --tb=short
- name: Stop BrowserStack Local Tunnel
if: always()
uses: browserstack/github-actions/setup-local@master
with:
local-testing: stop
local-identifier: clawmetry-${{ github.run_id }}