From 97f24848100f11526487e4e2b24b1d84fc435f50 Mon Sep 17 00:00:00 2001 From: andrzejewsky Date: Wed, 3 Jan 2024 09:29:31 +0100 Subject: [PATCH] Fix base url --- playwright/data/url.ts | 1 + playwright/pages/homePage.ts | 3 ++- playwright/tests/auth.setup.ts | 3 ++- playwright/tests/home.spec.ts | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/playwright/data/url.ts b/playwright/data/url.ts index 364a86a54c7..0657fc7927f 100644 --- a/playwright/data/url.ts +++ b/playwright/data/url.ts @@ -1,4 +1,5 @@ export const URL_LIST = { + home: "", addProduct: "products/add", addPageType: "pages/add?page-type-id=", apps: "custom-apps/", diff --git a/playwright/pages/homePage.ts b/playwright/pages/homePage.ts index c9e2689a758..5ab00c21051 100644 --- a/playwright/pages/homePage.ts +++ b/playwright/pages/homePage.ts @@ -1,3 +1,4 @@ +import { URL_LIST } from "@data/url"; import { expect, Locator, Page } from "@playwright/test"; export class HomePage { @@ -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() { diff --git a/playwright/tests/auth.setup.ts b/playwright/tests/auth.setup.ts index a9947b65751..f0cc72ee3e5 100644 --- a/playwright/tests/auth.setup.ts +++ b/playwright/tests/auth.setup.ts @@ -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"; @@ -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 diff --git a/playwright/tests/home.spec.ts b/playwright/tests/home.spec.ts index 23a3278e134..1f10bf47675 100644 --- a/playwright/tests/home.spec.ts +++ b/playwright/tests/home.spec.ts @@ -1,3 +1,4 @@ +import { URL_LIST } from "@data/url"; import { HomePage } from "@pages/homePage"; import { expect, test } from "@playwright/test"; @@ -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();