- Introduced `.prettierrc.json` to enforce consistent code formatting across the project. - Updated unit and e2e test files to address formatting issues, improve readability, and ensure alignment with the new Prettier configuration.
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
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();
|
|
});
|