Files
thrillwiki_django_no_react/backend/tests/e2e
pacnpal d504d41de2 feat: complete monorepo structure with frontend and shared resources
- 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
2025-08-23 18:40:07 -04:00
..

ThrillWiki E2E Tests

This directory contains end-to-end tests for ThrillWiki using Playwright and pytest.

Setup

  1. Install dependencies:
uv pip install -r requirements.txt
  1. Install Playwright browsers:
playwright install
  1. Create test fixtures:
mkdir -p tests/fixtures
  1. Add test assets: Place the following files in tests/fixtures/:
  • test_photo.jpg - A sample photo for testing uploads
  • test_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:

  1. Regular User:

    • Username: testuser
    • Password: testpass123
  2. Moderator:

    • Username: moderator
    • Password: modpass123

You can create these users using Django management commands:

python manage.py create_test_users

Test Environment

Tests expect:

  1. Django development server running on http://localhost:8000
  2. Database with test data loaded
  3. Media handling configured for test uploads

Debugging

  1. Use --headed flag to see browser during test execution
  2. Use --slowmo 1000 to slow down test execution
  3. Use --debug for detailed logging
  4. Screenshots are saved in test-results/ on failure

Common Issues

  1. Connection Refused: Ensure Django server is running
  2. Element Not Found: Check selectors and page load timing
  3. Upload Failures: Verify test fixtures exist
  4. Authentication Errors: Verify test users exist in database

Contributing

  1. Add new tests in appropriate test files
  2. Follow existing test patterns
  3. Include comments explaining test scenarios
  4. Update README for new test categories
  5. Add new fixtures as needed