Remove configuration cache problems report
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
import { test } from "@playwright/test";
|
||||
import { expect, test, type Page } from "@playwright/test";
|
||||
import { bookingTestData } from "./fixtures";
|
||||
import { completeBookingCreationFlow } from "./support/bookingFlow";
|
||||
import {
|
||||
completeBookingCreationFlow,
|
||||
goToBookingProductSelectionStep,
|
||||
goToBookingProductSelectionStepWithOptions,
|
||||
} from "./support/bookingFlow";
|
||||
import { mockApi, primeMockSession } from "./support/network.js";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
async function prepareBookingPage(page: Page, pos: true | Record<string, unknown> = true) {
|
||||
await mockApi(page, {
|
||||
authenticated: true,
|
||||
sessionData: {
|
||||
@@ -11,12 +15,53 @@ test.beforeEach(async ({ page }) => {
|
||||
customer_number: 12345679,
|
||||
permissions: ["user"],
|
||||
},
|
||||
pos: true,
|
||||
pos,
|
||||
});
|
||||
|
||||
await primeMockSession(page, { bootPath: "/user" });
|
||||
});
|
||||
}
|
||||
|
||||
test("[BOOKINGS][User][Creation] should create a new booking", async ({ page }) => {
|
||||
await prepareBookingPage(page);
|
||||
await completeBookingCreationFlow(page, bookingTestData);
|
||||
});
|
||||
|
||||
test("[BOOKINGS][User][Creation] should show interior wash products on the interior category", async ({ page }) => {
|
||||
await prepareBookingPage(page);
|
||||
await goToBookingProductSelectionStep(page, bookingTestData);
|
||||
|
||||
const interiorCategoryTab = page.getByTestId("pos-product-category-tab-2");
|
||||
if (await interiorCategoryTab.isVisible().catch(() => false)) {
|
||||
await interiorCategoryTab.click();
|
||||
} else {
|
||||
await page.getByTestId("pos-product-category-select").selectOption("2");
|
||||
}
|
||||
|
||||
await expect(page.getByTestId("pos-product-card-63")).toBeVisible();
|
||||
await expect(page.getByText("Indvendig vask Forvogn")).toBeVisible();
|
||||
});
|
||||
|
||||
test("[BOOKINGS][User][Creation] should show desktop loading states while categories and products resolve", async ({ page }, testInfo) => {
|
||||
test.skip(!testInfo.project.name.toLowerCase().includes("desktop"), "Desktop only");
|
||||
|
||||
await prepareBookingPage(page, {
|
||||
departmentCategoriesDelayMs: 700,
|
||||
productsDelayMs: 900,
|
||||
});
|
||||
|
||||
await goToBookingProductSelectionStepWithOptions(page, bookingTestData, {
|
||||
selectInitialProduct: false,
|
||||
});
|
||||
|
||||
await expect(page.getByTestId("pos-product-categories-loading")).toBeVisible();
|
||||
await expect(page.getByTestId("pos-products-loading")).toBeVisible();
|
||||
|
||||
await expect(page.getByTestId("pos-product-categories-loading")).toHaveCount(0, { timeout: 10_000 });
|
||||
await expect(page.getByTestId("pos-product-card-53")).toBeVisible({ timeout: 10_000 });
|
||||
await expect(page.getByTestId("pos-products-loading")).toHaveCount(0, { timeout: 10_000 });
|
||||
|
||||
await page.getByTestId("pos-product-category-tab-2").click();
|
||||
await expect(page.getByTestId("pos-products-loading")).toBeVisible();
|
||||
await expect(page.getByTestId("pos-product-card-63")).toBeVisible({ timeout: 10_000 });
|
||||
await expect(page.getByTestId("pos-products-loading")).toHaveCount(0, { timeout: 10_000 });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user