Three-level end-to-end suite, all deterministic (no retries, no sleeps, no unmocked network): - tests/e2e/api (209 tests): every route in clipwright/api/app.py + free_tools — health/config, uploads, process submit matrix + worker/webhook/ auto-retry/resume, status/source/download-all, edit/effects, transcript/EDL/ rerender, scenes/reframe, subtitle, hook, Postiz, thumbnails, free tools, and the security/path guards. - tests/e2e/pipeline (136 tests): every stage with real ffmpeg and stubbed Gemini/yt-dlp/ASR/ML — download, transcribe, scene detect, selection, layout, reframe/render, subtitles, hooks, watermark, thumbnails, plus the real CLI full pipeline via stub_env. - dashboard/e2e (19 Playwright specs): route-interception state machine covering every dashboard flow; one real-backend spec left test.fixme. - Foundation: tests/e2e/conftest.py (state isolation, no-network guard, ffmpeg media factory, disk-seeded jobs), FakePopen worker harness, child-process stub_env, architecture-consistent fixtures. - CI: unit + backend-e2e + dashboard-e2e jobs in the python+node container; ffmpeg + Playwright installed in-job; no setup-node/cache (act runner). Verified: unit 790 passed; API E2E 209 passed; pipeline E2E 136 passed; Playwright 19 passed / 1 skipped.
37 lines
1.6 KiB
JavaScript
37 lines
1.6 KiB
JavaScript
import { test, expect } from '@playwright/test';
|
|
import { openApp, completedSession, JOB_ID } from '../fixtures/app.js';
|
|
|
|
test.describe('postiz publish', () => {
|
|
test('publishes a clip to the connected channels through /api/postiz/post', async ({ page }) => {
|
|
await openApp(page, {
|
|
seed: {
|
|
session: completedSession(),
|
|
postizUrl: 'http://postiz.e2e.local',
|
|
postizKey: 'postiz-e2e-key',
|
|
},
|
|
});
|
|
await expect(page.getByRole('heading', { name: 'First viral clip' })).toBeVisible();
|
|
|
|
await page.getByRole('button', { name: 'post', exact: true }).first().click();
|
|
const dialog = page.getByRole('dialog');
|
|
await expect(dialog.getByText('PUBLISH', { exact: true })).toBeVisible();
|
|
|
|
// Connected channels load from the mocked integrations endpoint.
|
|
await expect(dialog.getByText('My YouTube')).toBeVisible();
|
|
|
|
const requestPromise = page.waitForRequest(
|
|
(r) => r.method() === 'POST' && r.url().includes('/api/postiz/post'),
|
|
);
|
|
await dialog.getByRole('button', { name: /publish now/i }).click();
|
|
const request = await requestPromise;
|
|
|
|
const body = request.postDataJSON();
|
|
expect(body.job_id).toBe(JOB_ID);
|
|
expect(body.clip_index).toBe(0);
|
|
expect(body.integration_ids).toContain('int-yt');
|
|
expect(body.title).toBe('First viral clip');
|
|
expect(request.headers()['x-postiz-url']).toBe('http://postiz.e2e.local');
|
|
|
|
await expect(page.getByText(/Posted to My YouTube/)).toBeVisible();
|
|
});
|
|
});
|