Skip to content

Commit

Permalink
ci: fix playwright reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
deltork committed Jan 10, 2025
1 parent 5315518 commit f29c49c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
- name: Run Playwright tests
run: |
npx playwright install --with-deps firefox chromium webkit
npx ng e2e --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob
- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shardIndex }}
path: /playwright-report
path: /blob-report
retention-days: 1
merge-reports:
# Merge reports after playwright-tests, even if some shards have failed
Expand Down
11 changes: 8 additions & 3 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig, devices } from '@playwright/test';

const port = 5100;
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
Expand All @@ -24,13 +24,18 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: process.env['PLAYWRIGHT_TEST_BASE_URL'] ?? 'http://localhost:5100',
baseURL:
process.env['PLAYWRIGHT_TEST_BASE_URL'] ?? 'http://localhost:' + port,

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
testIdAttribute: 'data-test-id',
},

webServer: {
command: 'npx ng serve' + (process.env['CI'] ? '' : ' --port=' + port),
port: process.env['CI'] ? 4200 : port,
reuseExistingServer: !process.env['CI'],
},
/* Configure projects for major browsers */
projects: [
{
Expand Down

0 comments on commit f29c49c

Please sign in to comment.