mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 06:06:11 +02:00
♻️ Refactor LoginPage POM
This commit is contained in:
parent
127c47a35a
commit
9fd9e0178e
5 changed files with 53 additions and 71 deletions
|
@ -1,8 +1,8 @@
|
|||
import { BasePage } from "./BasePage";
|
||||
|
||||
export class LoginPage extends BasePage {
|
||||
static setupLoggedOutUser(page) {
|
||||
return this.mockRPC(page, "get-profile", "get-profile-anonymous.json");
|
||||
static async initWithLoggedOutUser(page) {
|
||||
await BasePage.mockRPC(page, "get-profile", "get-profile-anonymous.json");
|
||||
}
|
||||
|
||||
constructor(page) {
|
||||
|
@ -10,8 +10,8 @@ export class LoginPage extends BasePage {
|
|||
this.loginButton = page.getByRole("button", { name: "Login" });
|
||||
this.password = page.getByLabel("Password");
|
||||
this.userName = page.getByLabel("Email");
|
||||
this.message = page.getByText("Email or password is incorrect");
|
||||
this.badLoginMsg = page.getByText("Enter a valid email please");
|
||||
this.invalidCredentialsError = page.getByText("Email or password is incorrect");
|
||||
this.invalidEmailError = page.getByText("Enter a valid email please");
|
||||
this.initialHeading = page.getByRole("heading", { name: "Log into my account" });
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ export class LoginPage extends BasePage {
|
|||
await this.loginButton.click();
|
||||
}
|
||||
|
||||
async setupAllowedUser() {
|
||||
async setupLoggedInUser() {
|
||||
await this.mockRPC("get-profile", "logged-in-user/get-profile-logged-in.json");
|
||||
await this.mockRPC("get-teams", "logged-in-user/get-teams-default.json");
|
||||
await this.mockRPC("get-font-variants?team-id=*", "logged-in-user/get-font-variants-empty.json");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue