clipwright/dashboard/e2e/specs/smoke.spec.js
pedro-bento 026f3ff271
Some checks failed
CI / unit (pull_request) Failing after 24s
CI / backend-e2e (pull_request) Successful in 1m18s
CI / dashboard-e2e (pull_request) Successful in 1m44s
test: add full E2E coverage (API, pipeline, browser)
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.
2026-10-04 21:58:28 +01:00

28 lines
1.3 KiB
JavaScript

import { test, expect } from '@playwright/test';
import { openApp } from '../fixtures/app.js';
test.describe('smoke', () => {
test('boots the app, renders the generator and reaches Settings', async ({ page }) => {
const pageErrors = [];
page.on('pageerror', (err) => pageErrors.push(err.message));
await openApp(page, { hash: '#app' });
await expect(page.getByRole('heading', { name: /create viral shorts/i })).toBeVisible();
// The Gemini key is seeded, so the "keys missing" banners must not show.
await expect(page.getByText(/Required API keys missing/i)).toHaveCount(0);
await expect(page.getByText(/Gemini API Key Missing/i)).toHaveCount(0);
// Settings is a full view reachable from the rail.
await page.getByRole('button', { name: /settings/i }).first().click();
await expect(page.getByRole('heading', { name: 'Settings' })).toBeVisible();
await expect(page.getByText(/Publishing \(Postiz\)/i)).toBeVisible();
expect(pageErrors).toEqual([]);
});
test('asks for the Gemini key when none is stored', async ({ page }) => {
await openApp(page, { seed: { geminiKey: '' } });
await expect(page.getByText(/Required API keys missing/i)).toBeVisible();
});
});