ci: fall back for unsupported Playwright deps install

This commit is contained in:
Jeppe B
2026-06-10 00:52:14 +02:00
parent eb4eee1aef
commit 2fe50729a5
12 changed files with 117 additions and 84 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ jobs:
- name: Install Playwright Chromium
if: steps.branch-head.outputs.current == 'true'
run: npx playwright install --with-deps chromium
run: node scripts/install-playwright-browsers.mjs chromium
- name: Production Playwright gate
if: steps.branch-head.outputs.current == 'true'
+2 -2
View File
@@ -123,7 +123,7 @@ jobs:
run: npm ci --legacy-peer-deps
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
run: node scripts/install-playwright-browsers.mjs chromium
- name: Run Playwright smoke tests
if: matrix.suite == 'core'
@@ -199,7 +199,7 @@ jobs:
run: npm ci --legacy-peer-deps
- name: Install Playwright browsers
run: npx playwright install --with-deps ${{ matrix.browser_install }}
run: node scripts/install-playwright-browsers.mjs ${{ matrix.browser_install }}
- name: Run full Playwright slice
run: |
-3
View File
@@ -40,9 +40,6 @@ export default defineConfig({
testIgnore: ["**/release/**"],
snapshotPathTemplate: "{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}{-projectName}-win32{ext}",
timeout: 60_000,
expect: {
timeout: 15_000,
},
fullyParallel: true,
forbidOnly: isCI,
retries: isCI ? 2 : 0,
+57
View File
@@ -0,0 +1,57 @@
import { spawnSync } from "node:child_process";
const browsers = process.argv.slice(2);
const requestedBrowsers = browsers.length > 0 ? browsers : ["chromium"];
const runPlaywrightInstall = (args, env = {}) =>
spawnSync("npx", ["playwright", "install", ...args], {
cwd: process.cwd(),
env: {
...process.env,
...env,
},
encoding: "utf8",
});
const writeOutput = (result) => {
if (result.stdout) {
process.stdout.write(result.stdout);
}
if (result.stderr) {
process.stderr.write(result.stderr);
}
};
const isUnsupportedWithDepsFailure = (result) => {
const output = `${result.stdout || ""}\n${result.stderr || ""}`;
return (
result.status !== 0 &&
/Cannot install dependencies for .* with Playwright/i.test(output) &&
/Playwright does not support .* on /i.test(output)
);
};
const withDepsResult = runPlaywrightInstall(["--with-deps", ...requestedBrowsers]);
writeOutput(withDepsResult);
if (withDepsResult.status === 0) {
process.exit(0);
}
if (!isUnsupportedWithDepsFailure(withDepsResult)) {
process.exit(withDepsResult.status ?? 1);
}
console.warn(
[
"Playwright could not install OS dependencies for this runner image.",
"Retrying browser download without --with-deps and skipping host validation.",
"The self-hosted runner image must provide the required browser system libraries.",
].join("\n")
);
const browserOnlyResult = runPlaywrightInstall(requestedBrowsers, {
PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS: "1",
});
writeOutput(browserOnlyResult);
process.exit(browserOnlyResult.status ?? 1);
@@ -624,8 +624,7 @@ onMounted(async () => {
<p v-if="monthFallback.distributionFallbackReason" class="is-size-7">{{ monthFallback.distributionFallbackReason }}</p>
</b-message>
<div data-testid="distribution-month-tabs">
<b-tabs v-model="activeTab" expanded class="distribution-tabs">
<b-tabs v-model="activeTab" expanded data-testid="distribution-month-tabs" class="distribution-tabs">
<b-tab-item :label="t('superuser_invoice_distribution.tabs.overview')" value="overview" icon="chart-line" icon-pack="fas">
<div class="v3-overview-grid">
<InvoiceDistributionCard class="v3-surface">
@@ -976,8 +975,7 @@ onMounted(async () => {
</ul>
</InvoiceDistributionCard>
</b-tab-item>
</b-tabs>
</div>
</b-tabs>
</div>
</RestrictedPageWrapper>
</template>
+1 -3
View File
@@ -766,9 +766,7 @@ test.describe("Coolify infrastructure management", () => {
await page.goto("/superuser/configuration/coolify");
await expect(page).toHaveURL(/\/superuser\/configuration\/releases\/integrations\?panel=coolify/, {
timeout: 30_000,
});
await expect(page).toHaveURL(/\/superuser\/configuration\/releases\/integrations\?panel=coolify/);
await expect(page.getByRole("heading", { name: "Release Manager" })).toBeVisible({ timeout: 30_000 });
await expect(page.getByTestId("release-coolify-panel")).toContainText("Coolify");
});
+36 -36
View File
@@ -150,7 +150,7 @@ test.describe("Edge gateway management smoke", () => {
await page.goto("/superuser/configuration/edgegateway");
await expect(page.getByTestId("edge-gateway-module-config")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("edge-gateway-module-config")).toBeVisible();
await page.getByTestId("gateway-module-release-channel").selectOption("canary");
await page.getByTestId("gateway-module-update-window").fill("03:00-05:00");
await page.getByTestId("gateway-module-save").click();
@@ -207,7 +207,7 @@ test.describe("Edge gateway management smoke", () => {
await page.goto("/superuser/selfserve/edge-agents");
await expect(page.getByTestId("gateway-fleet-usage")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-fleet-usage")).toBeVisible();
await expect(page.getByTestId("gateway-fleet-usage-coverage")).toContainText("2 gateways");
await expect(page.getByTestId("gateway-fleet-usage-coverage")).toContainText("1 online");
await expect(page.getByTestId("gateway-fleet-usage-devices")).toContainText("1 online");
@@ -233,7 +233,7 @@ test.describe("Edge gateway management smoke", () => {
await page.goto("/superuser/selfserve/edge-agents");
await expect(page.getByTestId("gateway-fleet-landing")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-fleet-landing")).toBeVisible();
await expect(page.getByTestId("gateway-onboarding")).toContainText("Install new gateway");
await expect(page.getByTestId("gateway-fleet-usage-coverage")).toContainText("0 gateways");
@@ -241,7 +241,7 @@ test.describe("Edge gateway management smoke", () => {
await page.getByTestId("gateway-installer-label").fill("Canary Pi");
await page.getByTestId("gateway-installer-generate").click();
await expect(page.getByTestId("gateway-installer-status")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-installer-status")).toBeVisible();
await expect.poll(() => page.getByTestId("gateway-installer-status-state").textContent()).toContain("Running");
await expect
.poll(async () => (await page.getByTestId("gateway-installer-status-step").textContent())?.trim())
@@ -263,13 +263,13 @@ test.describe("Edge gateway management smoke", () => {
await primeSuperuserSession(page);
await page.goto("/superuser/selfserve/edge-agents");
await expect(page.getByTestId("gateway-fleet-landing")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-fleet-landing")).toBeVisible();
await page.getByTestId("gateway-installer-department").selectOption("1");
await page.getByTestId("gateway-installer-label").fill("CPH Edge 01");
await page.getByTestId("gateway-installer-generate").click();
await expect(page.getByTestId("gateway-installer-status")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-installer-status")).toBeVisible();
await expect.poll(() => page.getByTestId("gateway-installer-status-state").textContent()).toContain("Running");
await expect(page).toHaveURL(/\/superuser\/selfserve\/edge-agents\/701\/overview$/, { timeout: 20_000 });
await expect(page.getByTestId("gateway-detail-header")).toContainText("CPH Edge 01");
@@ -313,7 +313,7 @@ test.describe("Edge gateway management smoke", () => {
await page.getByTestId("gateway-installer-label").fill("Broken Pi");
await page.getByTestId("gateway-installer-generate").click();
await expect(page.getByTestId("gateway-installer-status")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-installer-status")).toBeVisible();
await expect
.poll(() => page.getByTestId("gateway-installer-status-state").textContent(), { timeout: 15_000 })
.toContain("Failed");
@@ -327,7 +327,7 @@ test.describe("Edge gateway management smoke", () => {
"Compose rollout failed during build/startup"
);
await expect(page).toHaveURL(/\/superuser\/selfserve\/edge-agents(?:\?.*)?$/);
await expect(page.getByTestId("gateway-fleet-landing")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-fleet-landing")).toBeVisible();
await expect(page.getByTestId("gateway-onboarding")).toContainText("Install new gateway");
await expect(page.getByTestId("gateway-fleet-usage-coverage")).toContainText("0 gateways");
});
@@ -371,7 +371,7 @@ test.describe("Edge gateway management smoke", () => {
await primeSuperuserSession(page);
await page.goto("/superuser/selfserve/edge-agents");
await expect(page.getByTestId("gateway-fleet-landing")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-fleet-landing")).toBeVisible();
await page.getByTestId("gateway-installer-department").selectOption("1");
await page.getByTestId("gateway-installer-label").fill("Canary Pi");
@@ -409,7 +409,7 @@ test.describe("Edge gateway management smoke", () => {
await expect(page.getByTestId("gateway-detail-header")).toContainText("CPH Edge 01");
await page.getByTestId("gateway-tab-statistics").click();
await expect(page.getByTestId("gateway-statistics-page")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-statistics-page")).toBeVisible();
await expect(page.getByTestId("gateway-statistics-transport")).toContainText("Last successful sync");
await expect(page.getByTestId("gateway-statistics-transport")).toContainText("2026-04-08 08:15:00");
await expect(page.getByTestId("gateway-statistics-transport")).toContainText("Last transport failure");
@@ -579,7 +579,7 @@ test.describe("Edge gateway management smoke", () => {
await expect(page.getByTestId("gateway-operation-events")).toContainText("Operation completed successfully");
await page.getByTestId("gateway-tab-logs").click();
await expect(page.getByTestId("gateway-logs-page")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-logs-page")).toBeVisible();
await expect(page.getByTestId("gateway-logs-timeline")).toContainText("GATEWAY_OPERATION_QUEUED");
await expect(page.getByTestId("gateway-relay-logs")).toContainText("MACHINE ON Roskilde Maskine handled by local");
await expect(page.getByTestId("gateway-relay-logs")).toContainText("Open ENTRY Roskilde indkoerselspc");
@@ -599,7 +599,7 @@ test.describe("Edge gateway management smoke", () => {
await expect(page.getByTestId("gateway-relay-entry-context-copy-0")).toContainText("Copied");
expect(await page.evaluate(() => window.__copiedGatewayContext)).toContain('"module_responsible"');
await page.getByTestId("gateway-relay-entry-context-view-0").click();
await expect(page.getByTestId("gateway-context-modal")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-context-modal")).toBeVisible();
await expect(page.getByTestId("gateway-context-modal-body")).toContainText("SET_RELAY_STATE");
await expect(page.getByTestId("gateway-context-modal-body")).toContainText("module_responsible");
await page.getByTestId("gateway-context-modal-close").click();
@@ -611,7 +611,7 @@ test.describe("Edge gateway management smoke", () => {
);
await page.getByTestId("gateway-tab-statistics").click();
await expect(page.getByTestId("gateway-statistics-page")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-statistics-page")).toBeVisible();
await expect(page.getByTestId("gateway-statistics-version")).toContainText("php-agent-v2.0");
await expect(page.getByTestId("gateway-statistics-transport")).toContainText("Last successful sync");
await expect(page.getByTestId("gateway-statistics-transport")).toContainText("2026-04-08 08:14:56");
@@ -645,11 +645,11 @@ test.describe("Edge gateway management smoke", () => {
await page.goto("/superuser/departments/1/gateways?tab=lanes", { waitUntil: "domcontentloaded" });
await expect(page.getByTestId("department-hardware-panel-lanes")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("department-hardware-panel-lanes")).toBeVisible();
await expect(page.getByTestId("department-lane-8")).toContainText("MISSING");
await page.getByTestId("department-hardware-tab-gateways").click();
await expect(page.getByTestId("edge-gateway-workspace")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("edge-gateway-workspace")).toBeVisible();
await page.getByTestId("gateway-tab-inventory").click();
await page.getByTestId("gateway-binding-add").click();
@@ -665,7 +665,7 @@ test.describe("Edge gateway management smoke", () => {
await expect(page.getByTestId("department-lane-8")).toContainText("READY");
await page.getByTestId("department-hardware-tab-scanners").click();
await expect(page.getByTestId("department-hardware-panel-scanners")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("department-hardware-panel-scanners")).toBeVisible();
await page.getByTestId("department-scanner-lane-2").selectOption("8");
await page.getByTestId("department-scanner-save-2").click();
await expect(page.getByTestId("department-hardware-notice")).toContainText("lane assignment updated");
@@ -700,7 +700,7 @@ test.describe("Edge gateway management smoke", () => {
await laneRow.locator(".action-settings-wheel-trigger").click();
const actionWheelMenu = page.getByRole("menu").first();
await expect(actionWheelMenu).toBeVisible({ timeout: 15_000 });
await expect(actionWheelMenu).toBeVisible();
await expect(actionWheelMenu).toContainText(/(Lane|Vaskebane)/);
await expect(actionWheelMenu).toContainText(/(Self-serve Studio|Selvvask Studio)/);
@@ -745,7 +745,7 @@ test.describe("Edge gateway management smoke", () => {
await laneRow.locator(".action-settings-wheel-trigger").click();
const actionWheelMenu = page.getByRole("menu").first();
await expect(actionWheelMenu).toBeVisible({ timeout: 15_000 });
await expect(actionWheelMenu).toBeVisible();
await expect(actionWheelMenu).toContainText("Selvvask Studio");
await expect(actionWheelMenu).toContainText("Porte");
await expect(actionWheelMenu).toContainText("Relæer");
@@ -772,7 +772,7 @@ test.describe("Edge gateway management smoke", () => {
await expect(page.getByTestId("department-hardware-open-selfserve-studio")).toContainText("Open Studio");
await expect(page.getByTestId("department-hardware-open-legacy-selfserve")).toContainText("Open Legacy Self-Serve");
await expect(page.getByTestId("department-hardware-open-binding-inventory")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("department-hardware-open-binding-inventory")).toBeVisible();
await expect(page.getByTestId("department-hardware-test-mode")).toContainText("Local");
await expect(page.getByTestId("department-hardware-test-mode")).toContainText("Cloud");
@@ -817,9 +817,9 @@ test.describe("Edge gateway management smoke", () => {
await expect(page.getByTestId("department-lane-test-result-7-MACHINE")).toContainText("Cloud Machine ON.");
await page.getByTestId("department-hardware-tab-relays").click();
await expect(page.getByTestId("department-hardware-panel-relays")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("department-hardware-add-relay")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("department-hardware-open-legacy-relays")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("department-hardware-panel-relays")).toBeVisible();
await expect(page.getByTestId("department-hardware-add-relay")).toBeVisible();
await expect(page.getByTestId("department-hardware-open-legacy-relays")).toBeVisible();
await expect(page.getByTestId("department-relay-52")).toContainText("North machine relay");
await expect(page.getByTestId("department-relay-52")).toContainText("Lane 7");
await expect(page.getByTestId("department-relay-52")).toContainText("North Entrance");
@@ -1040,19 +1040,19 @@ test.describe("Edge gateway management smoke", () => {
await page.goto("/superuser/departments/1/gateways?tab=gates");
await expect(page.getByTestId("department-hardware-panel-gates")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("department-hardware-add-gate")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("department-gate-edit-41")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("department-gate-delete-42")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("department-hardware-panel-gates")).toBeVisible();
await expect(page.getByTestId("department-hardware-add-gate")).toBeVisible();
await expect(page.getByTestId("department-gate-edit-41")).toBeVisible();
await expect(page.getByTestId("department-gate-delete-42")).toBeVisible();
await page.getByTestId("department-hardware-add-gate").click();
let modal = page.locator(".swal2-popup");
await expect(modal).toBeVisible({ timeout: 15_000 });
await expect(modal).toBeVisible();
await modal.locator("#department-gate-name").fill("East Exit");
await modal.locator("#department-gate-is-exit").selectOption("true");
await modal.locator("#department-gate-transport-type").selectOption("RELAY");
await expect(modal.locator("#department-gate-relay-id")).toBeVisible({ timeout: 15_000 });
await expect(modal.locator("#department-gate-relay-id")).toBeVisible();
await modal.locator("#department-gate-relay-id").fill("M-11");
await modal.locator("#department-gate-pulse-seconds").fill("2");
await modal.locator(".swal2-confirm").click();
@@ -1064,7 +1064,7 @@ test.describe("Edge gateway management smoke", () => {
await page.getByTestId("department-gate-edit-42").click();
modal = page.locator(".swal2-popup");
await expect(modal).toBeVisible({ timeout: 15_000 });
await expect(modal).toBeVisible();
await modal.locator("#department-gate-name").fill("Service Exit Updated");
await modal.locator("#department-gate-phone-number").fill("+4599999999");
await modal.locator("#department-gate-call-duration-threshold").fill("45");
@@ -1078,7 +1078,7 @@ test.describe("Edge gateway management smoke", () => {
await page.getByTestId("department-gate-delete-90").click();
modal = page.locator(".swal2-popup");
await expect(modal).toBeVisible({ timeout: 15_000 });
await expect(modal).toBeVisible();
await modal.locator(".swal2-confirm").click();
await expect(page.getByTestId("department-hardware-notice")).toContainText("Gate deleted: East Exit.");
@@ -1095,7 +1095,7 @@ test.describe("Edge gateway management smoke", () => {
await gotoEdgeAgentView(page, "tasks", { readyTestId: "gateway-operation-discovery" });
await page.getByTestId("gateway-operation-discovery").click();
await expect(page.getByTestId("gateway-operation-cancel")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-operation-cancel")).toBeVisible();
await page.getByTestId("gateway-operation-cancel").click();
await expect(page.locator("body")).toContainText("DISCOVERY cancelled.");
await expect(page.getByTestId("gateway-operations-list")).toContainText("CANCELLED");
@@ -1171,9 +1171,9 @@ test.describe("Edge gateway management smoke", () => {
await gotoEdgeAgentTerminal(page);
await expect(page.getByTestId("gateway-terminal-page")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-terminal-page")).toBeVisible();
await expect(page.getByTestId("gateway-terminal-status")).toContainText(/not connected to the broker/i);
await expect(page.getByTestId("gateway-terminal-diagnostics")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-terminal-diagnostics")).toBeVisible();
await expect(page.getByTestId("gateway-terminal-diagnostics")).toContainText("Broker connected: no");
await expect(page.getByTestId("gateway-terminal-diagnostics")).toContainText(
"Broker last error: Broker unavailable"
@@ -1200,11 +1200,11 @@ test.describe("Edge gateway management smoke", () => {
await gotoEdgeAgentTerminal(page);
await expect(page.getByTestId("gateway-terminal-page")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-terminal-page")).toBeVisible();
await expect(page.getByTestId("gateway-terminal-status")).toContainText(/Broker did not complete/i, {
timeout: 5_000,
});
await expect(page.getByTestId("gateway-terminal-diagnostics")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-terminal-diagnostics")).toBeVisible();
await expect(page.getByTestId("gateway-terminal-diagnostics")).toContainText("WebSocket code: 1006");
await expect(page.getByTestId("gateway-terminal-diagnostics")).toContainText(
"WebSocket URL: mock-ws://edge-broker/browser-shell"
@@ -1221,7 +1221,7 @@ test.describe("Edge gateway management smoke", () => {
await gotoEdgeAgentTerminal(page);
await expect(page.getByTestId("gateway-terminal-page")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("gateway-terminal-page")).toBeVisible();
await expect(page.getByTestId("gateway-terminal-status")).toContainText(/connecting|open/i);
await expect(page.getByTestId("gateway-terminal-output")).toContainText("Connected to CPH Edge 01", {
timeout: 5_000,
+4 -4
View File
@@ -94,7 +94,7 @@ test.describe("Invoice distribution smoke", () => {
"/superuser/invoices/distribution/2026/3/customers?customerSearch=acme&customerSource=fixed_pricing&customerDepartment=Copenhagen&compareMode=line_by_line"
);
await expect(page.getByTestId("distribution-month-tabs")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("distribution-month-tabs")).toBeVisible();
await expect(page).toHaveURL(/customerSearch=acme/);
await expect(page).toHaveURL(/customerSource=fixed_pricing/);
@@ -136,9 +136,9 @@ test.describe("Invoice distribution smoke", () => {
await prepareInvoiceDistributionPage(page);
await page.goto("/superuser/invoices/distribution/2026/3/overview");
await expect(page.getByTestId("distribution-month-toolbar")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("distribution-month-prev")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("distribution-month-next")).toBeVisible({ timeout: 15_000 });
await expect(page.getByTestId("distribution-month-toolbar")).toBeVisible();
await expect(page.getByTestId("distribution-month-prev")).toBeVisible();
await expect(page.getByTestId("distribution-month-next")).toBeVisible();
await expect(page.locator(".summary-ribbon:visible").first()).toBeVisible();
await page.getByRole("tab", { name: /Departments|Afdelinger/i }).click();
await expect(page.locator(".table-container--scroll:visible").first()).toBeVisible();
+9 -15
View File
@@ -1469,19 +1469,13 @@ test.describe("Invoicing period tab", () => {
await customerRow.getByText("Acme Fleet").click();
await expect(page.getByTestId("invoicing-period-customer-expanded-4001")).toBeVisible();
await expect(page.getByTestId("pos-order-invoice-collection-summary-16891")).toContainText(/16891/);
await expect(page.getByTestId("pos-order-invoice-collection-summary-16891")).toContainText(
/Viser 1 af 2|Showing 1 of 2/i
);
const isMobileViewport = (await page.viewportSize())?.width < 700;
if (!isMobileViewport) {
const expandAllOrders = page.getByRole("button", { name: /Udfold alle|Expand all/i }).first();
if (await expandAllOrders.isVisible().catch(() => false)) {
await expandAllOrders.click();
}
const hiddenFlag = page.getByTestId("invoice-period-flag-auto-hidden-order-reference-1");
await expect(hiddenFlag).toBeVisible({ timeout: 15_000 });
await expect(hiddenFlag).toContainText("Ordren mangler en påkrævet reference.");
}
const hiddenFlag = page.getByTestId("invoice-period-flag-auto-hidden-order-reference-1");
await expect(hiddenFlag).toBeVisible();
await expect(hiddenFlag).toContainText("Ordren mangler en påkrævet reference.");
});
test("@smoke period customer unfolding is single-open and action wheel shows active state", async ({ page }) => {
@@ -1522,13 +1516,13 @@ test.describe("Invoicing period tab", () => {
if (isFlatLayout) {
const customerFlagAction = firstCustomer.locator("button.dropdown-item-action").filter({ hasText: /^Kunde$/ });
await expect(customerFlagAction).toBeVisible();
await expect(customerFlagAction.locator(".has-text-danger").first()).toHaveClass(/has-text-danger/);
await expect(customerFlagAction.locator(".has-text-danger").first()).toBeVisible();
} else {
await firstCustomer.getByTestId("action-settings-wheel-section-invoice-period-flags").hover();
const flagSubmenu = page.getByTestId("action-settings-wheel-submenu-invoice-period-flags");
const customerFlagAction = flagSubmenu.locator("button.dropdown-item-action", { hasText: "Kunde" });
await expect(customerFlagAction).toBeVisible();
await expect(customerFlagAction.locator(".has-text-danger").first()).toHaveClass(/has-text-danger/);
await expect(customerFlagAction.locator(".has-text-danger").first()).toBeVisible();
await expect(flagSubmenu).not.toContainText(/Dette m.*l/);
}
@@ -2668,7 +2662,7 @@ test.describe("Invoicing period tab", () => {
await page.goto("/superuser/invoices?activeTab=period");
await expect(page).toHaveURL(/activeTab=period/);
await expect.poll(() => requestCount, { timeout: 15_000 }).toBeGreaterThan(0);
await expect.poll(() => requestCount).toBeGreaterThan(0);
await page.getByTestId("invoicing-period-view-selector-all").click();
await expect(page.getByTestId("invoicing-period-customer-queue-6001")).toBeVisible();
+1 -1
View File
@@ -9,7 +9,7 @@ test.describe("Public route smoke", () => {
test("@smoke @pr app boot loads landing page", async ({ page }) => {
await page.goto("/");
await expect(page).toHaveURL(/\/$/);
await expect(page.getByTestId("landing-title")).toContainText("Truck Wash", { timeout: 15_000 });
await expect(page.getByTestId("landing-title")).toContainText("Truck Wash");
});
test("@smoke key guest routes are reachable", async ({ page }) => {
+1 -1
View File
@@ -19,7 +19,7 @@ test.describe("Superuser vehicles smoke", () => {
await page.goto("/superuser/vehicles");
await expect(page).toHaveURL(/\/superuser\/vehicles$/);
await expect(page.locator("h2.title").first()).toBeVisible({ timeout: 15_000 });
await expect(page.locator("h2.title").first()).toBeVisible();
await expect(page.locator("body")).toContainText(/registrerede/i);
await expect(page.locator("body")).not.toContainText(/Order ID is required/i);
});
+3 -14
View File
@@ -7351,25 +7351,14 @@ export async function mockApi(page, options = {}) {
}
export async function seedAuthenticatedState(page, token = "e2e-token") {
const writeSessionState = (value) => {
await page.addInitScript((value) => {
window.localStorage.setItem("token", value);
window.localStorage.setItem("lastVersionCheck", String(Date.now()));
};
await page.context().addInitScript(writeSessionState, token);
await page.addInitScript(writeSessionState, token);
if (page.url() !== "about:blank") {
await page.evaluate(writeSessionState, token).catch(() => null);
}
}, token);
}
export async function primeMockSession(page, { token = "e2e-token", bootPath = null } = {}) {
export async function primeMockSession(page, { token = "e2e-token", bootPath = "/redirect" } = {}) {
await seedAuthenticatedState(page, token);
if (!bootPath) {
return;
}
const sessionRequest = page
.waitForResponse(
(response) => {