增加 后端,后台管理系统,uniapp会员端的自动化测试。

This commit is contained in:
2026-07-21 18:09:29 +08:00
parent df0e68469b
commit 6b60b3b4da
64 changed files with 13095 additions and 376 deletions
@@ -0,0 +1,53 @@
/**
* 课程详情页 Page Object
*/
class CourseDetailPage {
constructor(miniProgram) {
this.mp = miniProgram;
}
async waitForReady() {
const page = await this.mp.currentPage();
await page.waitFor(2000);
console.log('课程详情页加载完成');
}
async getPath() {
const page = await this.mp.currentPage();
return page.path;
}
/**
* 点击预约按钮
*/
async clickBook() {
const page = await this.mp.currentPage();
const bookBtn = await page.$('.booking-btn');
if (bookBtn) {
// 检查按钮是否禁用
const disabled = await bookBtn.attribute('disabled');
if (disabled === 'true' || disabled === 'disabled') {
console.log('预约按钮已禁用(课程不可预约)');
return false;
}
await bookBtn.tap();
console.log('点击预约按钮');
return true;
}
console.log('未找到预约按钮');
return false;
}
async containsText(text) {
const page = await this.mp.currentPage();
const wxml = await page.wxml();
return wxml.includes(text);
}
async getPageData() {
const page = await this.mp.currentPage();
return await page.data();
}
}
module.exports = { CourseDetailPage };