Files
pleno-vue/tests/e2e/userBookings.spec.ts
T
Jeppe Bundgaard 1afdda2650 Refactor POS workflows and improve booking flow:
- Updated `PayWithStripeButton` to handle setup requirements and improved error state handling.
- Enhanced POS mobile popup completion flow with added callback support and fallback actions.
- Introduced booking safety seal and improved step navigation logic.
- Added new e2e tests for booking confirmation, order completion, and error scenarios.
- Adjusted POS e2e and visual tests for updated workflows and UI changes.
- Refactored POS component logic for consistency and improved readability.
2026-04-14 16:19:11 +02:00

44 lines
1.6 KiB
TypeScript

import { expect, test } from "@playwright/test";
import { bookingTestData } from "./fixtures";
import { completeBookingCreationFlow } from "./support/bookingFlow";
import { mockApi, primeMockSession } from "./support/network.js";
test.beforeEach(async ({ page }) => {
await mockApi(page, {
authenticated: true,
sessionData: {
display_name: "Booking User",
customer_number: 12345679,
permissions: ["user"],
},
pos: true,
});
await primeMockSession(page, { bootPath: "/user" });
});
test("[PAGES][User][/user/bookings] should load the page", async ({ page }) => {
await page.goto("/user/bookings");
await expect(page).toHaveURL(/user\/bookings/);
});
test("[PAGES][User][/user/bookings] should display the title", async ({ page }) => {
await page.goto("/user/bookings");
await expect(page.locator(".title")).toContainText("Oversigt over bookinger");
});
test("[BOOKINGS][User][List] should show created booking after book wash flow", async ({ page }) => {
await completeBookingCreationFlow(page, bookingTestData);
await page.waitForLoadState("networkidle");
await page.goto("/user/bookings");
await expect(page.locator(".title")).toContainText("Oversigt over bookinger");
const showOnlyTodayToggle = page.locator("#today").first();
if (await showOnlyTodayToggle.isVisible().catch(() => false)) {
await showOnlyTodayToggle.uncheck({ force: true });
}
await page.getByRole("button", { name: "Opdater" }).first().click();
await page.waitForLoadState("networkidle");
await expect(page.locator("body")).toContainText(bookingTestData.registrationNumber);
});