class H5LoginPage { constructor(page) { this.page = page; this.$account = this.page.locator('.input', { hasText: '请输入手机号码' }).locator('input'); this.$SMSCode = this.page.locator('.input', { hasText: '请输入验证码' }).locator('input'); this.$loginBtn = this.page.locator('uni-button').filter({ hasText: /^登录$/ }); } login = async (account) => { await this.page.locator('.login_btn').click(); await this.$account.click(); await this.$account.fill(account); await this.$SMSCode.fill(process.env.SMSCODE); await this.page.getByText('同意隐私协议').click(); await this.$loginBtn.click(); }; } module.exports = { H5LoginPage };