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

test(e2e): Fix Chrome Beta channel #1691

Merged
merged 48 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
48 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
7db7f5f
Merge branch 'master' into nj/tests/run-tets-on-chrome-dev
nelitow Dec 9, 2024
5c5e25a
feat(e2e): add support for Chrome Beta in E2E tests and adjust maxFai…
nelitow Dec 9, 2024
d0d8feb
Merge branch 'master' into nj/tests/run-tets-on-chrome-dev
nelitow Dec 9, 2024
2394951
feat(playwright): adjust retries and maxFailures for CI environments
nelitow Dec 9, 2024
30d54e9
feat(e2e): add logging for inputs and support for Chrome Beta in E2E …
nelitow Dec 9, 2024
abb320d
feat(e2e): update Playwright browser installation to include Chromium…
nelitow Dec 9, 2024
ac5b4d9
feat(playwright): import environment variables in Playwright config
nelitow Dec 9, 2024
7eeff65
refactor(playwright): remove CI-specific retries and maxFailures from…
nelitow Dec 9, 2024
f6ab59d
feat(playwright): add Chromium project configuration to Playwright setup
nelitow Dec 9, 2024
e59298b
refactor(e2e): remove console logging of inputs from GitHub action
nelitow Dec 10, 2024
9d57fcb
Update playwright.config.ts
nelitow Dec 10, 2024
d086585
chore(workflows): rename Playwright report artifacts for stability an…
nelitow Dec 10, 2024
9ca4d18
ci(workflows): allow continuation on error for Chrome Beta tests
nelitow Dec 10, 2024
79a71c4
feat(playwright): add testIgnore configuration for specific test files
nelitow Dec 10, 2024
01c53cf
Update playwright.config.ts
nelitow Dec 10, 2024
04743d6
ci(workflows): increase timeout for E2E contract tests to 20 minutes
nelitow Dec 10, 2024
0d38ab5
Merge branch 'master' into nj/tests/run-tets-on-chrome-dev
nelitow Dec 10, 2024
4464835
fix: add retry logic for tests in CI environment
nelitow Dec 10, 2024
4a75393
fix: add resolution for nanoid package version
nelitow Dec 10, 2024
3d848d2
Merge branch 'master' into nj/tests/run-tets-on-chrome-dev
nelitow Dec 10, 2024
119291f
fix: update nanoid to latest version for improved performance and sec…
nelitow Dec 10, 2024
914bc78
fix: remove retry logic for tests in Playwright configuration
nelitow Dec 10, 2024
ebb1d3d
fix: reduce timeout for E2E tests in GitHub Actions workflow
nelitow Dec 10, 2024
cf40841
refactor: consolidate Playwright browser installation into a reusable…
nelitow Dec 10, 2024
24dd50a
fix: update action.yaml descriptions and format for consistency
nelitow Dec 10, 2024
45247c6
fix: update action.yaml to use the correct path for setup-playwright …
nelitow Dec 10, 2024
4370fe8
Update .github/actions/setup-playwright/action.yaml
nelitow Dec 10, 2024
9b9776e
Update .github/workflows/pr-tests-e2e-crx-lock.yml
nelitow Dec 10, 2024
1d321b8
Update .github/workflows/pr-tests-e2e.yml
nelitow Dec 10, 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
2 changes: 2 additions & 0 deletions .changeset/dry-flies-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
nelitow marked this conversation as resolved.
Show resolved Hide resolved
---
2 changes: 1 addition & 1 deletion .github/actions/e2e-tests-contracts/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ runs:
- name: Install Playwright Browsers (${{ inputs.browser }})
if: inputs.browser != '' && inputs.browser != 'chromium'
shell: bash
run: npx playwright install --with-deps ${{ inputs.browser }}
run: npx playwright install --with-deps chrome-beta chromium
nelitow marked this conversation as resolved.
Show resolved Hide resolved

- name: Run E2E Contract Tests
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-tests-e2e-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
tests-e2e-contracts:
name: Test (Chrome Stable)
runs-on: buildjet-8vcpu-ubuntu-2204
timeout-minutes: 10
timeout-minutes: 20
nelitow marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v4
- uses: FuelLabs/github-actions/setups/node@master
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
tests-e2e-contracts-beta:
name: Test (Chrome Beta)
runs-on: buildjet-8vcpu-ubuntu-2204
timeout-minutes: 10
timeout-minutes: 20
continue-on-error: true
steps:
nelitow marked this conversation as resolved.
Show resolved Hide resolved
- uses: actions/checkout@v4
Expand Down
55 changes: 52 additions & 3 deletions .github/workflows/pr-tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:

jobs:
tests-e2e:
name: Test
name: Test (Chrome Stable)
timeout-minutes: 20
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:

# E2E tests running with Playwright
- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium
run: npx playwright install --with-deps chrome-beta chromium

- name: Run E2E Tests
run: xvfb-run --auto-servernum -- pnpm test:e2e
Expand All @@ -51,7 +51,56 @@ jobs:
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-app-report
name: playwright-app-report-stable
path: packages/app/playwright-results
retention-days: 30

- name: Stop Test Node
run: pnpm node:clean

