Skip to content

Commit

Permalink
chore: summary example
Browse files Browse the repository at this point in the history
  • Loading branch information
agoldis committed Dec 18, 2024
1 parent efa6708 commit 732a400
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 7 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
47 changes: 47 additions & 0 deletions .github/backup/test-basic-reporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: demo.playwright.reporter
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
basicTests:
strategy:
fail-fast: false
matrix:
# run 3 copies of the current job in parallel
shard: [1, 2, 3]
name: "Playwright Tests - Reporter"
timeout-minutes: 60
runs-on: ubuntu-22.04
container: mcr.microsoft.com/playwright:v1.49.0-jammy

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

# https://github.com/actions/runner-images/issues/6775
- run: |
echo "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/setup-node@v4
with:
node-version: "18.x"

- name: Install dependencies
run: |
npm ci
npx playwright install chrome
- name: Run Basic Tests
continue-on-error: false
working-directory: ./basic
env:
CURRENTS_PROJECT_ID: bnsqNa
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
CURRENTS_CI_BUILD_ID: reporter-${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt }}
run: |
npx playwright test --shard=${{ matrix.shard }}/${{ strategy.job-total }} --config ./playwright.config.reporter.ts
File renamed without changes.
6 changes: 3 additions & 3 deletions .github/workflows/test-basic-reporter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: demo.playwright.reporter
name: demo.playwright.reporter-summary
on:
workflow_dispatch:
pull_request:
Expand All @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
# run 3 copies of the current job in parallel
shard: [1, 2, 3]
shard: [1, 2]
name: "Playwright Tests - Reporter"
timeout-minutes: 60
runs-on: ubuntu-22.04
Expand All @@ -29,7 +29,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "18.x"
node-version: "20.x"

- name: Install dependencies
run: |
Expand Down
10 changes: 9 additions & 1 deletion basic/playwright.config.reporter.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
import { CurrentsConfig, currentsReporter } from "@currents/playwright";
import config from "./pw.config.shared";
export default { ...config, reporter: [["@currents/playwright"]] };

const currentsConfig: CurrentsConfig = {
recordKey: process.env.CURRENTS_RECORD_KEY ?? "",
projectId: process.env.CURRENTS_PROJECT_ID ?? "",
outputFile: ".currents-report.json",
};

export default { ...config, reporter: [currentsReporter(currentsConfig)] };
6 changes: 3 additions & 3 deletions basic/pw.config.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ const config = defineConfig<CurrentsFixtures, CurrentsWorkerFixtures>({
],

webServer: {
command: 'node ./server/index.js',
command: "node ./server/index.js",
port: 4346,
reuseExistingServer: !process.env.CI,
stdout: 'ignore',
stderr: 'pipe',
stdout: "ignore",
stderr: "pipe",
},

/* Folder for test artifacts such as screenshots, videos, traces, etc. */
Expand Down

0 comments on commit 732a400

Please sign in to comment.