Initial commit: Canteen Asset Geolocation Tool v2

This commit is contained in:
2026-05-17 18:55:28 -04:00
commit 7da3f28c6a
50 changed files with 19509 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
# Frontend E2E Tests
Playwright tests for the Canteen Asset Tracker SPA.
## Requirements
- System Chromium installed (`/usr/bin/chromium-browser`)
- Playwright Python: `pip install playwright`
- All backend deps: `pip install -r requirements.txt`
## Running
```bash
cd ~/projects/canteen-asset-tracker
python3 -m pytest tests/frontend/ -v
```
## Architecture
- Each test gets an isolated temp SQLite database
- A FastAPI server runs on a random port in a background thread
- `CANTEEN_SKIP_AUTH=1` skips auth middleware so Playwright doesn't need real tokens
- Playwright launches system Chromium in headless mode at iPhone 14 viewport size
- Geolocation is mocked to Orlando, FL
## Writing Tests
Import the `page` and `live_server` fixtures:
```python
def test_something(page, live_server):
page.locator("#someButton").click()
assert page.locator(".result").is_visible()
```