tests-e2e-beta:
name: Test (Chrome Beta)
timeout-minutes: 20
nelitow marked this conversation as resolved.
Show resolved Hide resolved
runs-on: buildjet-8vcpu-ubuntu-2204
continue-on-error: true
steps:
- uses: actions/checkout@v3
- 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 }}

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

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

- name: Build Application
run: pnpm build:app
env:
## increase node.js m memory limit for building
## with sourcemaps
NODE_OPTIONS: "--max-old-space-size=4096"

# E2E tests running with Playwright
- name: Install Playwright Browsers
run: npx playwright install --with-deps chrome-beta chromium
nelitow marked this conversation as resolved.
Show resolved Hide resolved

- name: Run E2E Tests
run: xvfb-run --auto-servernum -- pnpm test:e2e:beta
timeout-minutes: 15
env:
NODE_ENV: test

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

Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"test:ci": "turbo run test --parallel -- --ci --testLocationInResults --json --coverage",
"test:clear": "pnpm -r exec jest --clearCache",
"test:coverage": "turbo run test --parallel -- --coverage",
"test:e2e": "NODE_ENV=test pnpm build:crx && playwright test --config=packages/app/playwright.config.ts",
"test:e2e": "NODE_ENV=test pnpm build:crx && playwright test --config=packages/app/playwright.config.ts --project=chromium",
"test:e2e:beta": "NODE_ENV=test pnpm build:crx && playwright test --config=packages/app/playwright.config.ts --project=chrome-beta",
"test:e2e:crx-lock": "NODE_ENV=test pnpm build:crx && playwright test --config=packages/app/playwright.crx-lock.config.ts",
"test:e2e:contracts": "NODE_ENV=test pnpm build:crx && pnpm --filter=@fuel-wallet/e2e-contract-tests test:e2e",
"test:appfile": "pnpm --filter=fuels-wallet test --",
Expand Down Expand Up @@ -125,7 +126,8 @@
"fuels": "0.96.1",
"secp256k1@=5.0.0": ">=5.0.1",
"elliptic@<6.6.0": ">=6.6.0",
"cross-spawn@<7.0.5": ">=7.0.5"
"cross-spawn@<7.0.5": ">=7.0.5",
"nanoid@<3.3.8": "3.3.8"
}
}
}
27 changes: 24 additions & 3 deletions packages/app/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { join } from 'node:path';
import { type PlaywrightTestConfig, defineConfig } from '@playwright/test';
// biome-ignore lint/style/useNodejsImportProtocol: <explanation>
import {
type PlaywrightTestConfig,
defineConfig,
devices,
} from '@playwright/test';
import './load.envs';
import './load.envs.cts';

const PORT = process.env.PORT;
Expand All @@ -12,7 +18,7 @@ export const playwrightConfig: PlaywrightTestConfig = {
testDir: 'playwright/',
outputDir: 'playwright-results/',
// stop on first failure
maxFailures: IS_CI ? 1 : undefined,
maxFailures: IS_CI ? 2 : undefined,
reporter: [
['list', { printSteps: true }],
['html', { outputFolder: './playwright-html/' }],
Expand All @@ -31,7 +37,22 @@ export const playwrightConfig: PlaywrightTestConfig = {
screenshot: 'only-on-failure',
headless: false,
},
// ignore lock test because it takes too long and it will be tested in a separate config
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chromium'],
},
},
{
name: 'chrome-beta',
use: {
channel: 'chrome-beta',
...devices['Desktop Chrome'],
},
retries: IS_CI ? 4 : 0,
nelitow marked this conversation as resolved.
Show resolved Hide resolved
},
],
testIgnore: ['playwright/crx/lock.test.ts'],
};

Expand Down
10 changes: 9 additions & 1 deletion packages/app/playwright.crx-lock.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// biome-ignore lint/style/useNodejsImportProtocol: <explanation>
import { join } from 'path';
import { defineConfig } from '@playwright/test';
import { defineConfig, devices } from '@playwright/test';
import { playwrightConfig } from './playwright.config';

const __dirname = new URL('.', import.meta.url).pathname;
Expand All @@ -9,4 +9,12 @@ export default defineConfig({
...playwrightConfig,
testMatch: join(__dirname, './playwright/crx/lock.test.ts'),
testIgnore: undefined,
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chromium'],
},
},
],
});
5 changes: 3 additions & 2 deletions packages/e2e-contract-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const IS_CI = process.env.CI;
const config: PlaywrightTestConfig = defineConfig({
testDir: './playwright',
outputDir: './playwright-results/',
retries: IS_CI ? 1 : 0,
retries: IS_CI ? 2 : 0,
workers: 1,
timeout: 60_000,
timeout: 120_000,
reporter: [['html', { printSteps: true }]],
webServer: {
command: `pnpm dev:e2e-contracts --port ${process.env.PORT}`,
Expand All @@ -39,6 +39,7 @@ const config: PlaywrightTestConfig = defineConfig({
channel: 'chrome-beta',
...devices['Desktop Chrome'],
},
retries: IS_CI ? 4 : 0,
nelitow marked this conversation as resolved.
Show resolved Hide resolved
},
],
});
Expand Down
15 changes: 8 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading