Files
flutter_wisetronic/tools/e2e/probe4.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

28 lines
1.2 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.

const { chromium } = require('playwright');
const BASE = 'http://127.0.0.1:8099';
(async () => {
const browser = await chromium.launch({ headless: true });
const page = await (await browser.newContext({ viewport: { width: 1280, height: 900 } })).newPage();
await page.goto(BASE + '/login', { waitUntil: 'load', timeout: 60000 });
await page.waitForTimeout(5000);
// JS 直接触发 placeholder click绕过 viewport 限制)
await page.evaluate(() => {
const el = document.querySelector('flt-semantics-placeholder');
if (el) el.click();
});
await page.waitForTimeout(4000);
const textbox = await page.locator('[role="textbox"]').count();
const input = await page.locator('input').count();
console.log(`JS click 后: role=textbox=${textbox}, input=${input}`);
const labels = await page.evaluate(() =>
[...document.querySelectorAll('[role="textbox"],[role="button"]')]
.map(e => ({ role: e.getAttribute('role'), label: e.getAttribute('aria-label') }))
.filter(x => x.label && x.label.length < 50).slice(0, 30)
);
console.log('labels:', JSON.stringify(labels));
await browser.close();
})().catch(e => { console.error('失败:', e.message); process.exit(1); });