diff --git a/cypress/package.json b/cypress/package.json index 0c4602e9..710e5a0d 100644 --- a/cypress/package.json +++ b/cypress/package.json @@ -9,8 +9,7 @@ "test:split:auto": "SPEC_COUNT=$(find e2e -name '*.cy.ts' | wc -l) && echo \"Running $SPEC_COUNT chunks in parallel\" && for i in $(seq 0 $((SPEC_COUNT-1))); do SPLIT=$SPEC_COUNT SPLIT_INDEX=$i cypress run --e2e --browser chromium & done; wait", "report:merge": "mochawesome-merge 'results/*.json' -o results/merged-report.json", "report:generate": "marge results/merged-report.json --reportDir results/html --reportTitle 'Utopia Map E2E Tests' --reportPageTitle 'Utopia Map E2E Test Report' --inline --charts --showPassed --showFailed --showPending --showSkipped", - "report:copy-screenshots": "if [ -d screenshots ]; then cp -r screenshots results/html/ 2>/dev/null || true; fi", - "report:full": "npm run report:merge && npm run report:generate && npm run report:copy-screenshots", + "report:full": "npm run report:merge && npm run report:generate", "lint": "eslint .", "lint:fix": "eslint . --fix" }, diff --git a/cypress/scripts/generate-html-report.sh b/cypress/scripts/generate-html-report.sh index f924a758..d178a355 100755 --- a/cypress/scripts/generate-html-report.sh +++ b/cypress/scripts/generate-html-report.sh @@ -19,7 +19,21 @@ fi echo "✅ Consolidated HTML report generated successfully" echo "Report size: $(wc -c < results/html/merged-report.html) bytes" -npm run report:copy-screenshots +# Copy screenshots with proper structure for the HTML report +echo "Copying screenshots to HTML report directory..." +if [ -d "screenshots" ]; then + # Create screenshots directory in the HTML output + mkdir -p "results/html/screenshots" + + # Copy all screenshots maintaining directory structure + cp -r screenshots/* results/html/screenshots/ 2>/dev/null || true + + echo "✅ Screenshots copied successfully" + echo "Screenshot structure:" + find results/html/screenshots -type f -name "*.png" | head -5 +else + echo "⚠️ No screenshots directory found" +fi echo "=== Final consolidated report ready ===" ls -la results/html/