Skip to content

Commit

Permalink
Fix base url
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejewsky committed Jan 3, 2024
1 parent 20ad97d commit 97f2484
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions playwright/data/url.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const URL_LIST = {
home: "",
addProduct: "products/add",
addPageType: "pages/add?page-type-id=",
apps: "custom-apps/",
Expand Down
3 changes: 2 additions & 1 deletion playwright/pages/homePage.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { URL_LIST } from "@data/url";
import { expect, Locator, Page } from "@playwright/test";

export class HomePage {
Expand Down Expand Up @@ -27,7 +28,7 @@ export class HomePage {
this.productsOutOfStock = page.getByTestId("out-of-stock-analytics");
}
async goto() {
await this.page.goto("/");
await this.page.goto(URL_LIST.home);
}

async clickChannelSelectButton() {
Expand Down
3 changes: 2 additions & 1 deletion playwright/tests/auth.setup.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { URL_LIST } from "@data/url";
import { USER_PERMISSION } from "@data/userPermissions";
import { LoginPage } from "@pages/loginPage";
import { test as setup } from "@playwright/test";
Expand Down Expand Up @@ -32,7 +33,7 @@ setup("authenticate as admin", async ({ page }) => {
});
setup("unauthenticated user ", async ({ page }) => {
const loginPage = await new LoginPage(page);
await page.goto("/");
await page.goto(URL_LIST.home);
await loginPage.resetPasswordLink.waitFor({ state: "visible" });
// End of authentication steps.
await page
Expand Down
3 changes: 2 additions & 1 deletion playwright/tests/home.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { URL_LIST } from "@data/url";
import { HomePage } from "@pages/homePage";
import { expect, test } from "@playwright/test";

Expand All @@ -8,7 +9,7 @@ test("TC: SALEOR_29 Correct information on dashboard home page @e2e", async ({
}) => {
const homePage = new HomePage(page);

await page.goto("/");
await page.goto(URL_LIST.home);
await expect(homePage.channelSelect).toBeVisible({ timeout: 10000 });

await homePage.expectHomePageElementsToBeVisible();
Expand Down

0 comments on commit 97f2484

Please sign in to comment.