feat(mobile): improve image viewer and install entry

This commit is contained in:
Codex
2026-07-24 11:24:23 +08:00
parent e3ef289b53
commit 556bfd2919
11 changed files with 403 additions and 42 deletions
@@ -57,7 +57,7 @@ test("favorite entry and three-tab Menu navigation render on the real pages", as
name: "Primary navigation",
});
await expect(navigation).toContainText("Chat");
await expect(navigation).toContainText("Elio Private Zone");
await expect(navigation).toContainText("Private Zone");
await expect(navigation).toContainText("Menu");
await savePreview(page, `${mobile ? "mobile" : "desktop"}-splash.png`);
@@ -94,8 +94,16 @@ test("favorite entry and three-tab Menu navigation render on the real pages", as
});
});
await page.goto(defaultCharacterChatPath);
await expect(page.getByRole("button", { name: "Saved" })).toBeVisible();
await savePreview(page, "mobile-ios-external-chat-saved.png");
const iosDownload = page.getByRole("button", { name: "Download" });
await expect(iosDownload).toBeVisible();
await iosDownload.click();
await expect(
page.getByRole("heading", { name: "Add CozSweet to Home Screen" }),
).toBeVisible();
await expect(page.getByRole("dialog")).toContainText(
"In Safari, tap the Share button, then choose “Add to Home Screen”.",
);
await savePreview(page, "mobile-ios-external-chat-download.png");
}
expect(browserErrors.filter(isFeatureRuntimeError)).toEqual([]);
+37
View File
@@ -1,6 +1,8 @@
import { expect, test } from "@playwright/test";
import { mockCoreApis } from "@e2e/fixtures/api-mocks";
import { apiEnvelope } from "@e2e/fixtures/data/common";
import { createPaidImageHistoryResponse } from "@e2e/fixtures/data/chat";
import {
paidImageDisplayMessageId,
paidImageMessageId,
@@ -97,3 +99,38 @@ test("guest can unlock a paid image after email login and subscription payment",
expect(new URL(page.url()).pathname).toBe(defaultCharacterChatPath);
await expect(page.getByRole("textbox", { name: "Message" })).toBeVisible();
});
test("fullscreen image closes from its back button, the image, and browser history Back", async ({
page,
}) => {
await page.route("**/api/chat/history**", async (route) => {
await route.fulfill({
json: apiEnvelope(createPaidImageHistoryResponse(true)),
});
});
await enterChatFromSplash(page);
await dismissChatInterruptions(page);
const imageButton = page.getByRole("button", {
name: "Open image in fullscreen",
});
const imageDialog = page.getByRole("dialog", { name: "Fullscreen image" });
await imageButton.click();
await expect(imageDialog).toBeVisible();
await imageDialog.getByRole("button", { name: "Back" }).click();
await expect(imageDialog).toHaveCount(0);
await expect(page).toHaveURL(defaultCharacterChatPath);
await imageButton.click();
await expect(imageDialog).toBeVisible();
await imageDialog.locator("img").click();
await expect(imageDialog).toHaveCount(0);
await expect(page).toHaveURL(defaultCharacterChatPath);
await imageButton.click();
await expect(imageDialog).toBeVisible();
await page.goBack();
await expect(imageDialog).toHaveCount(0);
await expect(page).toHaveURL(defaultCharacterChatPath);
});