Skip to content

Commit 4fe865a

Browse files
authored
chore(e2e): Added support for the 'chrome-dev' channel in Playwright FE-803 (#1677)
~~Add~~ Replace `chromium` with `chrome-beta` tests as a way to catch breaking changes early on. I would have chosen the `dev` channel as it gives us 9 to 12 weeks to catch those changes, as the `beta` channel would only give 4 to 6 weeks and the `Canary` version is too unstable, but `dev` is not available on playwright at the moment. Decided to replace to the beta version instead of running on both as to not increase the test time. If it runs on beta we can be safe that it runs on stable.
1 parent 6121fab commit 4fe865a

File tree

3 files changed

+71
-11
lines changed

3 files changed

+71
-11
lines changed

.github/actions/e2e-tests-contracts/action.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ inputs:
1010
genesisSecret:
1111
description: Secret of genesis to fund the master wallet
1212
required: false
13+
browser:
14+
description: Browser to run tests on (chromium or chrome-beta)
15+
required: true
1316

1417
runs:
1518
using: 'composite'
@@ -26,13 +29,13 @@ runs:
2629
NODE_ENV: test
2730

2831
# E2E tests running with Playwright
29-
- name: Install Playwright Browsers
32+
- name: Install Playwright Browsers (${{ inputs.browser }})
3033
shell: bash
31-
run: npx playwright install --with-deps chromium
34+
run: npx playwright install --with-deps ${{ inputs.browser }}
3235

3336
- name: Run E2E Contract Tests
3437
shell: bash
35-
run: xvfb-run --auto-servernum -- pnpm test:e2e:contracts
38+
run: xvfb-run --auto-servernum -- pnpm test:e2e:contracts --project=${{ inputs.browser }}
3639
env:
3740
PORT: 5173
3841
VITE_FUEL_PROVIDER_URL: ${{ inputs.providerUrl }}
@@ -42,7 +45,7 @@ runs:
4245
- uses: actions/upload-artifact@v4
4346
if: always()
4447
with:
45-
name: playwright-report
48+
name: playwright-report-${{ inputs.browser }}
4649
path: |
4750
packages/app/playwright-report/
4851
packages/app/playwright-html/

.github/workflows/pr-tests-e2e-contracts.yml

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ concurrency:
1111

1212
jobs:
1313
tests-e2e-contracts:
14-
name: Test
14+
name: Test (Chrome Stable)
1515
runs-on: buildjet-8vcpu-ubuntu-2204
1616
timeout-minutes: 10
1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
- uses: FuelLabs/github-actions/setups/node@master
2020
with:
2121
node-version: 20.11.0
@@ -41,16 +41,65 @@ jobs:
4141
run: pnpm deploy:contracts
4242
working-directory: ./packages/e2e-contract-tests
4343

44-
- name: Run E2E Contract Tests - Local
44+
- name: Run E2E Contract Tests
4545
uses: ./.github/actions/e2e-tests-contracts
4646
with:
4747
providerUrl: "http://localhost:4000/v1/graphql"
4848
masterMnemonic: ${{ secrets.VITE_MASTER_WALLET_MNEMONIC }}
4949
genesisSecret: "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298"
50+
browser: 'chromium'
5051

5152
- uses: actions/upload-artifact@v4
5253
if: always()
5354
with:
5455
name: playwright-e2e-contract-tests-report
5556
path: packages/e2e-contract-tests/playwright-results
56-
retention-days: 30
57+
retention-days: 30
58+
59+
tests-e2e-contracts-beta:
60+
name: Test (Chrome Beta)
61+
runs-on: buildjet-8vcpu-ubuntu-2204
62+
timeout-minutes: 10
63+
continue-on-error: true
64+
steps:
65+
- uses: actions/checkout@v4
66+
- uses: FuelLabs/github-actions/setups/node@master
67+
with:
68+
node-version: 20.11.0
69+
pnpm-version: 9.5.0
70+
71+
- uses: FuelLabs/github-actions/setups/docker@master
72+
with:
73+
username: ${{ github.repository_owner }}
74+
password: ${{ secrets.GITHUB_TOKEN }}
75+
- uses: ./.github/actions/setup-rust
76+
77+
- name: Run PNPM install
78+
id: pnpm-cache
79+
run:
80+
pnpm recursive install --frozen-lockfile
81+
82+
- name: Start Test Node
83+
run: pnpm node:up
84+
85+
- name: Generate .env app
86+
run: cp packages/app/.env.example packages/app/.env
87+
88+
- name: Build & Deploy Contracts
89+
run: pnpm deploy:contracts
90+
working-directory: ./packages/e2e-contract-tests
91+
- uses: ./.github/actions/e2e-tests-contracts
92+
with:
93+
providerUrl: "http://localhost:4000/v1/graphql"
94+
masterMnemonic: ${{ secrets.VITE_MASTER_WALLET_MNEMONIC }}
95+
genesisSecret: "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298"
96+
browser: 'chrome-beta'
97+
98+
- uses: actions/upload-artifact@v4
99+
if: always()
100+
with:
101+
name: playwright-e2e-contract-tests-report-beta
102+
path: packages/e2e-contract-tests/playwright-results
103+
retention-days: 30
104+
105+

packages/e2e-contract-tests/playwright.config.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ const IS_CI = process.env.CI;
1010
const config: PlaywrightTestConfig = defineConfig({
1111
testDir: './playwright',
1212
outputDir: './playwright-results/',
13-
retries: 1,
14-
maxFailures: IS_CI ? 1 : undefined,
13+
retries: IS_CI ? 1 : 0,
1514
workers: 1,
1615
timeout: 60_000,
1716
reporter: [['html', { printSteps: true }]],
@@ -30,7 +29,16 @@ const config: PlaywrightTestConfig = defineConfig({
3029
projects: [
3130
{
3231
name: 'chromium',
33-
use: { ...devices['Desktop Chrome'] },
32+
use: {
33+
...devices['Desktop Chromium'],
34+
},
35+
},
36+
{
37+
name: 'chrome-beta',
38+
use: {
39+
channel: 'chrome-beta',
40+
...devices['Desktop Chrome'],
41+
},
3442
},
3543
],
3644
});

0 commit comments

Comments
 (0)