Skip to content

Commit 648aa10

Browse files
authored
Merge pull request #8714 from eth3lbert/e2e-ci
CI: Add e2e test
2 parents 91d64a1 + 10b5f24 commit 648aa10

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,43 @@ jobs:
195195

196196
- if: github.repository != 'rust-lang/crates.io'
197197
run: pnpm test-coverage
198+
199+
e2e-test:
200+
name: Frontend / Test (playwright)
201+
runs-on: ubuntu-22.04
202+
needs: changed-files
203+
timeout-minutes: 60
204+
if: needs.changed-files.outputs.non-rust == 'true'
205+
206+
env:
207+
JOBS: 1 # See https://git.io/vdao3 for details.
208+
209+
# Percy secrets are included here to enable Percy's GitHub integration
210+
# on community-submitted PRs
211+
PERCY_TOKEN: web_0a783d8086b6f996809f3e751d032dd6d156782082bcd1423b9b860113c75054
212+
213+
steps:
214+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
215+
216+
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
217+
with:
218+
version: ${{ env.PNPM_VERSION }}
219+
220+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
221+
with:
222+
cache: pnpm
223+
node-version-file: package.json
224+
225+
- run: pnpm install
226+
227+
- run: pnpm playwright install chromium
228+
229+
- if: github.repository == 'rust-lang/crates.io'
230+
run: pnpm percy exec -- pnpm e2e
231+
232+
- uses: actions/upload-artifact@v4
233+
if: ${{ !cancelled() }}
234+
with:
235+
name: playwright-report
236+
path: playwright-report/
237+
retention-days: 14

playwright.config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ export default defineConfig({
1818
/* Retry on CI only */
1919
retries: process.env.CI ? 2 : 0,
2020
/* Opt out of parallel tests on CI. */
21-
workers: process.env.CI ? 2 : undefined,
21+
workers: process.env.CI ? 1 : undefined,
2222
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
23-
reporter: process.env.CI ? 'dot' : [['html', { open: 'never' }]],
23+
reporter: process.env.CI
24+
? [['github'], ['html', { outputFolder: 'playwright-report' }]]
25+
: [['html', { open: 'never' }]],
2426
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2527
use: {
2628
/* Base URL to use in actions like `await page.goto('/')`. */
@@ -73,5 +75,6 @@ export default defineConfig({
7375
command: 'pnpm start',
7476
url: 'http://127.0.0.1:4200',
7577
reuseExistingServer: !process.env.CI,
78+
timeout: 5 * 60 * 1000,
7679
},
7780
});

0 commit comments

Comments
 (0)