docs: update testing guide and sidebar documentation

- Add Testing Hub (Admin Dashboard) section to testing guide
  - Document features: collection, running tests, statistics
  - Document API endpoints and background execution
- Update sidebar documentation for new structure:
  - Add Product Catalog section
  - Add Platform Health section (Testing Hub, Code Quality, Background Tasks)
  - Update Settings to collapsible section
  - Update page-to-section mappings

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-12 23:56:24 +01:00
parent c60243ceff
commit 837b1f93f4
2 changed files with 103 additions and 12 deletions

View File

@@ -14,6 +14,7 @@ The Wizamart platform employs a comprehensive testing strategy with four distinc
- [Mocking](#mocking)
- [Best Practices](#best-practices)
- [Troubleshooting](#troubleshooting)
- [Testing Hub (Admin Dashboard)](#testing-hub-admin-dashboard)
---
@@ -1266,6 +1267,71 @@ If you encounter issues:
---
## Testing Hub (Admin Dashboard)
The platform includes a web-based Testing Hub accessible at `/admin/testing` that provides a visual interface for running tests and monitoring test health.
### Accessing the Testing Hub
Navigate to **Platform Health → Testing Hub** in the admin sidebar, or go directly to `/admin/testing`.
### Features
#### 1. Test Collection
Click **Collect Tests** to discover all available tests in the codebase without running them. This displays:
- **Total Tests**: Number of test functions discovered
- **Unit Tests**: Tests in `tests/unit/`
- **Integration Tests**: Tests in `tests/integration/`
- **Performance Tests**: Tests in `tests/performance/`
- **Test Files**: Number of test files
#### 2. Running Tests
Click **Run Tests** to execute the test suite. Tests run in the background, so you can:
- Leave the page and return later
- Monitor elapsed time in real-time
- See results when tests complete
#### 3. Dashboard Statistics
The dashboard shows results from the last test run:
- **Pass Rate**: Percentage of tests passing
- **Passed/Failed/Errors**: Test outcome counts
- **Duration**: How long the test run took
- **Skipped**: Tests marked to skip
#### 4. Trend Analysis
View pass rate trends across the last 10 test runs to identify regressions.
#### 5. Tests by Category
See breakdown of passed/failed tests by category (Unit, Integration, etc.).
#### 6. Top Failing Tests
Quickly identify tests that fail most frequently across runs.
### API Endpoints
The Testing Hub uses these API endpoints:
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/v1/admin/tests/stats` | GET | Dashboard statistics |
| `/api/v1/admin/tests/run` | POST | Start a test run |
| `/api/v1/admin/tests/runs` | GET | List recent test runs |
| `/api/v1/admin/tests/runs/{id}` | GET | Get specific run details |
| `/api/v1/admin/tests/collect` | POST | Collect test information |
### Background Execution
Test runs execute as background tasks, allowing:
- Non-blocking UI during long test runs
- Ability to navigate away and return
- Automatic status polling every 2 seconds
View all background tasks including test runs at **Platform Health → Background Tasks**.
---
## Summary
This testing guide covers:
@@ -1277,5 +1343,6 @@ This testing guide covers:
- ✅ Mocking patterns and best practices
- ✅ Best practices for maintainable tests
- ✅ Troubleshooting common issues
- ✅ Testing Hub admin dashboard
For information about maintaining and extending the test suite, see [Test Maintenance Guide](test-maintenance.md).