docs: UI-02 acceptance record and visual verification

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-21 23:10:58 +08:00
parent 160e7e5f1a
commit 2a489aa16a
23 changed files with 297 additions and 75 deletions
+10 -10
View File
@@ -39,7 +39,7 @@ async function openLightbox(page: Page, token: string, init?: () => void): Promi
await page.goto(`/a/${token}`);
await expect(page.locator('.cell').first()).toBeVisible();
await page.locator('.cell').first().click();
await expect(page.locator('.lightbox')).toBeVisible();
await expect(page.locator('.photo-viewer')).toBeVisible();
}
test.afterAll(async () => {
@@ -56,18 +56,18 @@ test('download entry visibility follows album two-tier switches', async ({ page
await openLightbox(page, offOff);
await expect(page.locator('.download-group')).toHaveCount(0);
// on/off:单按钮(无 caret/菜单)。
// on/off:单按钮(无 caret/菜单)。UI-02 V05:下载位在底部操作栏(.download-main)。
const onOff = await seedDownloadAlbum('dl-onoff', {});
await openLightbox(page, onOff);
await expect(page.locator('.control.download')).toBeVisible();
await expect(page.locator('.control.download-caret')).toHaveCount(0);
await expect(page.locator('.download-main')).toBeVisible();
await expect(page.locator('.download-caret')).toHaveCount(0);
// on/on:分体按钮,菜单两选项(下载图片 / 下载原图)。
// on/on:分体按钮,菜单两选项(浏览图 / 原图)。
const onOn = await seedDownloadAlbum('dl-onon', { originalDownloadEnabled: true });
await openLightbox(page, onOn);
await expect(page.locator('.control.download-caret')).toBeVisible();
await page.locator('.control.download-caret').click();
await expect(page.locator('.download-menu button')).toHaveText(['下载图片', '下载原图']);
await expect(page.locator('.download-caret')).toBeVisible();
await page.locator('.download-caret').click();
await expect(page.locator('.download-menu button')).toHaveText(['浏览图', '原图']);
});
test('WeChat webview UA shows guidance overlay instead of downloading', async ({ page }) => {
@@ -85,7 +85,7 @@ test('WeChat webview UA shows guidance overlay instead of downloading', async ({
if (request.url().includes('/download?')) endpointHit = true;
});
await page.locator('.control.download').click();
await page.locator('.download-main').click();
await expect(page.locator('.wechat-guide[role="dialog"]')).toBeVisible();
await expect(page.locator('.wechat-guide h2')).toHaveText('保存图片指引');
await expect(page.locator('.guide-copy')).toBeVisible();
@@ -112,7 +112,7 @@ test('real click downloads browse via signed url from the endpoint', async ({ pa
(response) =>
response.url().includes('/download?variant=browse') && response.status() === 200,
);
await page.locator('.control.download').click();
await page.locator('.download-main').click();
const response = await endpoint;
expect((await response.json()).variant).toBe('browse');