From 4a9975fb858b49165e18dc7ba57c5e3a3eb9ea0a Mon Sep 17 00:00:00 2001 From: "LAPTOP-S0QU96IH\\david" Date: Mon, 11 Dec 2023 22:39:03 +0100 Subject: [PATCH] clean ups and improve paths --- frontend/testing/.eslintignore | 1 - frontend/testing/playwright/helpers/Routes.ts | 2 +- frontend/testing/playwright/helpers/routeUtils.ts | 3 --- .../testing/playwright/{ => integration}/altinnStudio.spec.ts | 0 frontend/testing/playwright/{Pages => pages}/LoginPage.ts | 2 +- .../testing/playwright/playwright.config.ts | 2 +- package.json | 2 +- 7 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 frontend/testing/.eslintignore delete mode 100644 frontend/testing/playwright/helpers/routeUtils.ts rename frontend/testing/playwright/{ => integration}/altinnStudio.spec.ts (100%) rename frontend/testing/playwright/{Pages => pages}/LoginPage.ts (95%) rename playwright.config.ts => frontend/testing/playwright/playwright.config.ts (93%) diff --git a/frontend/testing/.eslintignore b/frontend/testing/.eslintignore deleted file mode 100644 index 72e8ffc0db8..00000000000 --- a/frontend/testing/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/frontend/testing/playwright/helpers/Routes.ts b/frontend/testing/playwright/helpers/Routes.ts index 043be1b1eb9..653e38e2827 100644 --- a/frontend/testing/playwright/helpers/Routes.ts +++ b/frontend/testing/playwright/helpers/Routes.ts @@ -1,4 +1,4 @@ export class Routes { - public readonly loginPage: string = "/"; + public readonly altinnLoginPage: string = "/"; public readonly dashboard: string = "/dashboard"; } diff --git a/frontend/testing/playwright/helpers/routeUtils.ts b/frontend/testing/playwright/helpers/routeUtils.ts deleted file mode 100644 index ece793532da..00000000000 --- a/frontend/testing/playwright/helpers/routeUtils.ts +++ /dev/null @@ -1,3 +0,0 @@ -export enum Routes { - Root = '/' -} diff --git a/frontend/testing/playwright/altinnStudio.spec.ts b/frontend/testing/playwright/integration/altinnStudio.spec.ts similarity index 100% rename from frontend/testing/playwright/altinnStudio.spec.ts rename to frontend/testing/playwright/integration/altinnStudio.spec.ts diff --git a/frontend/testing/playwright/Pages/LoginPage.ts b/frontend/testing/playwright/pages/LoginPage.ts similarity index 95% rename from frontend/testing/playwright/Pages/LoginPage.ts rename to frontend/testing/playwright/pages/LoginPage.ts index 8486144837a..2497fd78003 100644 --- a/frontend/testing/playwright/Pages/LoginPage.ts +++ b/frontend/testing/playwright/pages/LoginPage.ts @@ -9,7 +9,7 @@ export class LoginPage extends BasePage { } public async goToAltinnLoginPage(): Promise { - await this._page.goto(this.loginPage); + await this._page.goto(this.altinnLoginPage); } public async goToGiteaLoginPage(): Promise { diff --git a/playwright.config.ts b/frontend/testing/playwright/playwright.config.ts similarity index 93% rename from playwright.config.ts rename to frontend/testing/playwright/playwright.config.ts index 1e0721a32bd..e02a69b5d7f 100644 --- a/playwright.config.ts +++ b/frontend/testing/playwright/playwright.config.ts @@ -4,7 +4,7 @@ import { config } from 'dotenv'; config(); export default defineConfig({ - testDir: './frontend/testing/playwright', + testDir: './integration', fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, diff --git a/package.json b/package.json index 50315cf1c5d..26eedd82dbc 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "test": "jest --maxWorkers=50% --config=frontend/jest.config.js", "test:ci": "jest --ci --coverage --max-workers=2 --cacheDirectory=$(yarn config get cacheFolder) --config=frontend/jest.config.js", "typecheck": "yarn workspaces foreach -A run typecheck", - "playwright-e2e": "playwright test" + "playwright-e2e": "playwright test --config ./frontend/testing/playwright/playwright.config.ts" }, "syncpack": { "semverRange": ""