Files
thrillwiki_django_no_react/backend/tests/fixtures/README.md
pacnpal edcd8f2076 Add secret management guide, client-side performance monitoring, and search accessibility enhancements
- Introduced a comprehensive Secret Management Guide detailing best practices, secret classification, development setup, production management, rotation procedures, and emergency protocols.
- Implemented a client-side performance monitoring script to track various metrics including page load performance, paint metrics, layout shifts, and memory usage.
- Enhanced search accessibility with keyboard navigation support for search results, ensuring compliance with WCAG standards and improving user experience.
2025-12-23 16:41:42 -05:00

38 lines
1.3 KiB
Markdown

# Test Fixtures
This directory contains test data assets used by the test suite.
## Test Images
Test images for E2E upload tests are **generated automatically** by the `test_images` fixture in `backend/tests/e2e/conftest.py`. There is no need to manually add image files to this directory.
The `test_images` fixture creates temporary valid JPEG files at runtime and cleans them up after the test session completes.
### Usage in Tests
```python
def test_upload_photo(page: Page, test_images):
# Use the generated test photo
page.get_by_label("Photo").set_input_files(test_images["test_photo"])
# Use the generated test avatar
page.get_by_label("Avatar").set_input_files(test_images["test_avatar"])
```
### Available Keys
- `test_images["test_photo"]` - Path to a temporary test photo (valid JPEG)
- `test_images["test_avatar"]` - Path to a temporary test avatar (valid JPEG)
### How It Works
The fixture generates minimal valid JPEG images using raw bytes, which are accepted by any image processing library. This approach:
1. Eliminates the need for external fixture files
2. Ensures tests are self-contained and portable
3. Automatically cleans up temporary files after tests complete
## Other Fixtures
Additional test data fixtures (e.g., JSON data, CSV files) can be added to this directory as needed.