diff --git a/frontend/tests/functional/user-route.test.ts b/frontend/tests/functional/user-route.test.ts index 431d6e8a8..29e6c2ac3 100644 --- a/frontend/tests/functional/user-route.test.ts +++ b/frontend/tests/functional/user-route.test.ts @@ -20,7 +20,7 @@ test('user usual routine actions are working correctly', async ({ await test.step('user can create a domain', async () => { await sideBar.click('Organization', pages.foldersPage.url); - await expect(page).toHaveURL(pages.foldersPage.url); + await pages.foldersPage.hasUrl(); await pages.foldersPage.hasTitle(); await pages.foldersPage.createItem({ @@ -33,7 +33,7 @@ test('user usual routine actions are working correctly', async ({ await test.step('user can create a project', async () => { await sideBar.click('Organization', pages.projectsPage.url); - await expect(page).toHaveURL(pages.projectsPage.url); + await pages.projectsPage.hasUrl(); await pages.projectsPage.hasTitle(); await pages.projectsPage.createItem({ @@ -49,7 +49,7 @@ test('user usual routine actions are working correctly', async ({ await test.step('user can create an asset', async () => { await sideBar.click('Context', pages.assetsPage.url); - await expect(page).toHaveURL(pages.assetsPage.url); + await pages.assetsPage.hasUrl(); await pages.assetsPage.hasTitle(); await pages.assetsPage.createItem({ @@ -65,23 +65,23 @@ test('user usual routine actions are working correctly', async ({ await test.step('user can import a framework', async () => { await sideBar.click('Compliance', pages.frameworksPage.url); - await expect(page).toHaveURL(pages.frameworksPage.url); + await pages.frameworksPage.hasUrl(); await pages.frameworksPage.hasTitle(); await pages.frameworksPage.addButton.click(); - await expect(page).toHaveURL(pages.librariesPage.url); + await pages.librariesPage.hasTitle(); await pages.librariesPage.hasTitle(); await pages.librariesPage.importLibrary(vars.framework.name, vars.framework.urn); await sideBar.click('Compliance', pages.frameworksPage.url); - await expect(page).toHaveURL(pages.frameworksPage.url); + await pages.frameworksPage.hasUrl(); await expect(page.getByRole('row', { name: vars.framework.name })).toBeVisible(); }); await test.step('user can create a security function', async () => { await sideBar.click('Context', pages.securityFunctionsPage.url); - await expect(page).toHaveURL(pages.securityFunctionsPage.url); + await pages.securityFunctionsPage.hasUrl(); await pages.securityFunctionsPage.hasTitle(); await pages.securityFunctionsPage.createItem({ @@ -97,7 +97,7 @@ test('user usual routine actions are working correctly', async ({ await test.step('user can create a security measure', async () => { await sideBar.click('Context', pages.securityMeasuresPage.url); - await expect(page).toHaveURL(pages.securityMeasuresPage.url); + await pages.securityMeasuresPage.hasUrl(); await pages.securityMeasuresPage.hasTitle(); await pages.securityMeasuresPage.createItem({ @@ -117,7 +117,7 @@ test('user usual routine actions are working correctly', async ({ await test.step('user can create a compliance assessment', async () => { await sideBar.click('Compliance', pages.complianceAssessmentsPage.url); - await expect(page).toHaveURL(pages.complianceAssessmentsPage.url); + await pages.complianceAssessmentsPage.hasUrl(); await pages.complianceAssessmentsPage.hasTitle(); await pages.complianceAssessmentsPage.createItem({ @@ -135,7 +135,7 @@ test('user usual routine actions are working correctly', async ({ await test.step('user can create an evidence', async () => { await sideBar.click('Compliance', pages.evidencesPage.url); - await expect(page).toHaveURL(pages.evidencesPage.url); + await pages.evidencesPage.hasUrl(); await pages.evidencesPage.hasTitle(); await pages.evidencesPage.createItem({ @@ -155,23 +155,23 @@ test('user usual routine actions are working correctly', async ({ await test.step('user can import a risk matrix', async () => { await sideBar.click('Governance', pages.riskMatricesPage.url); - await expect(page).toHaveURL(pages.riskMatricesPage.url); + await pages.riskMatricesPage.hasUrl(); await pages.riskMatricesPage.hasTitle(); await pages.riskMatricesPage.addButton.click(); - await expect(page).toHaveURL(pages.librariesPage.url); + await pages.librariesPage.hasUrl(); await pages.librariesPage.hasTitle(); await pages.librariesPage.importLibrary(vars.matrix.name, vars.matrix.urn); await sideBar.click('Governance', pages.riskMatricesPage.url); - await expect(page).toHaveURL(pages.riskMatricesPage.url); + await pages.riskMatricesPage.hasUrl(); await expect(page.getByRole('row', { name: vars.matrix.displayName })).toBeVisible(); }); await test.step('user can create a risk assessment', async () => { await sideBar.click('Risk', pages.riskAssessmentsPage.url); - await expect(page).toHaveURL(pages.riskAssessmentsPage.url); + await pages.riskAssessmentsPage.hasUrl(); await pages.riskAssessmentsPage.hasTitle(); await pages.riskAssessmentsPage.createItem({ @@ -189,7 +189,7 @@ test('user usual routine actions are working correctly', async ({ await test.step('user can create a threat', async () => { await sideBar.click('Context', pages.threatsPage.url); - await expect(page).toHaveURL(pages.threatsPage.url); + await pages.threatsPage.hasUrl(); await pages.threatsPage.hasTitle(); await pages.threatsPage.createItem({ @@ -204,7 +204,7 @@ test('user usual routine actions are working correctly', async ({ await test.step('user can create a risk scenario', async () => { await sideBar.click('Risk', pages.riskScenariosPage.url); - await expect(page).toHaveURL(pages.riskScenariosPage.url); + await pages.riskScenariosPage.hasUrl(); await pages.riskScenariosPage.hasTitle(); await pages.riskScenariosPage.createItem({ @@ -219,7 +219,7 @@ test('user usual routine actions are working correctly', async ({ await test.step('user can create a risk acceptance', async () => { await sideBar.click('Risk', pages.riskAcceptancesPage.url); - await expect(page).toHaveURL(pages.riskAcceptancesPage.url); + await pages.riskAcceptancesPage.hasUrl(); await pages.riskAcceptancesPage.hasTitle(); await pages.riskAcceptancesPage.createItem({ @@ -236,7 +236,7 @@ test('user usual routine actions are working correctly', async ({ await test.step('user can add another user', async () => { await sideBar.click('Organization', pages.usersPage.url); - await expect(page).toHaveURL(pages.usersPage.url); + await pages.usersPage.hasUrl(); await pages.usersPage.hasTitle(); await pages.usersPage.createItem({ @@ -249,13 +249,11 @@ test('user usual routine actions are working correctly', async ({ test.afterEach('cleanup', async ({ foldersPage, usersPage, page }) => { await foldersPage.goto(); - await page.waitForURL(foldersPage.url); await foldersPage.deleteItemButton(vars.folderName).click(); await foldersPage.deleteModalConfirmButton.click(); await expect(foldersPage.getRow(vars.folderName)).not.toBeVisible(); await usersPage.goto(); - await page.waitForURL(usersPage.url); await usersPage.deleteItemButton(vars.user.email).click(); await usersPage.deleteModalConfirmButton.click(); await expect(usersPage.getRow(vars.user.email)).not.toBeVisible();