/** * 个人中心页 Page Object */ class ProfilePage { 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 getMemberInfo() { const page = await this.mp.currentPage(); const data = await page.data(); return data; } async containsText(text) { const page = await this.mp.currentPage(); const wxml = await page.wxml(); return wxml.includes(text); } } module.exports = { ProfilePage };