Files
flutter_wisetronic/tools/e2e/diag2.js
peima 944493a39b fix(runtime): e2e 发现的 3 个 bug 修复
- download: desktop_download_apps SingleChildScrollView 加 primary:true (Scrollbar 缺 ScrollPosition)
- contact-stores: checkDomainAvailability async 后 setState 加 mounted 保护 (dispose 后 setState)
- buy-service: _loadData 加 data 结构校验 + mounted 保护 (API 400 无效参数时 data 为错误结构 -> RangeError)
2026-08-01 23:20:25 +08:00

33 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 诊断 v2打印完整 CK_STACK定位 framework 抛的错误的源头)
const { chromium } = require('playwright');
const BASE = 'http://127.0.0.1:8099';
const ROUTES = ['/buy-service/1/pos', '/download'];
(async () => {
const browser = await chromium.launch({ headless: true });
for (const route of ROUTES) {
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } });
const page = await ctx.newPage();
const allLogs = [];
page.on('pageerror', e => allLogs.push(`PAGEERROR: ${e.stack || e.message}`));
page.on('console', m => allLogs.push(m.text()));
await page.goto(BASE + route, { waitUntil: 'load', timeout: 30000 }).catch(()=>{});
await page.waitForTimeout(5000);
console.log(`\n########## ${route} ##########`);
for (let i = 0; i < allLogs.length; i++) {
const l = allLogs[i];
if (l.startsWith('CK_ERROR:') || l.startsWith('PAGEERROR')) {
console.log('--- ' + l.slice(0, 150));
if (allLogs[i+1] && allLogs[i+1].startsWith('CK_STACK:')) {
// 打印堆栈里所有 flutter_wisetronic 帧
const proj = allLogs[i+1].match(/flutter_wisetronic\/[^\s]+/g) || [];
console.log(' 项目帧: ' + (proj.length ? [...new Set(proj)].join('\n ') : '(无)'));
}
}
}
await ctx.close();
}
await browser.close();
})();