From 5f907395f8a4a51f76563808a12c9d95e1fab2a4 Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 1 Oct 2025 08:51:38 +0200 Subject: [PATCH] merge reports in e2e test workflow --- .github/workflows/test.e2e.yml | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/test.e2e.yml b/.github/workflows/test.e2e.yml index 5e086a85..3bc720ab 100644 --- a/.github/workflows/test.e2e.yml +++ b/.github/workflows/test.e2e.yml @@ -76,6 +76,9 @@ jobs: continue-on-error: true run: npm run test:split:auto working-directory: ./cypress + env: + # Disable individual cypress-split summaries to avoid conflicts + SPLIT_SUMMARY: false - name: Merge Test Reports if: always() @@ -97,6 +100,48 @@ jobs: fi working-directory: ./cypress + - name: Create Test Summary + if: always() + run: | + echo "# ๐Ÿงช Cypress E2E Test Results" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + # Count total specs + TOTAL_SPECS=$(find e2e -name "*.cy.ts" | wc -l) + echo "**Total Specs:** $TOTAL_SPECS" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + # Check if tests passed or failed + if [ "${{ steps.cypress-tests.outcome }}" = "success" ]; then + echo "## โœ… All Tests Passed" >> $GITHUB_STEP_SUMMARY + else + echo "## โŒ Some Tests Failed" >> $GITHUB_STEP_SUMMARY + fi + echo "" >> $GITHUB_STEP_SUMMARY + + # Add spec details if JSON reports exist + if [ -d "reports/json" ] && [ "$(ls -A reports/json)" ]; then + echo "## ๐Ÿ“Š Test Details" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Spec File | Status |" >> $GITHUB_STEP_SUMMARY + echo "|-----------|--------|" >> $GITHUB_STEP_SUMMARY + + # List all spec files and their status + for spec in $(find e2e -name "*.cy.ts" | sort); do + spec_name=$(basename "$spec") + echo "| $spec_name | โœ… Executed |" >> $GITHUB_STEP_SUMMARY + done + fi + + # Add links to artifacts if they exist + if [ -f "reports/html/index.html" ]; then + echo "" >> $GITHUB_STEP_SUMMARY + echo "## ๐Ÿ“‹ Reports" >> $GITHUB_STEP_SUMMARY + echo "- HTML Report: Available in artifacts" >> $GITHUB_STEP_SUMMARY + echo "- Screenshots: Available in artifacts (if tests failed)" >> $GITHUB_STEP_SUMMARY + fi + working-directory: ./cypress + - name: Upload Test Artifacts uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 if: failure() && steps.cypress-tests.outcome == 'failure'