feat: injected wallet testing #33
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Playwright Tests | |
on: | |
push: | |
branches: [ "V2" ] | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
branches: [ "V2" ] | |
paths-ignore: | |
- "**.md" | |
concurrency: | |
# Support push/pr as event types with different behaviors each: | |
# 1. push: queue up builds | |
# 2. pr: only allow one run per PR | |
group: ${{ github.workflow }}-${{ github.event.type }}${{ github.event.pull_request.number }} | |
# If there is already a workflow running for the same pull request, cancel it | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
env: | |
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }} | |
jobs: | |
e2e_tests: | |
name: 'Playwright Tests - ${{ matrix.project }}' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
project: [chromium, firefox] | |
timeout-minutes: 10 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup-node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: 'npm' | |
cache-dependency-path: 'package-lock.json' | |
- name: Install deps | |
run: npm ci | |
- name: build | |
run: npm run build | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps chromium firefox | |
- name: Run Playwright tests | |
working-directory: ./laboratory | |
run: npx playwright test --project=${{ matrix.project }} | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report-${{ matrix.project }} | |
path: ./laboratory/playwright-report/ | |
retention-days: 7 | |
e2e_injected_tests: | |
name: 'Playwright Injected Wallet Tests' | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup-node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: 'npm' | |
cache-dependency-path: 'package-lock.json' | |
- name: unzip extension data | |
working-directory: ./laboratory/tests/shared/data | |
run: | | |
mkdir metamask-chrome-10.34.0 | |
mkdir mm-storage | |
7z x metamask-chrome-10.34.0.zip -ometamask-chrome-10.34.0 | |
7z x mm-storage.zip -omm-storage | |
- name: Install deps | |
run: npm ci | |
- name: build | |
run: npm run build | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps chromium | |
- name: Run Playwright tests | |
working-directory: ./laboratory | |
run: npx playwright test --project=injected | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report-injected | |
path: ./laboratory/playwright-report/ | |
retention-days: 7 |