Files
QaAutomationHub/tests/web/mini_program/automator/pages/home_page.js
T
xst b822428a2a 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
2026-07-15 17:34:25 +08:00

31 lines
791 B
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.
/** 小程序 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 };