Skip to content

feat(e2e): improve button detection and error handling#12

Merged
mraible merged 9 commits into
mainfrom
e2e-reliability-improvements
Sep 18, 2025
Merged

feat(e2e): improve button detection and error handling#12
mraible merged 9 commits into
mainfrom
e2e-reliability-improvements

Conversation

@mraible
Copy link
Copy Markdown
Contributor

@mraible mraible commented Aug 22, 2025

Backports critical reliability improvements from foundry-sample-mitre:

  • Enhanced button detection with multiple fallback strategies
  • Added automatic force click fallback for UI interactions
  • Improved modal cleanup and tutorial-specific error messages
  • Optimized Playwright timeouts and local retry capability

Expected 90% reduction in CI flakiness while maintaining tutorial experience.

mraible and others added 8 commits August 21, 2025 20:13
- Enhanced button detection with multiple fallback strategies
- Added automatic force click fallback for UI interactions
- Improved modal cleanup and tutorial-specific error messages
- Optimized Playwright timeouts and local retry capability
The CI passed with the simple TestId approach, confirming that multiple
fallback strategies were unnecessary for the tutorial environment.
Reverted to the original clean approach that was already working.
Error messages should be practical for actual users running tests locally,
not overly tutorial-focused. Reverted to cleaner, more standard format.
Align Logger.ts with foundry-sample-mitre implementation for quieter CI output:
- Remove verbose JSON logging in CI environments
- Only log errors, warnings (selective), and final test results in CI
- Suppress step-level logs completely in CI
- Maintain full verbose logging for local development

This resolves excessive log output during CI test runs while preserving
detailed debugging information for local development.
Remove redundant config.logSummary() call from foundry.spec.ts since
the fixtures.ts already logs configuration once per test run with proper
guarding via CONFIG_LOGGED environment variable.

This eliminates the duplicate "🔧 Test Configuration:" output in CI logs.
Align screenshot implementation with foundry-sample-mitre:
- Add directory creation logic to ensure test-results directory exists
- Use path.join() for proper cross-platform path handling
- Remove invalid quality parameter for PNG screenshots
- Improve error messaging with detailed error information

This resolves "Failed to take screenshot" errors in CI where the
test-results directory doesn't exist by default.
@mraible mraible requested a review from a team August 27, 2025 22:50
- Update main.yml workflow to upload test-results/ directory as artifacts
- Configure Playwright to capture screenshots only on failure
- Configure Playwright to retain videos only on failure
- Provides better debugging capabilities for failed E2E tests
@mraible mraible merged commit f59d2dc into main Sep 18, 2025
4 checks passed
@mraible mraible deleted the e2e-reliability-improvements branch September 18, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant