- 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.
35 lines
1.3 KiB
TypeScript
35 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");
|
|
}
|
|
|
|
/** User Profile Tests - Subuser via Username Login */
|
|
|
|
test("[PROFILE][Subuser][Username] should display profile section when logged in via username", async ({ page }) => {
|
|
await loginAsSubuserByUsername(page);
|
|
await goToUserProfile(page);
|
|
|
|
// Should display the driver/subuser profile section header
|
|
await expect(page.locator(".card-header").filter({ hasText: "Chauffør" }).first()).toBeVisible();
|
|
});
|
|
|
|
test("[PROFILE][Subuser][Username] should display contact section when logged in via username", async ({ page }) => {
|
|
await loginAsSubuserByUsername(page);
|
|
await goToUserProfile(page);
|
|
|
|
// Should display the contact information section header
|
|
await expect(page.locator(".card-header .fa-address-card")).toBeVisible();
|
|
});
|
|
|
|
test("[PROFILE][Subuser][Username] should display security section when logged in via username", async ({ page }) => {
|
|
await loginAsSubuserByUsername(page);
|
|
await goToUserProfile(page);
|
|
|
|
// Should display the security section header
|
|
await expect(page.locator(".card-header .fa-shield-alt")).toBeVisible();
|
|
});
|