Skip to content

Commit

Permalink
fix dashboard path
Browse files Browse the repository at this point in the history
  • Loading branch information
wojteknowacki committed Nov 20, 2023
1 parent 10cac48 commit 783c95f
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions playwright/pages/loginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,15 @@ export class LoginPage {
page: Page,
path: string,
) {
await this.goto();
await this.page.goto(process.env.BASE_URL!);
await this.typeEmail(userEmail);
await this.typePassword(userPassword);
await this.clickSignInButton();
await expect(this.homePage.welcomeMessage).toContainText("Hello there,");
// End of authentication steps.
await page.context().storageState({ path });
}
async basicUiLogin(userEmail: string, userPassword: string) {
await this.goto();
await this.typeEmail(userEmail);
await this.typePassword(userPassword);
await this.clickSignInButton();
await expect(this.homePage.welcomeMessage).toContainText("Hello there,");
}

async typeEmail(email: string) {
await this.emailInput.fill(email);
}
Expand All @@ -61,12 +55,4 @@ export class LoginPage {
async clickSignInButton() {
await this.signInButton.click();
}
async goto() {
const BASE_URL = process.env.BASE_URL!;
const loginPageUrl =
BASE_URL === "http://localhost:9000/"
? "http://localhost:9000/"
: "/dashboard";
await this.page.goto(loginPageUrl);
}
}

0 comments on commit 783c95f

Please sign in to comment.