Skip to content

Commit 6c7118b

Browse files
authored
Merge pull request #2130 from OpenC3/feat/firefox-tests
Add nightly firefox tests
2 parents f88a415 + c1e1e10 commit 6c7118b

File tree

2 files changed

+81
-5
lines changed

2 files changed

+81
-5
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: OpenC3 Playwright Firefox Nightly Tests
2+
3+
on:
4+
schedule:
5+
- cron: '0 6 * * *' # Run at 06:00 UTC (midnight MDT) every day
6+
workflow_dispatch: # Allow manual triggering
7+
8+
jobs:
9+
openc3-firefox-test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 22
18+
- name: openc3.sh build
19+
# This `shell` line is required to get around a known issue: https://github.com/actions/runner/issues/241#issuecomment-745902718
20+
shell: 'script -q -e -c "bash {0}"'
21+
run: ./openc3.sh build
22+
- name: Install playwright dependencies
23+
run: ./playwright.sh install-playwright
24+
working-directory: playwright
25+
- name: Check for test.only
26+
run: yarn playwright test --list --forbid-only
27+
working-directory: playwright
28+
- name: openc3.sh run
29+
# This `shell` line is required to get around a known issue: https://github.com/actions/runner/issues/241#issuecomment-745902718
30+
shell: 'script -q -e -c "bash {0}"'
31+
run: ./openc3.sh run
32+
# Allow the containers to spin up
33+
- name: Sleep for 2min
34+
run: sleep 120s
35+
shell: bash
36+
# Check container status
37+
- name: Check container status
38+
shell: 'script -q -e -c "bash {0}"'
39+
run: |
40+
docker ps
41+
docker logs cosmos-openc3-cosmos-init-1
42+
docker logs cosmos-openc3-operator-1
43+
docker logs cosmos-openc3-cosmos-cmd-tlm-api-1
44+
docker logs cosmos-openc3-cosmos-script-runner-api-1
45+
# Build a test plugin for playwright and a copy so we can 'upgrade'
46+
- name: Build plugin
47+
shell: 'script -q -e -c "bash {0}"'
48+
run: ./playwright.sh build-plugin
49+
working-directory: playwright
50+
# Ensure we're connected and running
51+
- name: Wait for build
52+
run: yarn playwright test --project=firefox tests/wait-for-build.spec.ts
53+
working-directory: playwright
54+
- name: Run Playwright Firefox tests
55+
run: |
56+
yarn playwright test --project=firefox ./tests/**/*.p.spec.ts --grep-invert='enterprise'
57+
yarn playwright test --project=firefox ./tests/**/*.s.spec.ts --workers=1 --grep-invert='enterprise'
58+
working-directory: playwright
59+
- name: Generate coverage
60+
run: yarn fixlinux; yarn cobertura
61+
working-directory: playwright
62+
- uses: codecov/codecov-action@v5
63+
with:
64+
directory: playwright/coverage
65+
flags: firefox-nightly
66+
token: ${{ secrets.CODECOV_TOKEN }}
67+
- name: Upload test artifacts
68+
if: always() # Upload on pass or fail
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: playwright-firefox
72+
path: playwright/test-results
73+
retention-days: 30

playwright/playwright.config.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,14 @@ export default defineConfig({
8282
storageState: STORAGE_STATE,
8383
},
8484
},
85-
// {
86-
// name: 'firefox',
87-
// use: { ...devices['Desktop Firefox'] },
88-
// dependencies: ['setup'],
89-
// },
85+
{
86+
name: 'firefox',
87+
use: {
88+
...devices['Desktop Firefox'],
89+
storageState: STORAGE_STATE,
90+
},
91+
dependencies: ['setup'],
92+
},
9093
// {
9194
// name: 'webkit',
9295
// use: { ...devices['Desktop Safari'] },

0 commit comments

Comments
 (0)