| Metadata | Value |
|---|---|
| Status | Active |
| Version | 1.1.0 |
| Last Updated | 2026-09-10 |
| Author | Sangeetha Grantha Team |
| Document Type | Evidence record |
[!NOTE] Historical evidence: results, counts, commands, and observations below belong to the original work described here. The editorial update date is not a new test or corpus verification. For present behavior, use current quality checks.
Implemented comprehensive End-to-End (E2E) testing for the sangita-admin-web frontend module using Playwright. The test suite covers the Bulk Import workflow including authentication, batch processing, database verification, error handling, and review workflows.
| Status | Count | |——–|——-| | Passed | 22 | | Skipped | 18 | | Failed | 0 | | Total | 40 |
Skipped tests are expected - they gracefully handle cases where async batch processing hasn’t completed (no imported_krithis records yet).
| Component | File | Purpose |
|———–|——|———|
| Playwright Config | e2e/playwright.config.ts | Browser settings, timeouts, reporters |
| Global Setup | e2e/global-setup.ts | Backend health check, batch creation |
| Auth Setup | e2e/fixtures/auth.setup.ts | Login and persist auth state |
| Test Data | e2e/fixtures/test-data.ts | Constants, credentials, paths |
| Page | File | Key Methods |
|——|——|————-|
| Base | e2e/pages/base.page.ts | Navigation, dialog handling |
| Login | e2e/pages/login.page.ts | login(), credential input |
| Bulk Import | e2e/pages/bulk-import.page.ts | uploadCSV(), selectBatch(), getBatchStatus() |
| Import Review | e2e/pages/import-review.page.ts | getPendingCount(), approveImport() |
| Krithi List | e2e/pages/krithi-list.page.ts | searchKrithi(), getKrithiDetails() |
| Utility | File | Purpose |
|———|——|———|
| API Client | e2e/utils/api-client.ts | Direct HTTP calls to backend |
| DB Helpers | e2e/fixtures/db-helpers.ts | PostgreSQL queries for verification |
| Polling | e2e/utils/polling.ts | Async wait utilities |
| Log Verifier | e2e/utils/log-verifier.ts | Log file inspection |
| Spec | Tests | Coverage |
|——|——-|———-|
| bulk-import-happy-path.spec.ts | 11 | Upload, view batch, approve imports |
| bulk-import-database.spec.ts | 14 | Direct DB state verification |
| bulk-import-error-cases.spec.ts | 7 | Invalid CSVs, error handling |
| bulk-import-review.spec.ts | 10 | Review workflow, approval/rejection |
e2e/
├── fixtures/
│ ├── auth.setup.ts # Login and save auth state
│ ├── db-helpers.ts # Direct PostgreSQL queries
│ ├── shared-batch.ts # Shared batch fixture
│ └── test-data.ts # Test constants
├── pages/
│ ├── base.page.ts # Common page methods
│ ├── bulk-import.page.ts
│ ├── import-review.page.ts
│ ├── krithi-list.page.ts
│ └── login.page.ts
├── tests/
│ ├── bulk-import-database.spec.ts
│ ├── bulk-import-error-cases.spec.ts
│ ├── bulk-import-happy-path.spec.ts
│ └── bulk-import-review.spec.ts
├── utils/
│ ├── api-client.ts
│ ├── log-verifier.ts
│ └── polling.ts
├── global-setup.ts
└── playwright.config.ts
# 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
bun run test:e2e:report # View HTML report
mise exec -- cargo run --manifest-path tools/sangita-cli/Cargo.toml -- dev --start-dbbun run dev| Issue | Solution |
|---|---|
| Batch created per test | Moved to global-setup.ts with state file persistence |
| DB enum case mismatch | Updated to lowercase (pending, approved) |
| Audit log column names | Fixed created_at → changed_at, user_id → actor_user_id |
| Flaky batch visibility | Added refresh before waiting for batch in list |
e2e/playwright.config.tse2e/global-setup.tse2e/fixtures/*.ts (4 files)e2e/pages/*.ts (5 files)e2e/tests/*.spec.ts (4 files)e2e/utils/*.ts (3 files)modules/frontend/sangita-admin-web/package.json - Added test scriptsmodules/frontend/sangita-admin-web/.gitignore - Exclude test artifactsdatabase/for_import/bulk_import_test.csv