This repository has been archived on 2025-04-22. You can view files and clone it, but cannot push or open issues or pull requests.
playwright-demo/tests/hlk/pom/h5LoginPage.js
2024-10-21 18:03:30 +08:00

20 lines
702 B
JavaScript

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 };