docs: UI-02 acceptance record and visual verification
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -384,9 +384,11 @@ test.describe.serial('cross-frontend journey (admin → api/worker → viewer)',
|
||||
await expect(page.locator('h1.title')).toHaveText(zhTitle);
|
||||
await expect(page.locator('.categories .chip')).toHaveCount(2); // 全部 + 主舞台
|
||||
|
||||
await page.locator('button.locale-switcher').click();
|
||||
await page.locator('.locale-trigger').click();
|
||||
await page.locator('.locale-option', { hasText: 'English' }).click();
|
||||
await expect(page.locator('h1.title')).toHaveText(enTitle);
|
||||
await page.locator('button.locale-switcher').click(); // 切回 zh,后续断言用中文
|
||||
await page.locator('.locale-trigger').click(); // 切回 zh,后续断言用中文
|
||||
await page.locator('.locale-option', { hasText: '中文' }).click();
|
||||
await expect(page.locator('h1.title')).toHaveText(zhTitle);
|
||||
|
||||
// 瀑布流 3 张 → 分类 chip 过滤 1 张 → 全部恢复 3 张。
|
||||
@@ -397,18 +399,18 @@ test.describe.serial('cross-frontend journey (admin → api/worker → viewer)',
|
||||
await expect(page.locator('.cell')).toHaveCount(3);
|
||||
|
||||
// Task 10 互动化:浏览计数行(首访上报后权威回填)+ 排序 chips 在位。
|
||||
await expect(page.locator('.view-count')).toHaveText('1', { timeout: 15_000 });
|
||||
await expect(page.locator('.sort .chip')).toHaveText(['最新', '热门']);
|
||||
await expect(page.locator('.view-count')).toHaveText('1 次浏览', { timeout: 15_000 });
|
||||
await expect(page.locator('.sort-tabs .sort-tab')).toHaveText(['最新', '热门']);
|
||||
|
||||
// 大图:点击开图 → 真实字节 → 滚轮缩放 → 双击复位 → 关闭回列表。
|
||||
const lightboxPhoto = photoIds[1]!; // 800×500(后续 admin 腿按尺寸锚定隐藏)
|
||||
await page.locator('.cell').nth(1).click();
|
||||
await expect(page.locator('.lightbox')).toBeVisible();
|
||||
await expect(page.locator('.photo-viewer')).toBeVisible();
|
||||
await expect(
|
||||
page.locator('img.photo'),
|
||||
).toHaveAttribute('src', new RegExp(lightboxPhoto));
|
||||
// Task 10:大图内真实点赞 1 次 → 防抖冲批 → 权威计数 1。
|
||||
await page.locator('.control.like-button').click();
|
||||
await page.locator('.action-bar .like-slot .action-btn').click();
|
||||
await expect(page.locator('.like-count')).toHaveText('1');
|
||||
await expect
|
||||
.poll(async () =>
|
||||
@@ -416,7 +418,7 @@ test.describe.serial('cross-frontend journey (admin → api/worker → viewer)',
|
||||
)
|
||||
.toBeGreaterThan(0);
|
||||
expect(page.url()).toContain(`/a/${publicToken}/p/${lightboxPhoto}`);
|
||||
const box = await page.locator('.lightbox').boundingBox();
|
||||
const box = await page.locator('.photo-viewer').boundingBox();
|
||||
expect(box).not.toBeNull();
|
||||
await page.mouse.move(box!.x + box!.width / 2, box!.y + box!.height / 2);
|
||||
await page.mouse.wheel(0, -360);
|
||||
@@ -435,12 +437,12 @@ test.describe.serial('cross-frontend journey (admin → api/worker → viewer)',
|
||||
.evaluate((img) => new DOMMatrixReadOnly(getComputedStyle(img).transform).a),
|
||||
)
|
||||
.toBeCloseTo(1, 1);
|
||||
await page.locator('.control.close').click();
|
||||
await expect(page.locator('.lightbox')).toHaveCount(0);
|
||||
await page.locator('.viewer-close').click();
|
||||
await expect(page.locator('.photo-viewer')).toHaveCount(0);
|
||||
|
||||
// 深链直达:/a/{token}/p/{photoId} 直接开在大图上。
|
||||
await page.goto(`/a/${publicToken}/p/${lightboxPhoto}`);
|
||||
await expect(page.locator('.lightbox')).toBeVisible();
|
||||
await expect(page.locator('.photo-viewer')).toBeVisible();
|
||||
await expect(page.locator('img.photo')).toHaveAttribute(
|
||||
'src',
|
||||
new RegExp(lightboxPhoto),
|
||||
@@ -473,7 +475,7 @@ test.describe.serial('cross-frontend journey (admin → api/worker → viewer)',
|
||||
const notice = page.locator('.deep-link-notice');
|
||||
await expect(notice).toBeVisible();
|
||||
await expect(notice).toContainText('照片不存在或已下线');
|
||||
await expect(page.locator('.lightbox')).toHaveCount(0);
|
||||
await expect(page.locator('.photo-viewer')).toHaveCount(0);
|
||||
|
||||
// ── ⑤ 空相册 B:viewer 空态提示(B 经 API 建于 cn,先同步到 ov)──
|
||||
await flushSync(emptyAlbumId);
|
||||
|
||||
Reference in New Issue
Block a user