| Metadata | Value |
|---|---|
| Status | Folded into TRACK-113 |
| Version | 1.2.0 |
| Last Updated | 2026-07-09 |
| Author | Antigravity |
Implement comprehensive end-to-end tests for the Admin Dashboard using Playwright. Focus on the Bulk Import workflow as the primary test scenario, including authentication, batch creation, review workflow, and database verification.
e2e/playwright.config.ts)e2e/global-setup.ts)e2e/fixtures/auth.setup.ts)e2e/fixtures/test-data.ts)e2e/pages/base.page.ts)e2e/pages/login.page.ts)e2e/pages/bulk-import.page.ts)e2e/pages/import-review.page.ts)e2e/pages/krithi-list.page.ts)e2e/utils/api-client.ts)e2e/fixtures/db-helpers.ts)e2e/utils/polling.ts)e2e/utils/log-verifier.ts)e2e/fixtures/shared-batch.ts)e2e/tests/bulk-import-happy-path.spec.ts) - 11 testse2e/tests/bulk-import-database.spec.ts) - 14 testse2e/tests/bulk-import-error-cases.spec.ts) - 7 testse2e/tests/bulk-import-review.spec.ts) - 10 tests| Status | Count | |——–|——-| | Passed | 22 | | Skipped | 18 | | Failed | 0 | | Total | 40 |
| Category | Passed | Skipped | Notes |
|---|---|---|---|
| Database State Verification | 7 | 7 | Skipped tests require entity resolution completion |
| Error Cases | 7 | 0 | All error handling tests pass |
| Happy Path | 7 | 4 | Skipped tests require pending imports |
| Review Workflow | 3 | 7 | Skipped tests require pending imports |
The skipped tests are not failures - they gracefully handle async batch processing:
imported_krithis records exist until scraping finishesSUCCEEDED statuse2e/
├── fixtures/
│ ├── auth.setup.ts # Login and save auth state
│ ├── db-helpers.ts # Direct PostgreSQL queries
│ ├── shared-batch.ts # Shared batch fixture for all tests
│ └── test-data.ts # Test constants and config
├── pages/
│ ├── base.page.ts # Common page methods
│ ├── bulk-import.page.ts # Bulk import page interactions
│ ├── import-review.page.ts
│ ├── krithi-list.page.ts
│ └── login.page.ts
├── tests/
│ ├── bulk-import-database.spec.ts # DB state verification
│ ├── bulk-import-error-cases.spec.ts
│ ├── bulk-import-happy-path.spec.ts
│ └── bulk-import-review.spec.ts
├── utils/
│ ├── api-client.ts # HTTP client for API calls
│ ├── log-verifier.ts # Log file inspection
│ └── polling.ts # Async polling utilities
├── global-setup.ts # Pre-test setup (health check, batch creation)
└── playwright.config.ts # Playwright configuration
# From modules/frontend/sangita-admin-web
bun run test:e2e # Run all E2E tests
bun run test:e2e:ui # Run with Playwright UI
bun run test:e2e:debug # Debug mode
mise exec -- cargo run --manifest-path tools/sangita-cli/Cargo.toml -- dev --start-dbbun run devTo start fresh (removes cached batch state):
rm -f e2e/.batch-state.json
bun run test:e2e
| Issue | Fix |
|---|---|
| Batch created per test instead of once | Moved batch creation to global-setup.ts with state file |
DB enum case mismatch (PENDING vs pending) |
Updated db-helpers.ts to use lowercase enum values |
| Audit log column names wrong | Fixed created_at → changed_at, user_id → actor_user_id |
| Flaky batch visibility test | Added refresh before waiting for batch in list |
modules/frontend/sangita-admin-web/e2e/**/* - Test framework and specsmodules/frontend/sangita-admin-web/package.json - Test scriptsmodules/frontend/sangita-admin-web/bun.lock - Dependencies