23 lines
799 B
JavaScript
23 lines
799 B
JavaScript
const { expect } = require('@playwright/test');
|
|
class TouchLoginPage {
|
|
constructor(page) {
|
|
this.page = page;
|
|
this.$account = this.page.getByRole('textbox', { name: '请输入您的手机号码' });
|
|
this.$password = this.page.getByRole('textbox', { name: '请输入登录密码' });
|
|
this.$loginBtn = this.page.getByRole('button', { name: /登\s录/ });
|
|
}
|
|
|
|
login = async (account, password) => {
|
|
await this.$account.fill(account);
|
|
const phoneStatsIcon = this.page
|
|
.locator('.ant-row', { has: this.$account })
|
|
.locator('.pass_svg');
|
|
await this.$password.fill(password);
|
|
await this.page.getByLabel('请同意慧来客隐私政策和用户协议').check();
|
|
await expect(phoneStatsIcon).toBeVisible();
|
|
await this.$loginBtn.click();
|
|
};
|
|
}
|
|
|
|
module.exports = { TouchLoginPage };
|