Skip to content

Commit

Permalink
fix and split playwright configure
Browse files Browse the repository at this point in the history
  • Loading branch information
peccu committed Jan 4, 2024
1 parent 18890f0 commit 73c5548
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
# output report
# need to preview with npx playwright show-report name-of-my-extracted-playwright-report
html_report:
name: 'Playwright Tests : running on ubuntu-latest'
name: 'Playwright Tests : report to html'
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
Expand All @@ -60,10 +60,10 @@ jobs:
# this environment does not match fonts...
run: bunx playwright test --update-snapshots

# output to github
# output to HTML
# use container
github_report:
name: 'Playwright Tests : running on playwright container and report to github'
name: 'Playwright Tests : running on playwright container and report to html'
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.40.1-jammy
Expand All @@ -79,7 +79,7 @@ jobs:
- name: Build
run: bun run build
- name: Run your tests
run: HOME=/root GITHUB_REPORT=1 bunx playwright test
run: HOME=/root bunx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down Expand Up @@ -109,3 +109,24 @@ jobs:
echo 'unzip playwright-report.zip' >> $GITHUB_STEP_SUMMARY
echo 'bunx vite preview --host 0.0.0.0 --outDir .' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
# output to github
# use container
github_report:
name: 'Playwright Tests : running on playwright container and report to github'
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.40.1-jammy
steps:
- uses: actions/checkout@v3
- name: install unzip
run: apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
- uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Install Playwright Browsers
run: bunx playwright install msedge && bunx playwright install chrome
- name: Build
run: bun run build
- name: Run your tests
run: HOME=/root GITHUB_REPORT=1 bunx playwright test
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const config: PlaywrightTestConfig = {
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
// 'github' for GitHub Actions CI to generate annotations, plus a concise 'dot'
// default 'list' when running locally
reporter: process.env.GITHUB_REPORT ? ['github', ['html', { host: '0.0.0.0' }]] : [['html', { host: '0.0.0.0' }]],
reporter: process.env.GITHUB_REPORT ? 'github' : [['html', { host: '0.0.0.0' }]],
// reporter: 'list',
// reporter: [['html', { host: '0.0.0.0' }]],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
Expand Down

0 comments on commit 73c5548

Please sign in to comment.