diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index d190efae..a1ba2673 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -217,13 +217,85 @@ jobs: path: flowchart.png #--------------------------------------------------- - # 11 – Sticky PR comment + # 11 – Checklist generation + #--------------------------------------------------- + - name: Build dynamic checklist + id: checklist + shell: bash + run: | + CHECKLIST="" + WARNING=false + + # GitHub Action triggered + CHECKLIST="${CHECKLIST}- [x] GitHub Action triggered\n" + + # Playwright tests completed successfully + if [[ "${{ steps.summary.outputs.total }}" != "" ]]; then + CHECKLIST="${CHECKLIST}- [x] Playwright tests completed successfully\n" + else + CHECKLIST="${CHECKLIST}- [ ] Playwright tests completed successfully\n" + WARNING=true + fi + + # ESLint executed without issues + if [[ -f eslint-tests.json ]]; then + CHECKLIST="${CHECKLIST}- [x] ESLint executed without issues\n" + else + CHECKLIST="${CHECKLIST}- [ ] ESLint executed without issues\n" + WARNING=true + fi + + # Prettier check completed + if [[ -f prettier.patch ]]; then + CHECKLIST="${CHECKLIST}- [x] Prettier check completed\n" + else + CHECKLIST="${CHECKLIST}- [ ] Prettier check completed\n" + WARNING=true + fi + + # Test summary generated + if [[ "${{ steps.summary.outputs.total }}" != "" ]]; then + CHECKLIST="${CHECKLIST}- [x] Test summary generated\n" + else + CHECKLIST="${CHECKLIST}- [ ] Test summary generated\n" + WARNING=true + fi + + # Flowchart created + if [[ -f flowchart.png ]]; then + CHECKLIST="${CHECKLIST}- [x] Flowchart created\n" + else + CHECKLIST="${CHECKLIST}- [ ] Flowchart created\n" + WARNING=true + fi + + echo -e "value<> $GITHUB_OUTPUT + echo -e "$CHECKLIST" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + if [[ "$WARNING" == "true" ]]; then + echo "status=warning" >> $GITHUB_OUTPUT + else + echo "status=success" >> $GITHUB_OUTPUT + fi + + + + #--------------------------------------------------- + # 12 – Sticky PR comment #--------------------------------------------------- - name: Comment on PR with results uses: marocchino/sticky-pull-request-comment@v2 with: message: | - ## Playwright Test Metrics + ### Test Checklist + ${{ steps.checklist.outputs.value }} + + Checklist Status: ${{ steps.checklist.outputs.status }} + + --- + + ### Playwright Test Metrics *Total:* **${{ steps.summary.outputs.total }}** *Passed:* **${{ steps.summary.outputs.passed }}** *Failed:* **${{ steps.summary.outputs.failed }}** @@ -232,8 +304,9 @@ jobs: *Duration:* **${{ steps.summary.outputs.duration }} ms** *Pass Rate:* **${{ steps.summary.outputs.passrate }} %** - - ## ESLint Test Metrics + --- + + ### ESLint Test Metrics *Files Checked:* **${{ steps.eslint_summary.outputs.total_files }}** *Errors:* **${{ steps.eslint_summary.outputs.errors }}** *Warnings:* **${{ steps.eslint_summary.outputs.warnings }}** @@ -243,7 +316,9 @@ jobs: ${{ steps.lint_summary.outputs.summary }} ``` - ## Test-Flow Chart + --- + + ### Test-Flow Chart Artifact: **test-flow-chart → flowchart.png** _Full run details:_ [link](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) \ No newline at end of file diff --git a/playwright.config.js b/playwright.config.js index 3cb86394..fd6b1b23 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -10,7 +10,7 @@ module.exports = defineConfig({ ignoreHTTPSErrors: true, }, reporter: [ - ['json', { outputFile: 'metrics.json' }], + ['json', { outputFile: 'playwright-metrics.json' }], ['html', { outputFile: 'report.html', open: 'never' }], ], }); \ No newline at end of file