Skip to content

Commit 3a11ba8

Browse files
[WC-1614]: Re-enable firefox e2e (#228)
2 parents 612d0f3 + f643ab7 commit 3a11ba8

File tree

2 files changed

+73
-1
lines changed

2 files changed

+73
-1
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
jobs:
14+
e2e:
15+
name: Run automated end-to-end tests on Firefox
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
packages: read
20+
contents: read
21+
22+
strategy:
23+
# when one test fails, DO NOT cancel the other
24+
fail-fast: false
25+
matrix:
26+
# run 3 copies of the current job in parallel
27+
index: [0, 1, 2]
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
32+
with:
33+
fetch-depth: 0
34+
- name: Setup pnpm
35+
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # v2.2.4
36+
with:
37+
version: ^7.13.4
38+
- name: Setup node
39+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
40+
with:
41+
node-version-file: ".nvmrc"
42+
cache: "pnpm"
43+
- name: Install dependencies
44+
run: pnpm install
45+
- name: "Executing E2E tests"
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
BROWSER_CYPRESS: firefox
49+
run: >-
50+
node
51+
./automation/run-e2e/bin/run-e2e-in-chunks.mjs
52+
--chunks 3
53+
--index ${{ matrix.index }}
54+
--event-name ${{ github.event_name }}
55+
- name: "Fixing files permissions"
56+
if: failure()
57+
run: |
58+
sudo find ${{ github.workspace }}/packages/* -type d -exec chmod 755 {} \;
59+
sudo find ${{ github.workspace }}/packages/* -type f -exec chmod 644 {} \;
60+
- name: "Archive test screenshot diff results"
61+
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
62+
if: failure()
63+
with:
64+
name: test-screenshot-results
65+
path: |
66+
${{ github.workspace }}/packages/**/tests/e2e/screenshot-results/diff/**/*.png
67+
${{ github.workspace }}/packages/**/tests/e2e/screenshot-results/TESTFAIL_*.png
68+
${{ github.workspace }}/packages/**/cypress-visual-screenshots/diff/*.png
69+
${{ github.workspace }}/packages/**/cypress-visual-screenshots/comparison/*.png
70+
${{ github.workspace }}/packages/**/cypress/videos/*.mp4
71+
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)