Files
ohm_streaming/tests/e2e/auth.setup.ts
T
Kimi Agent 520be53901
CI / Test (Python 3.11) (push) Has been cancelled
CI / Test (Python 3.12) (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Type Check (push) Has been cancelled
CI / Summary (push) Has been cancelled
fix: migrations, auth, providers health check, E2E tests, remove neko-sama
- Add proper Alembic initial migration (0001_initial_schema.py)
- Migrate refresh tokens from JSON file to SQLite (RefreshTokenTable)
- Remove Neko-Sama provider entirely (redirects to Gupy, not a host)
- Fix provider health check always showing UNKNOWN
  - Run check_all_health() on startup
  - Fix POST /providers/health/check background task bug
  - Add HTMX refresh after manual health check trigger
- Fix anime search relevance scoring with MIN_RELEVANCE_THRESHOLD=0.5
- Replace bare 'except:' with 'except Exception:' across codebase
- Add Playwright E2E test suite (12 tests, auth setup, helpers)
- Fix toast container blocking clicks via pointer-events: none
- Remove obsolete Jest/Vite test files and config
- Clean up obsolete test_watchlist scripts
- Update sonarr model comment for active providers
2026-05-12 11:45:56 +00:00

34 lines
1022 B
TypeScript

import { test as setup, expect } from '@playwright/test';
const authFile = 'playwright/.auth/user.json';
setup('authenticate', async ({ page }) => {
// Create user if not exists (global setup should have done it, but be safe)
const resp = await page.request.post('/api/auth/register', {
data: {
username: 'e2e_testuser',
password: 'TestPassword123!',
email: 'e2e@example.com',
full_name: 'E2E Test User',
},
});
if (!resp.ok() && resp.status() !== 400) {
console.warn('Register failed:', await resp.text());
}
// Login via UI
await page.goto('/login');
await page.fill('#loginUsername', 'e2e_testuser');
await page.fill('#loginPassword', 'TestPassword123!');
await Promise.all([
page.waitForResponse((resp) => resp.url().includes('/api/auth/login')),
page.click('#loginSubmit'),
]);
await page.waitForURL('**/web**', { timeout: 10000 });
// Save storage state (localStorage + cookies)
await page.context().storageState({ path: authFile });
});