- 新 BUILD_ID HCvsEIztksM1GCWBJBrRP 上线;步骤 1.5 生成的镜像使 verify_remote 的六项资源级断言在真实部署中全 200 —— 破站路径已由脚本自身堵住,不再靠人工复核 - 线上首页引用的 chunk 逐个回查本地产物确认同源;Playwright 三页 0 失败资源、0 控制台错误 - 证据补 deploy-2.txt 与可复跑的 probe.mjs
45 lines
2.0 KiB
JavaScript
45 lines
2.0 KiB
JavaScript
import { chromium } from 'playwright-core';
|
|
|
|
const targets = ['https://novalon.cn/', 'https://novalon.cn/products/erp', 'https://novalon.cn/contact'];
|
|
const browser = await chromium.launch();
|
|
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } });
|
|
let bad = 0;
|
|
|
|
for (const url of targets) {
|
|
const page = await ctx.newPage();
|
|
const failed = [];
|
|
const consoleErrs = [];
|
|
page.on('response', (r) => {
|
|
if (r.status() >= 400 && r.request().method() === 'GET') failed.push(`${r.status()} ${r.url()}`);
|
|
});
|
|
page.on('console', (m) => { if (m.type() === 'error') consoleErrs.push(m.text().slice(0, 120)); });
|
|
await page.goto(url, { waitUntil: 'networkidle', timeout: 60000 });
|
|
const probe = await page.evaluate(() => {
|
|
const h1 = document.querySelector('h1');
|
|
const cs = h1 ? getComputedStyle(h1) : null;
|
|
const brand = [...document.querySelectorAll('*')].find((e) => {
|
|
const c = getComputedStyle(e).color;
|
|
return c === 'rgb(196, 30, 58)';
|
|
});
|
|
return {
|
|
sheets: document.styleSheets.length,
|
|
h1: h1 ? h1.textContent.trim().slice(0, 24) : null,
|
|
h1Font: cs ? cs.fontFamily.slice(0, 24) : null,
|
|
h1Size: cs ? cs.fontSize : null,
|
|
brandRedNodes: !!brand,
|
|
hydrated: !!document.querySelector('[data-reactroot], [data-reactid]') || !!window.nextVersion || typeof window.__next_f !== 'undefined',
|
|
};
|
|
});
|
|
const uniqFailed = [...new Set(failed)];
|
|
console.log(`\n### ${url}`);
|
|
console.log(` stylesheets=${probe.sheets} h1="${probe.h1}" font=${probe.h1Font}/${probe.h1Size} brandRed=${probe.brandRedNodes} nextData=${probe.hydrated}`);
|
|
console.log(` 4xx/5xx GET = ${uniqFailed.length}`);
|
|
uniqFailed.slice(0, 6).forEach((f) => console.log(` ${f}`));
|
|
console.log(` console errors = ${consoleErrs.length}`);
|
|
[...new Set(consoleErrs)].slice(0, 4).forEach((e) => console.log(` ${e}`));
|
|
bad += uniqFailed.filter((f) => !/\/(api\/)?healthz/.test(f)).length;
|
|
await page.close();
|
|
}
|
|
await browser.close();
|
|
console.log(`\nTOTAL_FAILED_GETS=${bad}`);
|