From 5378e6dba002fa63bc93067bc5c2e9be2048287d Mon Sep 17 00:00:00 2001 From: Daniel Izdebski Date: Mon, 9 Oct 2023 19:31:28 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20chore(ci):=20Run=20headful=20E2E?= =?UTF-8?q?=20tests=20on=20CI=20(#925)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 47 +++++++++++++++++++++++++++++++---- package.json | 1 + turbo.json | 3 +++ wallets/metamask/package.json | 2 +- 4 files changed, 47 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b0405cb59..b9f568d8d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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 diff --git a/package.json b/package.json index 4def146e9..fb1c2385c 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/turbo.json b/turbo.json index 9292534fe..43c2f4c0d 100644 --- a/turbo.json +++ b/turbo.json @@ -10,6 +10,9 @@ }, "test:e2e:headless": { "dependsOn": ["build"] + }, + "test:e2e:headful": { + "dependsOn": ["build"] } } } diff --git a/wallets/metamask/package.json b/wallets/metamask/package.json index e70ff6819..85a5bf201 100644 --- a/wallets/metamask/package.json +++ b/wallets/metamask/package.json @@ -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"