Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(e2e): Added support for the 'chrome-dev' channel in Playwright FE-803 #1677

Merged
merged 19 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
651c0dd
chore: Added support for the 'chrome-dev' channel in Playwright confi…
nelitow Dec 2, 2024
46a2e3f
chore: update Playwright installation in CI workflow
nelitow Dec 2, 2024
988e681
chore: update Playwright configuration to use 'chrome-beta' channel a…
nelitow Dec 2, 2024
3f4e595
chore: update Playwright installation in CI workflow to separate brow…
nelitow Dec 2, 2024
197e1c4
chore: update Playwright installation in CI workflow to include 'chro…
nelitow Dec 2, 2024
5f03b96
undo changes
nelitow Dec 2, 2024
ae9d2d4
Revert "undo changes"
nelitow Dec 3, 2024
8aefb85
chore: update Playwright configuration and CI workflow to remove 'chr…
nelitow Dec 3, 2024
8183d07
Update playwright.config.ts
nelitow Dec 3, 2024
3da8e4b
Merge branch 'master' into nj/tests/run-tets-on-chrome-dev
nelitow Dec 4, 2024
7f98ae5
Revert "Update playwright.config.ts"
nelitow Dec 4, 2024
c5f809b
Merge branch 'master' into nj/tests/run-tets-on-chrome-dev
nelitow Dec 5, 2024
5fd09a2
chore: enhance E2E testing setup by adding Chrome project and updatin…
nelitow Dec 6, 2024
b86fd0f
Merge branch 'master' into nj/tests/run-tets-on-chrome-dev
nelitow Dec 6, 2024
17eb2ec
feat: enhance E2E testing setup with browser input and new CI workflows
nelitow Dec 6, 2024
2620c75
Merge branch 'master' into nj/tests/run-tets-on-chrome-dev
nelitow Dec 6, 2024
6032b22
fix: adjust Playwright retries based on CI environment
nelitow Dec 6, 2024
20d715d
Merge branch 'nj/tests/run-tets-on-chrome-dev' of https://github.com/…
nelitow Dec 6, 2024
90cafd4
fix: remove maxFailures setting in Playwright config for E2E tests
nelitow Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading