Files
pleno-vue/tests/e2e/userVehicles.spec.ts
T
Jeppe Bundgaard ade565cbca Introduce completeBookingCreationFlow utility and refactor booking flow tests:
- Added `completeBookingCreationFlow` utility to streamline booking creation logic in `bookingFlow.ts`.
- Refactored `userBookings.spec.ts` to replace inline booking creation steps with the new utility for improved readability and consistency.
- Applied `data-testid` attributes across booking-related components for enhanced testability and test coverage.
- Enhanced Playwright navigation error handling with `isBenignNavigationError` and `settleAuthenticatedNavigation` utilities to improve resilience and test robustness.
2026-04-13 13:39:48 +02:00

23 lines
937 B
TypeScript

import { expect, test } from "@playwright/test";
import { loginAsUser } from "./fixtures";
test("[PAGES][User][/user/vehicles] shows the current vehicles overview shell", async ({ page }) => {
await loginAsUser(page);
await page.goto("/user/vehicles");
await expect(page.getByTestId("user-vehicles-add")).toBeVisible();
await expect(page.getByTestId("user-vehicles-table")).toBeVisible();
});
test("[PAGES][User][/user/vehicles] opens the add-vehicle dialog", async ({ page }) => {
await loginAsUser(page);
await page.goto("/user/vehicles");
await page.getByTestId("user-vehicles-add").click();
const dialog = page.getByRole("dialog");
await expect(dialog).toBeVisible();
await expect(dialog.getByRole("heading", { name: /opret/i })).toBeVisible();
await expect(dialog.getByRole("button", { name: /gem/i })).toBeVisible();
await expect(dialog.getByRole("button", { name: /annuller/i })).toBeVisible();
});