mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 17:31:09 -05:00
- Add complete backend/ directory with full Django application - Add frontend/ directory with Vite + TypeScript setup ready for Next.js - Add comprehensive shared/ directory with: - Complete documentation and memory-bank archives - Media files and avatars (letters, park/ride images) - Deployment scripts and automation tools - Shared types and utilities - Add architecture/ directory with migration guides - Configure pnpm workspace for monorepo development - Update .gitignore to exclude .django_tailwind_cli/ build artifacts - Preserve all historical documentation in shared/docs/memory-bank/ - Set up proper structure for full-stack development with shared resources
ThrillWiki E2E Tests
This directory contains end-to-end tests for ThrillWiki using Playwright and pytest.
Setup
- Install dependencies:
uv pip install -r requirements.txt
- Install Playwright browsers:
playwright install
- Create test fixtures:
mkdir -p tests/fixtures
- Add test assets:
Place the following files in
tests/fixtures/:
test_photo.jpg- A sample photo for testing uploadstest_avatar.jpg- A sample avatar image for profile tests
Running Tests
Run all tests:
pytest tests/e2e/
Run specific test files:
pytest tests/e2e/test_auth.py
pytest tests/e2e/test_parks.py
pytest tests/e2e/test_rides.py
pytest tests/e2e/test_reviews.py
pytest tests/e2e/test_profiles.py
Run tests by marker:
pytest -m auth
pytest -m parks
pytest -m rides
pytest -m reviews
pytest -m profiles
Run tests with different browsers:
pytest --browser chromium
pytest --browser firefox
pytest --browser webkit
Run tests headlessly:
pytest --headless
Test Structure
test_auth.py- Authentication tests (login, signup, logout)test_parks.py- Theme park tests (listing, details, reviews, photos)test_rides.py- Ride tests (listing, details, reviews, photos)test_reviews.py- Review tests (creation, editing, moderation)test_profiles.py- User profile tests (settings, preferences)
Test Data
The tests expect the following test users to exist in the database:
-
Regular User:
- Username: testuser
- Password: testpass123
-
Moderator:
- Username: moderator
- Password: modpass123
You can create these users using Django management commands:
python manage.py create_test_users
Test Environment
Tests expect:
- Django development server running on http://localhost:8000
- Database with test data loaded
- Media handling configured for test uploads
Debugging
- Use
--headedflag to see browser during test execution - Use
--slowmo 1000to slow down test execution - Use
--debugfor detailed logging - Screenshots are saved in
test-results/on failure
Common Issues
- Connection Refused: Ensure Django server is running
- Element Not Found: Check selectors and page load timing
- Upload Failures: Verify test fixtures exist
- Authentication Errors: Verify test users exist in database
Contributing
- Add new tests in appropriate test files
- Follow existing test patterns
- Include comments explaining test scenarios
- Update README for new test categories
- Add new fixtures as needed