test(frontend): CBZ page-mode component test + e2e mode/RTL smoke (B1)
This commit is contained in:
@@ -51,6 +51,26 @@ test("登录 → 书架 → CBZ 阅读翻页 → 书签 → 退出", async ({ pa
|
||||
await expect(page.getByText("2/3")).toBeVisible();
|
||||
}).toPass({ timeout: 20_000 });
|
||||
|
||||
// 页模式 + RTL 冒烟:开设置面板 → 单页 → 右缘翻页 → 右开本(RTL) 方向翻转 → 回长卷。
|
||||
await page.getByRole("button", { name: "更多阅读设置" }).click();
|
||||
await page.getByRole("button", { name: "单页" }).click();
|
||||
await expect(page.getByText(/^1\/3 · /)).toBeVisible(); // 模式切换保持当前页:此时在第 2 页
|
||||
// 回到第 1 页:左缘点击
|
||||
const box2 = await reader.boundingBox();
|
||||
if (!box2) throw new Error("阅读器容器无 boundingBox");
|
||||
await page.mouse.click(box2.x + box2.width * 0.1, box2.y + box2.height / 2);
|
||||
await expect(page.getByText(/^1\/3 · /)).toBeVisible();
|
||||
// 右缘点击 → 第 2 页
|
||||
await page.mouse.click(box2.x + box2.width * 0.9, box2.y + box2.height / 2);
|
||||
await expect(page.getByText(/^2\/3 · /)).toBeVisible();
|
||||
// RTL:右缘点击变后退
|
||||
await page.getByRole("button", { name: "右开本(RTL)" }).click();
|
||||
await page.mouse.click(box2.x + box2.width * 0.9, box2.y + box2.height / 2);
|
||||
await expect(page.getByText(/^1\/3 · /)).toBeVisible();
|
||||
// 回长卷
|
||||
await page.getByRole("button", { name: "长卷", exact: true }).click();
|
||||
await expect(page.getByText("1/3")).toBeVisible();
|
||||
|
||||
// 导航抽屉(本 fixture 无内嵌目录,抽屉直接落在书签面板)→ 加书签 → toast
|
||||
await page.getByRole("button", { name: "导航", exact: true }).click();
|
||||
const nav = page.locator("#reader-nav");
|
||||
|
||||
Reference in New Issue
Block a user