Skip to content

Commit

Permalink
Merge pull request #9363 from weseek/support/improve-playwright-workflow
Browse files Browse the repository at this point in the history
support: Improve playwright report
  • Loading branch information
mergify[bot] authored Nov 6, 2024
2 parents fabb4d2 + e9917e0 commit 4804a47
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/reusable-app-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ jobs:
run: |
pnpm playwright test --project=chromium/installer
env:
DEBUG: pw:api
HOME: /root # ref: https://github.com/microsoft/playwright/issues/6500
MONGO_URI: mongodb://mongodb:27017/growi-playwright-installer
ELASTICSEARCH_URI: http://localhost:${{ job.services.elasticsearch.ports['9200'] }}/growi
Expand All @@ -239,6 +240,7 @@ jobs:
run: |
pnpm playwright test --project=${{ matrix.browser }} --shard=${{ matrix.shard }}
env:
DEBUG: pw:api
HOME: /root # ref: https://github.com/microsoft/playwright/issues/6500
MONGO_URI: mongodb://mongodb:27017/growi-playwright
ELASTICSEARCH_URI: http://localhost:${{ job.services.elasticsearch.ports['9200'] }}/growi
Expand All @@ -253,10 +255,39 @@ jobs:
run: |
pnpm playwright test --project=${{ matrix.browser }}/guest-mode --shard=${{ matrix.shard }}
env:
DEBUG: pw:api
HOME: /root # ref: https://github.com/microsoft/playwright/issues/6500
MONGO_URI: mongodb://mongodb:27017/growi-playwright-guest-mode
ELASTICSEARCH_URI: http://localhost:${{ job.services.elasticsearch.ports['9200'] }}/growi

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shard }}
path: blob-report
retention-days: 30

- name: Download blob reports from all shards
if: always()
uses: actions/download-artifact@v4
with:
pattern: blob-report-*
path: all-blob-reports
merge-multiple: true

- name: Merge into HTML Report
if: always()
run: pnpm playwright merge-reports --reporter html ./all-blob-reports

- name: Upload HTML report
if: always()
uses: actions/upload-artifact@v4
with:
name: html-report
path: playwright-report
retention-days: 30

- name: Slack Notification
uses: weseek/ghaction-slack-notification@master
if: failure()
Expand Down
7 changes: 6 additions & 1 deletion apps/app/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ export default defineConfig({
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: process.env.CI ? 'github' : 'list',
reporter: process.env.CI
? [
['github'],
['blob'],
]
: 'list',

webServer: {
command: 'pnpm run server',
Expand Down

0 comments on commit 4804a47

Please sign in to comment.