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(ci): Run headful E2E tests on CI #925

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
47 changes: 42 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- name: Run tests
run: pnpm run test

test-e2e:
name: Run E2E tests
test-e2e-headless:
name: Run E2E tests (headless)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -39,13 +39,50 @@ jobs:
run: pnpm run build

- name: Run E2E tests (headless)
run: pnpm run test:e2e:headless
run: pnpm run test:e2e:headless -- --output "test-results-headless"

- name: Archive Playwright traces
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: playwright-traces
name: playwright-traces-headless
path: |
wallets/metamask/test-results
wallets/metamask/test-results-headless/
if-no-files-found: error

test-e2e-headful:
name: Run E2E tests (headful)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node & Install dependencies
uses: ./.github/actions/setup

# For now, we only need Chromium.
- name: Install browsers for Playwright
run: pnpm dlx playwright install chromium

- name: Build project
run: pnpm run build

- name: Install linux dependencies
run: |
sudo apt-get install --no-install-recommends -y \
xvfb

- name: Build project
run: pnpm run build

- name: Run E2E tests (headful)
run: |
xvfb-run pnpm run test:e2e:headful -- --output "test-results-headful"

- name: Archive Playwright traces
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: playwright-traces-headful
path: |
wallets/metamask/test-results-headful/
if-no-files-found: error
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"sort-package-json": "sort-package-json 'package.json' '{packages,wallets,examples}/*/package.json'",
"sort-package-json:check": "sort-package-json 'package.json' '{packages,wallets,examples}/*/package.json' --check",
"test": "turbo test",
"test:e2e:headful": "turbo test:e2e:headful",
"test:e2e:headless": "turbo test:e2e:headless"
},
"lint-staged": {
Expand Down
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
},
"test:e2e:headless": {
"dependsOn": ["build"]
},
"test:e2e:headful": {
"dependsOn": ["build"]
}
}
}
2 changes: 1 addition & 1 deletion wallets/metamask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"clean": "rimraf dist types",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"test:e2e": "playwright test",
"test:e2e:headful": "playwright test",
"test:e2e:headless": "HEADLESS=true playwright test",
"test:watch": "vitest watch",
"types:check": "tsc --noEmit"
Expand Down