evOo-local/apps/web/e2e/onboarding-model-auto-skip.spec.ts
cynarAI fc173918f7 fix(e2e): harden onboarding-model-labels rpc/me intercept (#89)
* fix(e2e): harden onboarding-model-labels rpc/me intercept

Avoid passing a consumed fetch Response into route.fulfill alongside
json, which intermittently throws Response has been disposed in CI.

Add routePatchRpc helper that reads the body once and fulfills with
status, headers, and patched json only.

Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>

* fix(e2e): migrate rpc/me intercept anti-pattern across specs

Extend helpers with fulfillFetchedRpc for multi-procedure or in-place
patches. Move onboarding, mobile, host-computer, and group-chats specs
off route.fulfill({ response, json }) after response.json().

Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>

* style(e2e): biome-format host-computer-prompt rpc/me cast

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
2026-09-24 08:16:39 +02:00

38 lines
1.2 KiB
TypeScript

import { expect, test } from "@playwright/test";
import { routePatchRpc, signup } from "./helpers";
test("onboarding skips model connect when a default model is already available", async ({
page,
}) => {
await routePatchRpc(page, "me", (json) => ({ ...json, needsModel: false }));
await page.route("**/rpc/integrationSetup/get", (route) =>
route.fulfill({
json: {
json: {
canConfigure: false,
needsSetup: false,
webUrl: "https://example.test/integrations/setup",
providers: [],
},
},
}),
);
const stamp = Date.now();
await signup(
page,
`model-auto-skip-${stamp}@rakazo.test`,
"password12",
`Model auto skip ${stamp}`,
);
await expect(page.getByRole("heading", { name: /Design your Oo/i })).toBeVisible({
timeout: 20_000,
});
await expect(page.getByRole("heading", { name: "Connect a model" })).toHaveCount(0);
await expect(page.getByRole("heading", { name: "Server integrations" })).toHaveCount(0);
await expect(page.getByRole("heading", { name: "Create your first bot" })).toHaveCount(0);
await expect(page.getByRole("combobox", { name: "Message" })).toHaveCount(0);
});