diff --git a/src/frontend/tests/a11y/messages.a11y.spec.ts b/src/frontend/tests/a11y/messages.a11y.spec.ts index 809f5d7be6bf..2e3e828ac5af 100644 --- a/src/frontend/tests/a11y/messages.a11y.spec.ts +++ b/src/frontend/tests/a11y/messages.a11y.spec.ts @@ -276,7 +276,15 @@ test.describe("Messages settings route accessibility", () => { await awaitBootstrapTest(page, { skipModal: true }); await page.goto("/settings/messages"); - await expect(page.getByRole("status", { name: "Loading" })).toBeVisible(); + // A full goto reboots the app: after `load` it still has to run + // auto_login -> whoami -> config and pull the lazy settings route before + // SessionView mounts and this status renders. On Windows CI that chain + // takes 7s+ (nightly 31907290063, shard 24: the page mounted the messages + // query 1.4s and 1.7s after the default 5s expect gave up), so use the + // same budget the knowledge-bases loading scan already uses. + await expect(page.getByRole("status", { name: "Loading" })).toBeVisible({ + timeout: TIMEOUTS.standard, + }); await page.runA11yScan("settings-messages-loading"); releaseResponse(); }, diff --git a/src/frontend/tests/core/features/publish-flow.spec.ts b/src/frontend/tests/core/features/publish-flow.spec.ts index dbe7d8ab9968..409b8af42562 100644 --- a/src/frontend/tests/core/features/publish-flow.spec.ts +++ b/src/frontend/tests/core/features/publish-flow.spec.ts @@ -1,10 +1,10 @@ import { expect, test } from "../../fixtures"; import { adjustScreenView } from "../../utils/adjust-screen-view"; import { TID } from "../../utils/constants/testIds"; -import { TEXTS } from "../../utils/constants/texts"; import { ANIMATIONS, TIMEOUTS } from "../../utils/constants/timeouts"; import { addComponentFromSidebar } from "../../utils/flow/add-component-from-sidebar"; import { openBlankFlow } from "../../utils/flow/open-blank-flow"; +import { sendPlaygroundMessage } from "../../utils/playground/send-playground-message"; test( "user should be able to publish a flow", @@ -40,18 +40,16 @@ test( const newPage = await pagePromise; await newPage.waitForLoadState("domcontentloaded"); - // Wait for the chat input to actually be present before filling. The - // default actionTimeout (20s) was not enough on Windows CI for the - // shareable-playground page to mount the message input. - await newPage - .getByPlaceholder(TEXTS.placeholderSendMessage) - .waitFor({ state: "visible", timeout: TIMEOUTS.long }); + // Run the published flow to completion before leaving the page. The + // helper waits for the chat input (slow to mount on Windows CI), sends, + // and only returns once the Stop button has cleared. Closing the tab while + // the build was still in flight aborted the backend request mid-write; on + // SQLite that cancellation can leave a write transaction open until GC and + // stall every other writer, which is how the un-publish PATCH below hung + // for 10s+ (nightly 31907290063, shard 41). Waiting also proves the + // shareable playground actually completes a run. + await sendPlaygroundMessage(newPage, "Hello", { surface: "shareable" }); const newUrl = newPage.url(); - await newPage.getByPlaceholder(TEXTS.placeholderSendMessage).fill("Hello"); - await newPage.getByTestId(TID.buttonSend).last().click(); - - const stopButton = newPage.getByRole("button", { name: TEXTS.stop }); - await stopButton.waitFor({ state: "visible", timeout: TIMEOUTS.standard }); await newPage.close(); await page.bringToFront();