page-cleanup-screenshot.spec.ts 574 B

12345678910111213
  1. import { test } from '@playwright/test';
  2. // BUG-11 修复:使用 data-testid 兜底
  3. const CHIP_LOCATOR = '[data-testid="example-chip"], .example-chip';
  4. test('精简后页面截图', async ({ page }) => {
  5. await page.goto('http://localhost:5173/#/pages/book-generator/create', { waitUntil: 'networkidle' });
  6. await page.waitForSelector(CHIP_LOCATOR, { timeout: 15000 });
  7. // 等动画结束、轮播进入稳态
  8. await page.waitForTimeout(1500);
  9. await page.screenshot({ path: 'tests/page-after-cleanup.png', fullPage: true });
  10. console.log('截图已保存');
  11. });