Run tests
Verify your code changes by running unit and functional tests for the Metadata Capture application.
In this guide
Understand the testing strategy
Run unit tests
Run functional tests
Understand the testing strategy
The Metadata Capture application uses the following testing approaches to ensure code quality and functionality:
- Unit tests: Fast, isolated tests for individual functions and components using pytest
- Functional tests: Browser-based tests that verify user workflows using Playwright
Run unit tests
Test individual functions, classes, and components.
-
Go to the backend directory and activate your virtual environment:
source venv/bin/activate -
Run all unit tests:
pytestThis command discovers and runs all tests in the
app/tests/directory.
Run functional tests
Verify complete user workflows using end-to-end (E2E) tests.
-
Start the required services for the testing environment:
docker compose -f docker-compose.e2e.yaml down -v
docker compose -f docker-compose.e2e.yaml build
docker compose -f docker-compose.e2e.yaml up -d -
Install test dependencies:
cd e2e/
npm install
npx playwright install -
Run the tests
npm run test