import { test, expect } from "@playwright/test"; import { channelStage, generateReport, resetData, } from "./helpers"; // The channel index page lets you launch jobs without drilling into the // detail page. Today: Sync + Check availability. Both default to the platform // queue (so they share the per-source rate-limit budget with each other). test("channel list shows both Sync and Check availability buttons per row", async ({ page, }) => { await resetData("one-youtube-channel"); await page.goto("/channels"); await expect( page.getByRole("button", { name: "sync test-youtube" }), ).toBeVisible(); await expect( page.getByRole("button", { name: "check availability test-youtube" }), ).toBeVisible(); }); test("Check availability from the list uses the platform queue", async ({ page, }) => { await resetData("one-youtube-channel"); await page.goto("/channels"); await page .getByRole("button", { name: "check availability test-youtube" }) .click(); // Empty data dir → job finishes essentially instantly. Wait for the done // pill (which surfaces the jobId) instead of trying to catch the running pill. await expect( page.getByLabel("check availability test-youtube done"), ).toBeVisible({ timeout: 15_000 }); await page.goto("/jobs"); const firstRow = page.getByRole("row").nth(1); await expect(firstRow).toContainText("platform:youtube"); await expect(firstRow).toContainText("check-availability"); }); test("Transcribe missing defaults to the system-wide 'transcription' queue", async ({ page, }) => { await resetData("one-transcribe-channel-with-audio"); await generateReport(page, "test-transcribe"); await page.goto(channelStage("test-transcribe", "transcribe")); await page.getByRole("button", { name: "Transcribe missing" }).click(); await expect(page.getByLabel("Transcribe missing output")).toContainText( "succeeded", { timeout: 30_000 }, ); await page.goto("/jobs"); const firstRow = page.getByRole("row").nth(1); await expect(firstRow).toContainText("transcription"); // Match the machine kind, not the rendered label ("Transcribe all"). await expect(firstRow).toHaveAttribute("data-kind", "whisper-all"); });