feat(mini_program): 小程序端从 Playwright 切换为 miniprogram-automator

驱动方式: Python pytest → subprocess → node runner.js → miniprogram-automator → 微信开发者工具
架构: tests/web/mini_program/automator/ (Node.js) + conftest.py (Python subprocess 桥接)

前置条件: 微信开发者工具 + 开启服务端口 + npm install + uni-app build:mp-weixin
This commit is contained in:
xst
2026-07-15 17:34:25 +08:00
parent 03e152baab
commit b822428a2a
9 changed files with 393 additions and 112 deletions
@@ -0,0 +1,30 @@
/** 小程序 Page ObjectNode 版)— 首页 */
class HomePage {
constructor(miniProgram) {
this.mp = miniProgram;
}
async goToOrderList() {
const page = await this.mp.currentPage();
const el = await page.$(".order-entry, .order-item");
if (el) await el.tap();
await this.mp.waitFor(1000);
}
async goToMine() {
const page = await this.mp.currentPage();
const el = await page.$(".mine-tab, .my-entry");
if (el) await el.tap();
await this.mp.waitFor(1000);
}
async screenshot(name) {
const path = require("path");
const file = path.resolve(__dirname, `../../../../output/screenshots/mini_program/${name}_${Date.now()}.png`);
await this.mp.screenshot({ path: file });
return file;
}
}
module.exports = { HomePage };