test(ui): cover redesigned journeys and responsive shell
This commit is contained in:
@@ -17,16 +17,17 @@ test.beforeEach(async ({ page }) => {
|
||||
|
||||
test("all seven nav items navigate correctly", async ({ page }) => {
|
||||
const items: [string, RegExp][] = [
|
||||
["Dashboard", /\/dashboard$/],
|
||||
["Vehicles", /\/vehicles$/],
|
||||
["Overview", /\/dashboard$/],
|
||||
["Fleet", /\/vehicles$/],
|
||||
["Bookings", /\/bookings$/],
|
||||
["Data Quality", /\/data-quality$/],
|
||||
["Data quality", /\/data-quality$/],
|
||||
["Knowledge", /\/knowledge$/],
|
||||
["Automation", /\/automation$/],
|
||||
["Audit", /\/audit$/],
|
||||
["Integrations", /\/automation$/],
|
||||
["Audit trail", /\/audit$/],
|
||||
];
|
||||
const primaryNavigation = page.getByRole("navigation", { name: "Primary navigation" });
|
||||
for (const [label, urlPattern] of items) {
|
||||
await page.getByRole("link", { name: label }).click();
|
||||
await primaryNavigation.getByRole("link", { name: label, exact: true }).click();
|
||||
await expect(page).toHaveURL(urlPattern);
|
||||
}
|
||||
});
|
||||
@@ -123,7 +124,7 @@ test("audit page: action filter works", async ({ page }) => {
|
||||
await page.getByLabel("Action").fill("demo_login");
|
||||
await expect(page.locator(".data-table tbody tr").first()).toBeVisible();
|
||||
const actions = await page.locator(".data-table tbody tr td:nth-child(3)").allTextContents();
|
||||
expect(actions.every((a) => a.includes("demo_login"))).toBeTruthy();
|
||||
expect(actions.every((a) => a.includes("demo login"))).toBeTruthy();
|
||||
});
|
||||
|
||||
test("knowledge page: form submits and clears input", async ({ page }) => {
|
||||
@@ -146,7 +147,7 @@ test("rental employee role sees restricted automation page and cannot access res
|
||||
await page.getByRole("button", { name: "Switch role" }).click();
|
||||
await page.getByRole("button", { name: "Open as Rental Employee" }).click();
|
||||
await expect(page).toHaveURL(/\/dashboard$/);
|
||||
await page.getByRole("link", { name: "Automation" }).click();
|
||||
await page.getByRole("link", { name: "Integrations" }).click();
|
||||
await expect(
|
||||
page.getByText("Automation delivery status is visible to Operations Managers only."),
|
||||
).toBeVisible();
|
||||
|
||||
Reference in New Issue
Block a user