test(deploy): verify report touch release on public server

This commit is contained in:
xsl
2026-10-12 22:44:41 +08:00
parent 63c9e065a9
commit 2a49ebdab2
8 changed files with 669 additions and 559 deletions
+2 -1
View File
@@ -18,6 +18,7 @@ for (const asset of manifest.assets) {
const browser = await chromium.launch({ headless: true });
try {
const page = await browser.newPage({ viewport: { width: 375, height: 726 }, isMobile: true, hasTouch: true });
page.setDefaultTimeout(60000); // Public-site cold font/fixture downloads may exceed 30s.
const errors = [], writes = [];
page.on('pageerror', e => errors.push(e.message));
await page.route('**/*', route => {
@@ -26,7 +27,7 @@ try {
if (req.url().endsWith('/api/auth/session')) return route.fulfill({ json: { ok: true, user: { id: 'report-touch-fixture', kind: 'browser' } } });
return route.continue();
});
await page.goto(base + '?mock=1&screen=report');
await page.goto(base + '?mock=1&screen=report', { waitUntil: 'domcontentloaded' });
await page.waitForFunction(() => document.querySelector('#stat-score b').textContent !== '--' && [...document.querySelectorAll('.ditem-img')].every(i => !i.hidden && i.naturalWidth));
await page.evaluate(async () => { await Promise.all([document.fonts.load('500 40px MiSans'), document.fonts.load('400 12px MiSans')]); });
for (const width of [320, 375, 390, 414, 480]) {