Skip to content

Commit a1b6ea2

Browse files
test: re-enable firefox e2e
1 parent 6dfa023 commit a1b6ea2

File tree

2 files changed

+85
-1
lines changed

2 files changed

+85
-1
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Run E2E test on Firefox
2+
# This workflow is used to test our widgets against the Firefox browser weekly.
3+
4+
on:
5+
schedule:
6+
# At 03:00 on Tuesday.
7+
- cron: "0 03 * * 2"
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
env:
14+
since_flag: ${{ github.event_name == 'pull_request' && format('--filter "...[origin/{0}]"', github.base_ref) || '' }}
15+
16+
jobs:
17+
e2e:
18+
name: Run automated end-to-end tests on Firefox
19+
runs-on: ubuntu-latest
20+
21+
permissions:
22+
packages: read
23+
contents: read
24+
25+
strategy:
26+
# when one test fails, DO NOT cancel the other
27+
fail-fast: false
28+
matrix:
29+
# run 3 copies of the current job in parallel
30+
index: [0, 1, 2]
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
35+
with:
36+
fetch-depth: 0
37+
- name: Setup pnpm
38+
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # v2.2.4
39+
with:
40+
version: ^7.13.4
41+
- name: Setup node
42+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
43+
with:
44+
node-version-file: ".nvmrc"
45+
cache: "pnpm"
46+
- name: Get sha of main
47+
run: echo "main_sha=$(git rev-parse origin/main)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_ENV' || '$GITHUB_ENV' }}
48+
- name: Restore Turbo Cache
49+
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
50+
with:
51+
path: node_modules/.cache/turbo
52+
key: turbo-cache-${{ runner.os }}-e2e-chunk-${{ matrix.index }}-${{ env.main_sha }}
53+
restore-keys: |
54+
turbo-cache-${{ runner.os }}-e2e-chunk-${{ matrix.index }}
55+
- name: Install dependencies
56+
run: pnpm install
57+
- name: "Executing E2E tests"
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
BROWSER_CYPRESS: firefox
61+
run: >-
62+
node
63+
./automation/run-e2e/bin/run-e2e-in-chunks.mjs
64+
--chunks 3
65+
--index ${{ matrix.index }}
66+
--event-name ${{ github.event_name }}
67+
- name: "Fixing files permissions"
68+
if: failure()
69+
run: |
70+
sudo find ${{ github.workspace }}/packages/* -type d -exec chmod 755 {} \;
71+
sudo find ${{ github.workspace }}/packages/* -type f -exec chmod 644 {} \;
72+
- name: "Archive test screenshot diff results"
73+
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
74+
if: failure()
75+
with:
76+
name: test-screenshot-results
77+
path: |
78+
${{ github.workspace }}/packages/**/tests/e2e/screenshot-results/diff/**/*.png
79+
${{ github.workspace }}/packages/**/tests/e2e/screenshot-results/TESTFAIL_*.png
80+
${{ github.workspace }}/packages/**/cypress-visual-screenshots/diff/*.png
81+
${{ github.workspace }}/packages/**/cypress-visual-screenshots/comparison/*.png
82+
${{ github.workspace }}/packages/**/cypress/videos/*.mp4
83+
if-no-files-found: error

automation/run-e2e/lib/setup-test-project.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export async function setupTestProject() {
2121
sh.config.silent = false;
2222

2323
if (testsFiles.length !== 0) {
24-
throw new Error("tests dir is not empty");
24+
console.log("Test project directory already exists, cleaning up...");
25+
rm("-rf", "tests");
2526
}
2627

2728
const archivePath = await downloadTestProject(

0 commit comments

Comments
 (0)