feat(jenkins): enhance E2E testing and debugging capabilities

- Updated Jenkinsfile to include Playwright's trace option for better debugging on test failures.
- Added archiving of test results, including trace files, error context, and screenshots for failed tests.
- Enhanced error handling in `auth.setup.ts` to log diagnostic information when authentication fails, improving visibility into issues.

These changes aim to improve the reliability and debuggability of E2E tests.
This commit is contained in:
2026-05-21 17:53:40 -05:00
parent 9cc840da8b
commit ae321f5077
2 changed files with 24 additions and 2 deletions

10
Jenkinsfile vendored
View File

@@ -334,7 +334,9 @@ pipeline {
E2E_EXIT=0
PLAYWRIGHT_JUNIT_OUTPUT_NAME=playwright-results.xml \
pnpm exec playwright test --reporter=junit,html || E2E_EXIT=$?
pnpm exec playwright test \
--reporter=junit,html \
--trace=retain-on-failure || E2E_EXIT=$?
exit "$E2E_EXIT"
'
@@ -342,6 +344,9 @@ pipeline {
"$WORKSPACE/frontend/playwright-results.xml" 2>/dev/null || true
docker cp "$C:/workspace/frontend/playwright-report" \
"$WORKSPACE/frontend/playwright-report" 2>/dev/null || true
# test-results contiene trace.zip + error-context.md + screenshots por test fallido
docker cp "$C:/workspace/frontend/test-results" \
"$WORKSPACE/frontend/test-results" 2>/dev/null || true
'''
}
}
@@ -349,6 +354,9 @@ pipeline {
always {
junit allowEmptyResults: true, testResults: 'frontend/playwright-results.xml'
archiveArtifacts artifacts: 'frontend/playwright-report/**', allowEmptyArchive: true
// Artefactos de debug: trace.zip (abrir con `pnpm exec playwright show-trace`),
// error-context.md (snapshot del DOM al fallo) y screenshots por test fallido.
archiveArtifacts artifacts: 'frontend/test-results/**', allowEmptyArchive: true
}
}
}