fix: improve screenshot handling in e2e test reports

- Add debugging output to trace screenshot copying process in CI
- Clean up unwanted 'before-intentional-failure' screenshots
- Fix artifact upload path formatting in workflow
This commit is contained in:
mahula 2025-10-06 20:05:34 +02:00
parent a9c36b9dee
commit c69507fecf
2 changed files with 21 additions and 4 deletions

View File

@ -194,8 +194,7 @@ jobs:
uses: actions/upload-artifact@2848b2cda0e5190984587ec6bb1f36730ca78d50 # v4.6.2
with:
name: e2e-test-report-${{ github.run_id }}
path: |
cypress/results/html/
path: cypress/results/html/
retention-days: 14
if-no-files-found: warn

View File

@ -21,7 +21,20 @@ echo "Report size: $(wc -c < results/html/merged-report.html) bytes"
# Copy screenshots with proper structure for the HTML report
echo "Copying screenshots to HTML report directory..."
echo "DEBUG: Current working directory: $(pwd)"
echo "DEBUG: Available directories:"
ls -la
if [ -d "screenshots" ]; then
echo "DEBUG: Screenshots directory found"
echo "DEBUG: Screenshots directory structure:"
find screenshots -type f -name "*.png" | head -10
# Remove unwanted screenshots (like before-intentional-failure)
echo "Cleaning up unwanted screenshots..."
find screenshots -name "*before-intentional-failure*" -type f -delete 2>/dev/null || true
find screenshots -name "*before-*" -type f -delete 2>/dev/null || true
# Create screenshots directory in the HTML output
mkdir -p "results/html/screenshots"
@ -29,10 +42,15 @@ if [ -d "screenshots" ]; then
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
echo "DEBUG: Final screenshot structure in HTML output:"
find results/html/screenshots -type f -name "*.png" | head -10
echo "DEBUG: Full results/html structure:"
find results/html -type f | head -20
else
echo "⚠️ No screenshots directory found"
echo "DEBUG: Available files and directories:"
find . -maxdepth 2 -type d
fi
echo "=== Final consolidated report ready ==="