diff --git a/portal-ui/tests/permissions-2/inspect.ts b/portal-ui/tests/permissions-2/inspect.ts index bd66ca627..a975be618 100644 --- a/portal-ui/tests/permissions-2/inspect.ts +++ b/portal-ui/tests/permissions-2/inspect.ts @@ -17,7 +17,7 @@ import { Role, Selector } from "testcafe"; import { readFileSync } from "fs"; import { IAM_PAGES } from "../../src/common/SecureComponent/permissions"; -import { monitoringElement } from "../utils/elements-menu"; +import { inspectElement, monitoringElement } from "../utils/elements-menu"; const data = readFileSync(__dirname + "/../constants/timestamp.txt", "utf-8"); const $TIMESTAMP = data.trim(); @@ -96,7 +96,7 @@ test("Inspect page can be opened", async (t) => { }); test("Inspect link exists in Menu list", async (t) => { - await t.expect(inspectEl.exists).ok(); + await t.useRole(inspectAllowedRole).expect(inspectElement.exists).ok(); }); test("Form Input states verification", async (t) => { diff --git a/portal-ui/tests/utils/elements-menu.ts b/portal-ui/tests/utils/elements-menu.ts index 8453c4e81..1ed73ab23 100644 --- a/portal-ui/tests/utils/elements-menu.ts +++ b/portal-ui/tests/utils/elements-menu.ts @@ -91,5 +91,9 @@ export const performanceElement = Selector(".MuiPaper-root") export const profileElement = Selector(".MuiPaper-root") .find("ul") .child("#profile"); +export const inspectElement = sidebarItem.withAttribute( + "href", + "/support/inspect" +); export const licenseElement = sidebarItem.withAttribute("href", "/license");