Fill e2e gaps: storageState, real upload POST, session smoke
Add auth setup project, viewer session check, upload that posts a fixture, FastAPI login spec (skips without E2E_API_*), and repo ROADMAP.md.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { assertPublicHost, waitForUrlHost } from '@levkin/playkit';
|
||||
import path from 'node:path';
|
||||
import { test, expect } from '../fixtures';
|
||||
|
||||
/**
|
||||
* Viewer (NextAuth) session — cookies from storageState.
|
||||
* FastAPI bearer auth is a separate user store; see api.fastapi-login.spec.ts.
|
||||
*/
|
||||
test.describe('viewer session @smoke', () => {
|
||||
test.use({ storageState: path.join(__dirname, '../.auth/admin.json') });
|
||||
|
||||
test('session endpoint returns authenticated user', async ({ page, playkitConfig, timings }) => {
|
||||
assertPublicHost(playkitConfig.baseUrl);
|
||||
|
||||
await timings.measure('session', async () => {
|
||||
await page.goto(`${playkitConfig.baseUrl}/`);
|
||||
await waitForUrlHost(page, playkitConfig.expectedHost);
|
||||
const res = await page.request.get(`${playkitConfig.baseUrl}/api/auth/session`);
|
||||
expect(res.ok()).toBeTruthy();
|
||||
const body = await res.json();
|
||||
expect(body?.user?.email).toBeTruthy();
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user