From a5ddabe928904b392b4131aeb8d82eb60b4df265 Mon Sep 17 00:00:00 2001 From: Alexis Date: Tue, 13 Feb 2024 22:48:08 +0100 Subject: [PATCH] fix failing tests because of loading evidences attachment --- frontend/package-lock.json | 2 +- frontend/tests/functional/detailed/common.test.ts | 4 ++++ frontend/tests/functional/nav.test.ts | 6 +++--- frontend/tests/functional/user-route.test.ts | 1 - frontend/tests/utils/test-utils.ts | 3 --- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 7b8619e3d..c2d5fccdb 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -17,7 +17,7 @@ }, "devDependencies": { "@inlang/paraglide-js": "1.2.5", - "@playwright/test": "^1.28.1", + "@playwright/test": "^1.40.1", "@skeletonlabs/skeleton": "^2.3.0", "@skeletonlabs/tw-plugin": "^0.2.2", "@sveltejs/adapter-auto": "^3.0.0", diff --git a/frontend/tests/functional/detailed/common.test.ts b/frontend/tests/functional/detailed/common.test.ts index 097005a24..8d560e304 100644 --- a/frontend/tests/functional/detailed/common.test.ts +++ b/frontend/tests/functional/detailed/common.test.ts @@ -37,6 +37,10 @@ for (const key of testPages) { setHttpResponsesListener(page); + if (await pages[key].getRow("loading").first().isVisible()) { + await pages[key].getRow("loading").first().waitFor({state: 'hidden'}); + } + await pages[key].createItem(items[key].build, "dependency" in items[key] ? items[key].dependency : null); if (await pages[key].getRow(items[key].build.name).isHidden()) { diff --git a/frontend/tests/functional/nav.test.ts b/frontend/tests/functional/nav.test.ts index 21628a498..618370fcc 100644 --- a/frontend/tests/functional/nav.test.ts +++ b/frontend/tests/functional/nav.test.ts @@ -4,12 +4,12 @@ type StringMap = { [key: string]: string; }; -test('sidebar navigation tests', async ({ logedPage, analyticsPage: overviewPage, sideBar, page }) => { +test('sidebar navigation tests', async ({ logedPage, analyticsPage, sideBar, page }) => { test.slow(); await test.step('proper redirection to the overview page after login', async () => { - await overviewPage.hasUrl(); - await overviewPage.hasTitle(); + await analyticsPage.hasUrl(); + await analyticsPage.hasTitle(); setHttpResponsesListener(page); }); diff --git a/frontend/tests/functional/user-route.test.ts b/frontend/tests/functional/user-route.test.ts index 3a6f56a51..ed9e4425a 100644 --- a/frontend/tests/functional/user-route.test.ts +++ b/frontend/tests/functional/user-route.test.ts @@ -137,7 +137,6 @@ test('user usual routine actions are working correctly', async ({ logedPage, pag description: vars.description, attachment: vars.file, folder: vars.folderName, - security_measures: [vars.securityMeasureName], requirement_assessments: [ vars.requirement_assessment.name, vars.requirement_assessment2.name diff --git a/frontend/tests/utils/test-utils.ts b/frontend/tests/utils/test-utils.ts index 27c7266ef..c4bcf284e 100644 --- a/frontend/tests/utils/test-utils.ts +++ b/frontend/tests/utils/test-utils.ts @@ -69,8 +69,6 @@ export const test = base.extend({ { name: 'description', type: type.TEXT }, { name: 'attachment', type: type.FILE }, { name: 'folder', type: type.SELECT_AUTOCOMPLETE }, - { name: 'security_measures', type: type.SELECT_MULTIPLE_AUTOCOMPLETE }, - { name: 'requirement_assessments', type: type.SELECT_MULTIPLE_AUTOCOMPLETE }, { name: 'link', type: type.TEXT }, ]); await use(ePage); @@ -396,7 +394,6 @@ export class TestContent { description: vars.description, attachment: vars.file, folder: vars.folderName, - security_measures: [vars.securityMeasureName], requirement_assessments: [ vars.requirement_assessment.name, vars.requirement_assessment2.name