- BS-5: 仅 ctx 完全缺失时阻塞, 不再因 existingEnCodes.length===0 误报 (场景: 全删 form 后重建, AppContext 仍有但 list 空, 旧逻辑会无限循环阻断) - BS-47: 仅 dict typeCreate 命令触发, 不再在 menu create 时误判 (场景: menu enCode 与 form enCode 共享合法, 但 BS-47 把 form enCode 看作 dict 冲突) Co-Authored-By: Claude <[email protected]>
46 lines
1.8 KiB
JavaScript
46 lines
1.8 KiB
JavaScript
import { chromium } from 'playwright';
|
|
const browser = await chromium.launch({headless: true, args: ['--no-sandbox']});
|
|
const ctx = await browser.newContext({viewport: {width: 1440, height: 900}, locale: 'zh-CN'});
|
|
const page = await ctx.newPage();
|
|
|
|
await page.goto('http://nginx/jnpf_app_backend_tds2/login', {waitUntil: 'domcontentloaded', timeout: 30000});
|
|
await page.waitForTimeout(2000);
|
|
|
|
await page.fill('input[placeholder="请输入账号"]', 'admin');
|
|
await page.fill('input[placeholder="请输入密码"]', '123456');
|
|
await page.waitForTimeout(500);
|
|
await page.click('button:has-text("登 录")');
|
|
await page.waitForTimeout(4000);
|
|
|
|
console.log('after login URL:', page.url());
|
|
|
|
// if still on login, dump error
|
|
if (page.url().includes('login')) {
|
|
const errs = await page.$$eval('[class*="error"], [class*="err-message"]', els => els.map(e => e.innerText));
|
|
console.log('login errs:', errs);
|
|
const body = await page.innerText('body');
|
|
console.log('body:', body.substring(0, 500));
|
|
}
|
|
|
|
// now go to appMenu
|
|
await page.goto('http://nginx/jnpf_app_backend_tds2/appConfig/appMenu', {waitUntil: 'domcontentloaded', timeout: 30000});
|
|
await page.waitForTimeout(5000);
|
|
console.log('appMenu URL:', page.url());
|
|
console.log('TITLE:', await page.title());
|
|
|
|
await page.screenshot({path: '/tmp/tds2-backend-appMenu.png', fullPage: true});
|
|
|
|
const bodyText = await page.innerText('body');
|
|
console.log('--- BODY (first 3000) ---');
|
|
console.log(bodyText.substring(0, 3000));
|
|
|
|
// try to find table
|
|
const rows = await page.$$('.vxe-table .vxe-body--row, .ant-table-tbody tr, [class*="tree-node"]');
|
|
console.log('--- rows found:', rows.length);
|
|
if (rows.length > 0) {
|
|
const firstFew = await Promise.all(rows.slice(0, 5).map(r => r.innerText()));
|
|
console.log('first 5 rows:', firstFew);
|
|
}
|
|
|
|
await browser.close();
|