import { test, expect } from "@playwright/test"; import { userCredentials, loginAsSubuserByUsername } from "./fixtures"; // Navigate to profile page helper async function goToUserProfile(page) { await page.click('a[href="/user/profile"]'); await expect(page).toHaveURL("/user/profile"); } // Subuser grant selection display tests test("[PROFILE][Subuser][Grant] should display customer selection section", async ({ page }) => { await loginAsSubuserByUsername(page); await goToUserProfile(page); // Should display the customer selection section header (look for users icon) await expect(page.locator(".card-header .fa-users")).toBeVisible(); }); test("[PROFILE][Subuser][Grant] should display customer switch help text", async ({ page }) => { await loginAsSubuserByUsername(page); await goToUserProfile(page); // Expand grant section (with users icon) const grantHeader = page.locator(".card-header").filter({ has: page.locator(".fa-users") }); await grantHeader.click(); await page.waitForTimeout(200); // Should display help text for customer switching (inside the expanded card with users icon) const grantCard = page.locator(".card").filter({ has: page.locator(".fa-users") }); const helpText = grantCard.locator(".card-content .help"); await expect(helpText).toBeVisible(); });