Skip to content

Commit

Permalink
chore(e2e): Added support for the 'chrome-dev' channel in Playwright …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
nelitow authored Dec 6, 2024
1 parent 6121fab commit 4fe865a
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 11 deletions.
11 changes: 7 additions & 4 deletions .github/actions/e2e-tests-contracts/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ inputs:
genesisSecret:
description: Secret of genesis to fund the master wallet
required: false
browser:
description: Browser to run tests on (chromium or chrome-beta)
required: true

runs:
using: 'composite'
Expand All @@ -26,13 +29,13 @@ runs:
NODE_ENV: test

# E2E tests running with Playwright
- name: Install Playwright Browsers
- name: Install Playwright Browsers (${{ inputs.browser }})
shell: bash
run: npx playwright install --with-deps chromium
run: npx playwright install --with-deps ${{ inputs.browser }}

- name: Run E2E Contract Tests
shell: bash
run: xvfb-run --auto-servernum -- pnpm test:e2e:contracts
run: xvfb-run --auto-servernum -- pnpm test:e2e:contracts --project=${{ inputs.browser }}
env:
PORT: 5173
VITE_FUEL_PROVIDER_URL: ${{ inputs.providerUrl }}
Expand All @@ -42,7 +45,7 @@ runs:
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
name: playwright-report-${{ inputs.browser }}
path: |
packages/app/playwright-report/
packages/app/playwright-html/
Expand Down
57 changes: 53 additions & 4 deletions .github/workflows/pr-tests-e2e-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ concurrency:

jobs:
tests-e2e-contracts:
name: Test
name: Test (Chrome Stable)
runs-on: buildjet-8vcpu-ubuntu-2204
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: FuelLabs/github-actions/setups/node@master
with:
node-version: 20.11.0
Expand All @@ -41,16 +41,65 @@ jobs:
run: pnpm deploy:contracts
working-directory: ./packages/e2e-contract-tests

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

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-e2e-contract-tests-report
path: packages/e2e-contract-tests/playwright-results
retention-days: 30
retention-days: 30

tests-e2e-contracts-beta:
name: Test (Chrome Beta)
runs-on: buildjet-8vcpu-ubuntu-2204
timeout-minutes: 10
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: FuelLabs/github-actions/setups/node@master
with:
node-version: 20.11.0
pnpm-version: 9.5.0

- uses: FuelLabs/github-actions/setups/docker@master
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/setup-rust

- name: Run PNPM install
id: pnpm-cache
run:
pnpm recursive install --frozen-lockfile

- name: Start Test Node
run: pnpm node:up

- name: Generate .env app
run: cp packages/app/.env.example packages/app/.env

- name: Build & Deploy Contracts
run: pnpm deploy:contracts
working-directory: ./packages/e2e-contract-tests
- uses: ./.github/actions/e2e-tests-contracts
with:
providerUrl: "http://localhost:4000/v1/graphql"
masterMnemonic: ${{ secrets.VITE_MASTER_WALLET_MNEMONIC }}
genesisSecret: "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298"
browser: 'chrome-beta'

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-e2e-contract-tests-report-beta
path: packages/e2e-contract-tests/playwright-results
retention-days: 30


14 changes: 11 additions & 3 deletions packages/e2e-contract-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ const IS_CI = process.env.CI;
const config: PlaywrightTestConfig = defineConfig({
testDir: './playwright',
outputDir: './playwright-results/',
retries: 1,
maxFailures: IS_CI ? 1 : undefined,
retries: IS_CI ? 1 : 0,
workers: 1,
timeout: 60_000,
reporter: [['html', { printSteps: true }]],
Expand All @@ -30,7 +29,16 @@ const config: PlaywrightTestConfig = defineConfig({
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
use: {
...devices['Desktop Chromium'],
},
},
{
name: 'chrome-beta',
use: {
channel: 'chrome-beta',
...devices['Desktop Chrome'],
},
},
],
});
Expand Down

0 comments on commit 4fe865a

Please sign in to comment.