test(release): align selected production e2e assertions

This commit is contained in:
Codex
2026-07-27 16:40:52 +08:00
parent 1b121a8ef8
commit ddacd03601
3 changed files with 15 additions and 5 deletions
@@ -4,6 +4,7 @@ import { mockCoreApis } from "@e2e/fixtures/api-mocks";
import {
clearBrowserState,
enterChatFromSplash,
expectAuthRedirectToVipChatSubscription,
} from "@e2e/fixtures/test-helpers";
test.beforeEach(async ({ baseURL, context, page }) => {
@@ -43,7 +44,12 @@ test("asks for consent before opening a user-bound discount plan", async ({
await expect(offer).toContainText("Want me to ask for my best private offer?");
await offer.getByRole("button", { name: "Yes, ask for me" }).click();
await expect(page).toHaveURL(
/\/subscription\?type=vip.*planId=vip_annual.*commercialOfferId=13ec8a10/,
await expect(page).toHaveURL(/\/auth\?redirect=/);
expectAuthRedirectToVipChatSubscription(page);
const redirect = new URL(page.url()).searchParams.get("redirect");
const subscriptionUrl = new URL(redirect ?? "", "http://e2e.local");
expect(subscriptionUrl.searchParams.get("planId")).toBe("vip_annual");
expect(subscriptionUrl.searchParams.get("commercialOfferId")).toBe(
"13ec8a10-58d7-4d24-b66b-8db5699a1aa8",
);
});
@@ -26,7 +26,10 @@ test("guest unlocks a promoted image through email login and top-up", async ({
);
await expect(page).toHaveURL(defaultCharacterChatUrl);
const unlockButton = page.getByRole("button", {
const promotedImageCard = page
.getByRole("group", { name: "Locked private image" })
.last();
const unlockButton = promotedImageCard.getByRole("button", {
name: "Unlock private image",
});
await expect(unlockButton).toBeVisible({ timeout: 10_000 });