Skip to content

Add comprehensive end-to-end testing infrastructure with Playwright #749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 61 commits into from
Jul 30, 2025

Conversation

tjementum
Copy link
Member

@tjementum tjementum commented May 28, 2025

Summary & Motivation

This change establishes a comprehensive end-to-end testing infrastructure using Playwright, providing a robust foundation for testing user workflows across all self-contained systems. The implementation includes authentication fixtures, test utilities, and organized test suites that ensure application functionality works correctly from a user's perspective.

Key features:

  • Shared Playwright configuration and utilities in shared-webapp for consistency across systems
  • Worker-scoped authentication fixtures enabling parallel test execution with isolated tenants
  • Reusable test utilities including step decorators, assertions, and test data generators
  • Organized test flows covering authentication, user management, permissions, themes, localization, and mobile views
  • Performance optimizations including toast auto-closing and improved error handling
  • IDE integration for VS Code with debugging support
  • Separation of smoke tests (@smoke), comprehensive tests (@comprehensive), and slow tests (@slow)

The infrastructure supports multiple browsers (Chromium, Firefox, WebKit) and provides detailed test reporting with screenshots and traces on failures. Tests are organized by functional areas and use descriptive step names for maintainability.

Downstream projects

  1. Copy the Playwright test configuration files from Back Office to your self-contained system:

    • Copy application/back-office/WebApp/tests/playwright.config.ts to your-self-contained-system/WebApp/tests/playwright.config.ts
    • Copy application/back-office/WebApp/tests/tsconfig.json to your-self-contained-system/WebApp/tests/tsconfig.json
  2. Update your-self-contained-system/WebApp/rsbuild.config.ts to exclude test files from the build:

  server: {
    port: Number.parseInt(process.env.PORT || "9003"),
+   publicDir: {
+     name: "public",
+     copyOnBuild: true
+   }
  },
+ source: {
+   exclude: ["**/tests/**/*"]
+ }
  1. Update your-self-contained-system/WebApp/tsconfig.json to exclude test files:
  "compilerOptions": {
    // ... existing options
  },
- "exclude": ["node_modules", "dist"]
+ "exclude": ["node_modules", "dist", "tests"]
  1. Create your first end-to-end test in your-self-contained-system/WebApp/tests/e2e/homepage.spec.ts following the pattern from Back Office.

Checklist

  • I have added tests, or done manual regression tests
  • I have updated the documentation, if necessary

@tjementum tjementum self-assigned this May 28, 2025
@tjementum tjementum added the Enhancement New feature or request label May 28, 2025
@tjementum tjementum force-pushed the e2e-playwright branch 6 times, most recently from c429074 to e6b052a Compare June 2, 2025 13:13
@tjementum tjementum force-pushed the e2e-playwright branch 8 times, most recently from 5152c8e to db7437b Compare June 10, 2025 19:18
@tjementum tjementum force-pushed the e2e-playwright branch 3 times, most recently from 2e29107 to c0aa48f Compare June 20, 2025 09:07
@tjementum tjementum force-pushed the e2e-playwright branch 2 times, most recently from 9d665eb to f45071b Compare June 27, 2025 14:43
@tjementum tjementum force-pushed the e2e-playwright branch 2 times, most recently from 3cb66b9 to 858b4b6 Compare July 16, 2025 09:46
@tjementum tjementum force-pushed the e2e-playwright branch 2 times, most recently from 2d8b954 to 6394852 Compare July 24, 2025 10:53
@tjementum tjementum added the Deploy to Staging Set this label on pull requests to deploy code or infrastructure to the Staging environment label Jul 24, 2025
@tjementum tjementum changed the title Add end-to-end testing with Playwright and TypeScript and developer CLI command Add comprehensive end-to-end testing infrastructure with Playwright Jul 29, 2025
@tjementum tjementum marked this pull request as ready for review July 29, 2025 23:18
@tjementum tjementum requested a review from a team as a code owner July 29, 2025 23:18
Copy link

@tjementum tjementum merged commit 3f48954 into main Jul 30, 2025
26 checks passed
@tjementum tjementum deleted the e2e-playwright branch July 30, 2025 08:08
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in Kanban board Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deploy to Staging Set this label on pull requests to deploy code or infrastructure to the Staging environment Enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant