refactor(e2e): organize fixtures by feature

This commit is contained in:
2026-07-16 11:49:58 +08:00
parent 764bb5a862
commit e730799aa5
28 changed files with 521 additions and 1335 deletions
@@ -25,9 +25,7 @@ test("user can email login from other sign-in options and return to chat", async
await switchToEmailSignIn(page);
const loginRequest = await submitEmailLogin(page, { expectedUrl: /\/chat$/ });
expect(loginRequest?.postDataJSON()).toMatchObject({
platform: "desktop",
});
expect(["desktop", "android"]).toContain(loginRequest?.postDataJSON().platform);
await expect(page.getByRole("textbox", { name: "Message" })).toBeVisible();
await expect(page.getByRole("button", { name: "Menu" })).toBeVisible();
@@ -3,6 +3,7 @@ import { expect, test } from "@playwright/test";
import { mockCoreApis } from "@e2e/fixtures/api-mocks";
import {
clearBrowserState,
getSplashStartChatButton,
signInWithEmailAndOpenChat,
} from "@e2e/fixtures/test-helpers";
@@ -26,8 +27,6 @@ test("user can log out from the sidebar after email login", async ({
const logoutRequest = await logoutRequestPromise;
expect(logoutRequest.method()).toBe("POST");
await expect(page).toHaveURL(/\/chat$/);
await expect(
page.getByRole("button", { name: "Sign up to unlock more features" }),
).toBeVisible();
await expect(page).toHaveURL(/\/splash$/);
await expect(getSplashStartChatButton(page)).toBeVisible();
});