Skip to content

Conversation

@michaelstingl
Copy link
Owner

@michaelstingl michaelstingl commented Mar 19, 2025

Summary

  • Add full Maestro E2E testing infrastructure for consistent UI and integration testing
  • Implement secure credential management and secrets detection
  • Add comprehensive documentation and test examples
  • Add token-based OIDC authentication approach for automated test flows

Features

  • Structured Test Files: Organized test files with numerical prefixes for clarity
  • Screenshot Management: Automated screenshot capture for documentation and UI verification
  • Secure Credentials: Setup for secure storage of test credentials without committing them to Git
  • Pre-commit Hooks: Prevent accidental leakage of secrets or credentials
  • System Dialog Handling: Tests that handle iOS system permission dialogs with manual intervention
  • Token-based Authentication: Bypass WebView authentication using oidc-agent for more reliable tests
  • Comprehensive Docs: Full documentation in the docs/ directory

Token-based Authentication Approach

The new token-based approach:

  • Uses oidc-agent to generate and manage OIDC tokens outside the testing flow
  • Injects tokens directly into the app, bypassing WebView authentication completely
  • Eliminates the need for manual intervention with system dialogs
  • Removes the need to store passwords in configuration files
  • Makes tests more reliable, faster, and more secure

Test Plan

  1. Run basic test: npm run test:e2e:login
  2. Run theme test: npm run test:e2e:theme
  3. Run screenshot capture: npm run test:e2e:screenshots
  4. Test with system dialog: npm run test:e2e:login:confirmation
  5. Test with token injection: npm run test:e2e:oidc:token (requires oidc-agent setup)
  6. Verify the pre-commit hook by attempting to commit a file with fake credentials

🤖 Generated with Claude Code

- Add structured Maestro E2E test files with numerical prefixes
- Set up secure credential management for tests
- Implement pre-commit hooks to prevent secrets leakage
- Add comprehensive documentation for E2E testing
- Configure screenshots organization in dedicated folders
- Add npm scripts for running specific test scenarios
- Add support for tests with manual system dialog confirmation
@github-actions
Copy link

Coverage after merging feature/e2e-tests into main will be

63.03%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
config
   app.config.ts70%50%100%100%101, 133, 133–134, 134, 85–86, 97, 99
services
   AuthService.ts44.02%36.67%57.14%46.48%109–115, 126–127, 190, 208, 219, 227, 229–231, 234–238, 241, 241, 241, 241, 241, 241–242, 246–247, 254, 254, 254–256, 259, 261, 267, 270, 273, 276, 283, 286, 289, 292, 295, 295, 295–297, 301–303, 306, 309, 309, 309–310, 312–313, 313, 313, 316, 316, 316, 318, 318, 318–322, 322, 322–325, 325, 325–328, 331, 336, 336, 336, 338–339, 341, 341, 341, 341, 341, 343, 343, 343–344, 348, 350, 350, 350, 350, 350, 352–353, 357–358, 362–363, 57–60, 71
   OidcService.ts48.21%36.59%60%54.55%130–133, 138, 138, 15, 155–156, 176, 176, 176–177, 181, 181, 181–183, 186, 186, 186–188, 190, 190–191, 191, 195, 200, 200, 200–201, 205, 205, 205–206, 209, 211, 211, 211, 213–214, 214, 220, 24–25, 34–35, 53–54, 57, 66, 84–87
   WebFingerService.ts89.33%76.92%80%97.73%104–105, 14, 24, 31, 38, 59
services/api
   ApiService.ts75.58%63.64%70%81.48%100, 133, 137, 172, 174, 200, 200, 200–202, 204, 204, 209, 212–213, 227, 86, 93
   HttpUtil.ts59.24%50.54%84.62%62.88%102–103, 103, 103, 106, 106, 106–107, 110, 114, 114, 114–117, 155, 165, 18, 193, 198, 198–199, 203, 222, 305, 31, 312, 34–35, 354, 354, 354–355, 355, 355, 357, 357, 357–359, 36, 362, 362, 362–363, 365, 365, 365–367, 369, 369, 369–370, 373, 39, 396, 410, 42–43, 435–438, 446, 450, 473–475, 51, 59, 59, 59–60, 60, 60–62, 62, 62–63, 63, 63, 65–67, 69, 71, 75, 79, 82, 85, 92, 96, 96

This commit adds a token-based approach for E2E testing with OIDC authentication:

- New test flow that injects OIDC tokens directly into the app
- Helper script that retrieves tokens from oidc-agent
- Detailed documentation for setup and usage
- Updated env.example.json to support token-based configuration
- NPM script for easily running token-based tests

This approach improves E2E testing by:
- Bypassing WebView-based authentication completely
- Eliminating the need for manual interaction with system dialogs
- Removing the need to store passwords in configuration files
- Making tests more reliable and faster

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link

Coverage after merging feature/e2e-tests into main will be

63.03%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
config
   app.config.ts70%50%100%100%101, 133, 133–134, 134, 85–86, 97, 99
services
   AuthService.ts44.02%36.67%57.14%46.48%109–115, 126–127, 190, 208, 219, 227, 229–231, 234–238, 241, 241, 241, 241, 241, 241–242, 246–247, 254, 254, 254–256, 259, 261, 267, 270, 273, 276, 283, 286, 289, 292, 295, 295, 295–297, 301–303, 306, 309, 309, 309–310, 312–313, 313, 313, 316, 316, 316, 318, 318, 318–322, 322, 322–325, 325, 325–328, 331, 336, 336, 336, 338–339, 341, 341, 341, 341, 341, 343, 343, 343–344, 348, 350, 350, 350, 350, 350, 352–353, 357–358, 362–363, 57–60, 71
   OidcService.ts48.21%36.59%60%54.55%130–133, 138, 138, 15, 155–156, 176, 176, 176–177, 181, 181, 181–183, 186, 186, 186–188, 190, 190–191, 191, 195, 200, 200, 200–201, 205, 205, 205–206, 209, 211, 211, 211, 213–214, 214, 220, 24–25, 34–35, 53–54, 57, 66, 84–87
   WebFingerService.ts89.33%76.92%80%97.73%104–105, 14, 24, 31, 38, 59
services/api
   ApiService.ts75.58%63.64%70%81.48%100, 133, 137, 172, 174, 200, 200, 200–202, 204, 204, 209, 212–213, 227, 86, 93
   HttpUtil.ts59.24%50.54%84.62%62.88%102–103, 103, 103, 106, 106, 106–107, 110, 114, 114, 114–117, 155, 165, 18, 193, 198, 198–199, 203, 222, 305, 31, 312, 34–35, 354, 354, 354–355, 355, 355, 357, 357, 357–359, 36, 362, 362, 362–363, 365, 365, 365–367, 369, 369, 369–370, 373, 39, 396, 410, 42–43, 435–438, 446, 450, 473–475, 51, 59, 59, 59–60, 60, 60–62, 62, 62–63, 63, 63, 65–67, 69, 71, 75, 79, 82, 85, 92, 96, 96

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.

2 participants