Files
pleno-vue/tests/e2e/adminModulePosMobileOrderFlow.spec.ts
Jeppe Bundgaard 78648a0b7f Add customer complaints, edge gateway terminal, and mobile POS functionalities with e2e and unit test coverage:
- Implemented `departmentDailyReportComplaintCustomers.js` module for handling customer complaint data, including search, normalization, and API integration.
- Added `EdgeGatewayTerminal.vue` for root shell access with session approval, dynamic status handling, and user feedback.
- Developed `mobilePos.js` for simulating mobile POS fixtures and workflows in e2e tests.
- Introduced relevant e2e and unit tests to ensure functionality and error handling across modules.
2026-04-09 11:35:18 +02:00

37 lines
1.8 KiB
TypeScript

import { expect, test } from "@playwright/test";
import { bookingTestData, operatorCredentials } from "./fixtures";
const LIVE_ENABLED = process.env.PLAYWRIGHT_LIVE === "1";
test.describe("Admin Module - POS Mobile Order Flow", () => {
test.beforeEach(async ({ page }, testInfo) => {
test.skip(testInfo.project.name !== "chromium-mobile", "Live mobile POS smoke is scoped to chromium-mobile.");
test.skip(!LIVE_ENABLED, "Set PLAYWRIGHT_LIVE=1 to run the live mobile POS smoke suite.");
await page.goto("/admin/login");
await page.fill('input[name="user_id"]', operatorCredentials.userId);
await page.fill('input[name="password"]', operatorCredentials.password);
await page.click("#operator_login_button");
await expect(page).toHaveURL(/\/admin(\?.*)?$/, { timeout: 15_000 });
});
test("operator login reaches the mobile POS scanner shell", async ({ page }) => {
await page.goto(`/admin/${bookingTestData.departmentId}/modules/pos`);
await expect(page.getByTestId("pos-mobile-step-1-shell")).toBeVisible({ timeout: 20_000 });
await expect(page.getByTestId("pos-mobile-step-1-title")).toContainText("Scan nummerplader");
await expect(page.getByTestId("pos-mobile-manual-input-toggle")).toBeVisible();
});
test("manual registration input opens and uppercases the value", async ({ page }) => {
await page.goto(`/admin/${bookingTestData.departmentId}/modules/pos`);
await expect(page.getByTestId("pos-mobile-manual-input-toggle")).toBeVisible({ timeout: 20_000 });
await page.getByTestId("pos-mobile-manual-input-toggle").click();
await expect(page.getByTestId("pos-mobile-manual-input")).toBeVisible({ timeout: 10_000 });
await page.getByTestId("pos-mobile-reg-input-1").fill("ec21233");
await expect(page.getByTestId("pos-mobile-reg-input-1")).toHaveValue("EC21233");
});
});