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); }