Skip to content

Commit

Permalink
👷 chore(ci): Run headful E2E tests on CI (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
duckception authored Oct 9, 2023
1 parent e58595c commit 5378e6d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 6 deletions.
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

0 comments on commit 5378e6d

Please sign in to comment.