diff --git a/frontend/tests/functional/detailed/common.test.ts b/frontend/tests/functional/detailed/common.test.ts index a078d399f..da8fc6ae3 100644 --- a/frontend/tests/functional/detailed/common.test.ts +++ b/frontend/tests/functional/detailed/common.test.ts @@ -74,7 +74,6 @@ for (const key of testPages) { page }) => { await pages[key].itemDetail.verifyItem(items[key].build); - await pages[key].checkForUndefinedText(); page.url().includes('evidences') ? await pages[key].page.waitForTimeout(1000) : null; // prevent crashing }); diff --git a/frontend/tests/functional/detailed/login.test.ts b/frontend/tests/functional/detailed/login.test.ts index f41c56aa3..f72a3e752 100644 --- a/frontend/tests/functional/detailed/login.test.ts +++ b/frontend/tests/functional/detailed/login.test.ts @@ -18,7 +18,6 @@ test('login / logout process is working properly', async ({ }) => { await loginPage.hasUrl(1); await expect.soft(page.getByTestId('login')).toBeVisible(); - await loginPage.checkForUndefinedText(); await loginPage.login(); await analyticsPage.hasUrl(); await sideBar.logout(); diff --git a/frontend/tests/functional/nav.test.ts b/frontend/tests/functional/nav.test.ts index ac1e9293a..84eb33b1f 100644 --- a/frontend/tests/functional/nav.test.ts +++ b/frontend/tests/functional/nav.test.ts @@ -42,19 +42,18 @@ test('sidebar navigation tests', async ({ logedPage, analyticsPage, sideBar, pag await test.step('user profile panel is working properly', async () => { await sideBar.moreButton.click(); await expect(sideBar.morePanel).not.toHaveAttribute('inert'); - await logedPage.checkForUndefinedText(); + await expect(sideBar.profileButton).toBeVisible(); await sideBar.profileButton.click(); await expect(sideBar.morePanel).not.toBeVisible(); await expect(page).toHaveURL('/my-profile'); await expect.soft(logedPage.pageTitle).toHaveText('My profile'); - await logedPage.checkForUndefinedText(); }); await test.step('docs button is working properly and redirects to gitbook docs', async () => { await sideBar.moreButton.click(); await expect(sideBar.morePanel).not.toHaveAttribute('inert'); - await logedPage.checkForUndefinedText(); + await expect(sideBar.docsButton).toBeVisible(); }); @@ -79,13 +78,13 @@ test('sidebar navigation tests', async ({ logedPage, analyticsPage, sideBar, pag await test.step('about panel is working properly', async () => { await sideBar.moreButton.click(); await expect(sideBar.morePanel).not.toHaveAttribute('inert'); - await logedPage.checkForUndefinedText(); + await expect(sideBar.aboutButton).toBeVisible(); await sideBar.aboutButton.click(); await expect(sideBar.morePanel).toHaveAttribute('inert'); await expect(logedPage.modalTitle).toBeVisible(); await expect.soft(logedPage.modalTitle).toHaveText('About CISO Assistant'); - await logedPage.checkForUndefinedText(); + await expect(logedPage.page.getByTestId('version-key')).toContainText('version', { ignoreCase: true }); diff --git a/frontend/tests/utils/base-page.ts b/frontend/tests/utils/base-page.ts index 0a6505446..e01187883 100644 --- a/frontend/tests/utils/base-page.ts +++ b/frontend/tests/utils/base-page.ts @@ -41,12 +41,6 @@ export abstract class BasePage { } } - async checkForUndefinedText() { - await expect - .soft(this.page.getByText('undefined'), 'An undefined text is visible on the page') - .toHaveCount(0); - } - async waitUntilLoaded() { const loadingFields = this.page.getByTestId('loading-field'); if ((await loadingFields.count()) > 0) {