chore(release): promote E2E fixes to pre
Docker Image / Build and Push Docker Image (push) Successful in 2m12s

This commit is contained in:
Codex
2026-07-22 16:53:48 +08:00
16 changed files with 116 additions and 28 deletions
+1 -1
View File
@@ -40,6 +40,6 @@ pnpm test:e2e:real
```bash
PLAYWRIGHT_BASE_URL=https://cozsweet.com \
E2E_API_BASE_URL=https://proapi.banlv-ai.com \
E2E_API_BASE_URL=https://api.banlv-ai.com \
pnpm test:e2e:prod
```
+1
View File
@@ -66,6 +66,7 @@ export function createWeeklyLimitChatSendResponse(
}
export const paidImageMessageId = "msg_photo_paywall_001";
export const paidImageDisplayMessageId = `server:${paidImageMessageId}:assistant`;
export const paidImageUrl =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+/p9sAAAAASUVORK5CYII=";
export const paidImageChatSendResponse = {
-2
View File
@@ -42,9 +42,7 @@ export async function dismissChatInterruptions(page: Page) {
export async function signInWithEmailAndOpenChat(page: Page) {
await seedEmailSession(page);
const historyResponsePromise = page.waitForResponse("**/api/chat/history**");
await page.goto(defaultCharacterChatPath);
await historyResponsePromise;
await dismissChatInterruptions(page);
await expect(page.getByRole("textbox", { name: "Message" })).toBeEnabled({ timeout: 20_000 });
}
@@ -7,7 +7,6 @@ import {
defaultCharacterChatUrl,
expectInsufficientCreditsDialog,
expectVipChatSubscriptionUrl,
setEmailSessionStorage,
submitEmailLogin,
switchToEmailSignIn,
} from "@e2e/fixtures/test-helpers";
@@ -36,13 +35,10 @@ test("guest unlocks a promoted image through email login and top-up", async ({
await expect(page).toHaveURL(/\/auth\?redirect=/);
await switchToEmailSignIn(page);
await submitEmailLogin(page, { expectedUrl: defaultCharacterChatUrl });
await setEmailSessionStorage(page);
const unlockRequestPromise = page.waitForRequest(
"**/api/chat/unlock-private",
);
await page.reload();
await submitEmailLogin(page, { expectedUrl: defaultCharacterChatUrl });
const unlockRequest = await unlockRequestPromise;
expect(unlockRequest.method()).toBe("POST");
+10 -11
View File
@@ -1,7 +1,10 @@
import { expect, test } from "@playwright/test";
import { mockCoreApis } from "@e2e/fixtures/api-mocks";
import { paidImageMessageId } from "@e2e/fixtures/test-data";
import {
paidImageDisplayMessageId,
paidImageMessageId,
} from "@e2e/fixtures/test-data";
import {
clearBrowserState,
completeVipPayment,
@@ -10,13 +13,12 @@ import {
enterChatFromSplash,
expectInsufficientCreditsDialog,
expectVipChatSubscriptionUrl,
setEmailSessionStorage,
submitEmailLogin,
switchToEmailSignIn,
} from "@e2e/fixtures/test-helpers";
const paidImageOverlayUrl = new RegExp(
`${defaultCharacterChatPath}\\?image=${paidImageMessageId}$`,
`${defaultCharacterChatPath}\\?image=${encodeURIComponent(paidImageDisplayMessageId)}$`,
);
test.beforeEach(async ({ baseURL, context, page }) => {
@@ -63,19 +65,16 @@ test("guest can unlock a paid image after email login and subscription payment",
await expect(page).toHaveURL(/\/auth\?redirect=/);
expect(new URL(page.url()).searchParams.get("redirect")).toBe(
`${defaultCharacterChatPath}?image=${paidImageMessageId}`,
`${defaultCharacterChatPath}?image=${encodeURIComponent(paidImageDisplayMessageId)}`,
);
await switchToEmailSignIn(page);
await submitEmailLogin(page, {
expectedUrl: paidImageOverlayUrl,
});
await setEmailSessionStorage(page);
const unlockRequestPromise = page.waitForRequest(
"**/api/chat/unlock-private",
);
await page.goto(`${defaultCharacterChatPath}?image=${paidImageMessageId}`);
await submitEmailLogin(page, {
expectedUrl: paidImageOverlayUrl,
});
const unlockRequest = await unlockRequestPromise;
expect(unlockRequest.postDataJSON()).toMatchObject({
@@ -92,7 +91,7 @@ test("guest can unlock a paid image after email login and subscription payment",
await expect(page).toHaveURL(
new RegExp(
`${defaultCharacterChatPath}(?:\\?image=msg_photo_paywall_001)?$`,
`${defaultCharacterChatPath}(?:\\?image=${encodeURIComponent(paidImageDisplayMessageId)})?$`,
),
);
expect(new URL(page.url()).pathname).toBe(defaultCharacterChatPath);
@@ -1,7 +1,10 @@
import { expect, test } from "@playwright/test";
import { mockCoreApis } from "@e2e/fixtures/api-mocks";
import { paidImageMessageId } from "@e2e/fixtures/test-data";
import {
paidImageDisplayMessageId,
paidImageMessageId,
} from "@e2e/fixtures/test-data";
import {
clearBrowserState,
defaultCharacterChatPath,
@@ -12,7 +15,7 @@ import {
} from "@e2e/fixtures/test-helpers";
const paidImageOverlayUrl = new RegExp(
`${defaultCharacterChatPath}\\?image=${paidImageMessageId}$`,
`${defaultCharacterChatPath}\\?image=${encodeURIComponent(paidImageDisplayMessageId)}$`,
);
test.beforeEach(async ({ baseURL, context, page }) => {