Files
kenyanghui 171003556d aiinvite2.1: 拆约(原邀悦圈)小程序 + Express/SQLite 后端
- wechat-miniprogram: 原生小程序,品牌化拆约+玄龙logo,API 指向 https://xhermes.aibay.asia
- yaoyue-sever: Express 单文件 server.js + better-sqlite3,GLM glm-5.3-flash(thinking disabled)
- 排除 node_modules/.env/*.db
2026-11-11 23:25:28 +08:00

37 lines
1.2 KiB
JavaScript

const automator = require('miniprogram-automator');
(async () => {
const mp = await automator.connect({ wsEndpoint: 'ws://127.0.0.1:9420' });
await mp.reLaunch('/pages/home/index');
await new Promise(r => setTimeout(r, 4000));
let pg = await mp.currentPage();
console.log('1. page:', pg.path);
let d = await pg.data();
console.log('2. data OK');
// screenshot
await mp.screenshot({ path: 'D:/codeProject/邀约-ClaudeCode开发/yao-yue-app/wechat-miniprogram/test/screenshots/debug-sc.png' });
console.log('3. screenshot done');
// A: old reference
try {
const items = await pg.$$('.tab-item');
console.log('4a. old ref $$ result:', items.length);
} catch(e) { console.log('4a. old ref error:', e.message); }
// B: new currentPage
try {
const pg2 = await mp.currentPage();
const d2 = await pg2.data();
console.log('4b. new page data OK, path:', pg2.path);
const items = await pg2.$$('.tab-item');
console.log('4c. new ref $$ result:', items.length);
} catch(e) { console.log('4b/c error:', e.message); }
await mp.disconnect();
console.log('done');
process.exit(0);
})().catch(e => { console.error('FATAL:', e.message); process.exit(1); });