Merge pull request #32 from trails-cool/playwright-job-summary

This commit is contained in:
github-actions[bot] 2026-03-24 23:41:02 +00:00 committed by GitHub
commit a09f41e03d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 1 deletions

View file

@ -180,6 +180,35 @@ jobs:
env:
BROUTER_URL: http://localhost:17777
- name: Playwright job summary
if: ${{ !cancelled() }}
run: |
if [ -f playwright-results.json ]; then
node -e "
const r = require('./playwright-results.json');
const total = r.suites.reduce((n, s) => n + s.specs.length, 0);
const passed = r.suites.reduce((n, s) => n + s.specs.filter(t => t.ok).length, 0);
const failed = total - passed;
const dur = (r.stats.duration / 1000).toFixed(1);
let md = '## Playwright E2E Results\n\n';
md += '| Status | Count |\n|--------|-------|\n';
md += '| :white_check_mark: Passed | ${passed} |\n';
if (failed > 0) md += '| :x: Failed | ${failed} |\n';
md += '| Total | ${total} |\n';
md += '| Duration | ${dur}s |\n\n';
for (const suite of r.suites) {
md += '### ' + suite.title + '\n\n';
for (const spec of suite.specs) {
const icon = spec.ok ? ':white_check_mark:' : ':x:';
const time = spec.tests?.[0]?.results?.[0]?.duration;
md += '- ' + icon + ' ' + spec.title + (time ? ' (' + time + 'ms)' : '') + '\n';
}
md += '\n';
}
require('fs').appendFileSync(process.env.GITHUB_STEP_SUMMARY, md);
"
fi
- uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:

1
.gitignore vendored
View file

@ -11,3 +11,4 @@ dist/
e2e/results/
test-results/
playwright-report/
playwright-results.json

View file

@ -6,7 +6,9 @@ export default defineConfig({
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? [["github"], ["html", { open: "never" }]] : "list",
reporter: process.env.CI
? [["github"], ["html", { open: "never" }], ["json", { outputFile: "playwright-results.json" }]]
: "list",
use: {
baseURL: "http://localhost:3000",
trace: "on-first-retry",