From 9dc9c351e4babd86d081b73eb2934c82fbe1a62f Mon Sep 17 00:00:00 2001 From: Mohamed-Hacene Date: Wed, 8 Jan 2025 14:43:49 +0100 Subject: [PATCH] ci: update hasUrl() --- frontend/tests/functional/user-route.test.ts | 2 +- frontend/tests/utils/base-page.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/tests/functional/user-route.test.ts b/frontend/tests/functional/user-route.test.ts index 77afaba71..d97644515 100644 --- a/frontend/tests/functional/user-route.test.ts +++ b/frontend/tests/functional/user-route.test.ts @@ -163,7 +163,7 @@ test('user usual routine actions are working correctly', async ({ await pages.riskMatricesPage.hasTitle(); await pages.riskMatricesPage.addButton.click(); - await pages.librariesPage.hasUrl(); + await pages.librariesPage.hasUrl("/libraries?objectType=risk_matrix"); await pages.librariesPage.hasTitle(); await pages.librariesPage.importLibrary(vars.matrix.name, vars.matrix.urn); diff --git a/frontend/tests/utils/base-page.ts b/frontend/tests/utils/base-page.ts index 7c38547e4..f33b59e60 100644 --- a/frontend/tests/utils/base-page.ts +++ b/frontend/tests/utils/base-page.ts @@ -46,8 +46,8 @@ export abstract class BasePage { * Otherwise, it checks if the browser's URL starts with `this.url`. * @returns {void} */ - async hasUrl(strict: boolean = true) { - const URLPattern = strict ? this.url : new RegExp(escapeRegex(this.url) + '.*'); + async hasUrl(url: string = this.url, strict: boolean = true) { + const URLPattern = strict ? url : new RegExp(escapeRegex(url) + '.*'); await expect(this.page).toHaveURL(URLPattern); }