Files
cozsweet-frontend-nextjs/e2e/specs/real/email-login-from-other-options.spec.ts
T
admin 9deb320cf6 feat(profile)!: replace sidebar and add avatar navigation
Rename the global Sidebar route, UI, assets, analytics, and payment return context to Profile. Add accessible message-avatar navigation and preserve the source character across auth and logout flows.

BREAKING CHANGE: /sidebar has been removed; use /profile instead.
2026-07-21 18:08:12 +08:00

49 lines
1.4 KiB
TypeScript

import { expect, test } from "@playwright/test";
import {
defaultCharacterChatUrl,
enterChatFromSplash,
submitEmailLogin,
switchToEmailSignIn,
} from "@e2e/fixtures/test-helpers";
const preReleaseHost = "frontend-test.banlv-ai.com";
const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? "";
test.describe("pre-release email login smoke", () => {
test.skip(
!baseURL.includes(preReleaseHost),
`Run this test only with PLAYWRIGHT_BASE_URL pointing at ${preReleaseHost}.`,
);
test("guest can switch to email login from other sign-in options and return to chat", async ({
page,
}) => {
await enterChatFromSplash(page, {
expectedUrl: defaultCharacterChatUrl,
timeout: 20_000,
waitUntil: "domcontentloaded",
});
await expect(
page.getByRole("button", { name: "Sign up to unlock more features" }),
).toBeVisible();
await Promise.all([
page.waitForURL(/\/auth(?:\?.*)?$/, { timeout: 20_000 }),
page
.getByRole("button", { name: "Sign up to unlock more features" })
.click(),
]);
await switchToEmailSignIn(page);
await submitEmailLogin(page, {
expectedUrl: defaultCharacterChatUrl,
waitForRequest: false,
urlTimeout: 20_000,
});
await expect(page.getByRole("button", { name: "Profile" })).toBeVisible();
await expect(page.getByRole("textbox", { name: "Message" })).toBeVisible();
});
});