This directory contains Playwright end-to-end tests for the Tailspin Shelter website.
homepage.spec.ts- Tests for the main homepage functionalityabout.spec.ts- Tests for the about pagedog-details.spec.ts- Tests for individual dog detail pagesapi-integration.spec.ts- Tests for API integration and error handling
Make sure you have installed dependencies:
npm installYou also need Python 3 with Flask dependencies installed:
pip install -r ../server/requirements.txt# Run all tests
npm run test:e2e
# Run tests with UI mode (for debugging)
npm run test:e2e:ui
# Run tests in headed mode (see browser)
npm run test:e2e:headed
# Debug tests
npm run test:e2e:debugTests run against the real Flask server with a separate test database seeded with deterministic data. When Playwright starts, it:
- Seeds a test database (
e2e_test_dogshelter.dbin the server directory) with known dogs and breeds - Starts the Flask server using the test database
- Starts the Astro dev server pointing at the Flask server
- Runs all e2e tests against the live application
The test data is defined in ../server/utils/seed_test_database.py.
The tests cover the following core functionality:
- Page loads with correct title and content
- Dog list displays properly
- About page content displays correctly
- Navigation back to homepage works
- Navigation from homepage to dog details
- Full dog details display correctly
- Navigation back from dog details to homepage
- Handling of invalid dog IDs
- Dogs render correctly on the homepage
- Dog details render correctly
- 404 handling for non-existent dogs
- Navigation from card to detail page
Tests are configured in ../playwright.config.ts and automatically start the Flask and Astro servers before running tests.
The tests run against:
- Client (Astro): http://localhost:4321
- Server (Flask): http://localhost:5100