test: write login page tests

This commit is contained in:
Ali BARIN
2023-08-27 19:10:48 +00:00
parent cac54c41a1
commit 4d4091adcc
4 changed files with 51 additions and 7 deletions

View File

@@ -17,13 +17,18 @@ export class LoginPage extends BasePage {
this.loginButton = this.page.getByTestId('login-button');
}
async login() {
async open() {
return await this.page.goto(this.path);
}
async login(
email = process.env.LOGIN_EMAIL,
password = process.env.LOGIN_PASSWORD
) {
await this.page.goto(this.path);
await this.emailTextField.fill(process.env.LOGIN_EMAIL);
await this.passwordTextField.fill(process.env.LOGIN_PASSWORD);
await this.emailTextField.fill(email);
await this.passwordTextField.fill(password);
await this.loginButton.click();
await expect(this.loginButton).not.toBeVisible();
}
}