- Extend `releaseTimeline.js` and related modules for runtime-aware service sets and URLs. - Update the release session builder to include `service_set` handling. - Introduce release service definitions, status tones, and enhanced runtime display text. - Add new dataset mode options, preview rows, and warnings for release configurations in `ConfigurationReleaseManager.vue`. - Implement extensive utility methods for data service handling, target context, and deployment endpoints. - Add `vite-api-proxy.spec.js` and extend `release-bootstrap.spec.js` to ensure coverage for new functionality.
58 lines
2.5 KiB
TypeScript
58 lines
2.5 KiB
TypeScript
import { test, expect } from "@playwright/test";
|
|
|
|
const PING_URL =
|
|
/(?:https:\/\/api\.truckwash\.io:4433|https?:\/\/(?:localhost|127\.0\.0\.1)(?::\d+)?\/api)\/ping(?:\?.*)?$/;
|
|
const CONNECTIVITY_PAGE_TIMEOUT_MS = 30_000;
|
|
|
|
function installPingFailure(page, onPing) {
|
|
return page.route(PING_URL, async (route) => {
|
|
onPing();
|
|
await route.fulfill({
|
|
status: 500,
|
|
contentType: "application/json",
|
|
body: JSON.stringify({ message: "Connectivity check failed" }),
|
|
});
|
|
});
|
|
}
|
|
|
|
test.describe("Connectivity issue", () => {
|
|
test("renders the recovery state when ping fails", async ({ page }) => {
|
|
let pingCount = 0;
|
|
await installPingFailure(page, () => {
|
|
pingCount += 1;
|
|
});
|
|
|
|
await page.goto("/connectivity-issue");
|
|
|
|
await expect(page.getByTestId("connectivity-issue")).toBeVisible({ timeout: CONNECTIVITY_PAGE_TIMEOUT_MS });
|
|
await expect(page.getByTestId("connectivity-icon")).toBeVisible();
|
|
await expect(page.getByTestId("connectivity-title")).toHaveText("Forbindelsesproblem");
|
|
await expect(page.getByTestId("connectivity-subtitle")).toContainText("internetforbindelse");
|
|
await expect(page.getByTestId("connectivity-subtitle")).toContainText("vores server");
|
|
await expect(page.getByTestId("connectivity-description")).toContainText("Vent venligst");
|
|
await expect(page.getByTestId("connectivity-description")).toContainText("serveren");
|
|
await expect(page.getByTestId("connectivity-retry-timer")).toContainText("Pr");
|
|
await expect(page.getByTestId("connectivity-retry-button")).toHaveText("Prøv igen");
|
|
await expect(page.getByTestId("connectivity-footer")).toContainText("kontakt venligst support");
|
|
await expect.poll(() => pingCount).toBeGreaterThan(0);
|
|
});
|
|
|
|
test("retry button triggers a fresh ping attempt and keeps the recovery screen visible", async ({ page }) => {
|
|
let pingCount = 0;
|
|
await installPingFailure(page, () => {
|
|
pingCount += 1;
|
|
});
|
|
|
|
await page.goto("/connectivity-issue");
|
|
await expect(page.getByTestId("connectivity-issue")).toBeVisible({ timeout: CONNECTIVITY_PAGE_TIMEOUT_MS });
|
|
await expect.poll(() => pingCount).toBeGreaterThan(0);
|
|
|
|
const initialPingCount = pingCount;
|
|
await page.getByTestId("connectivity-retry-button").click();
|
|
|
|
await expect.poll(() => pingCount).toBeGreaterThan(initialPingCount);
|
|
await expect(page.getByTestId("connectivity-issue")).toBeVisible();
|
|
await expect(page.getByTestId("connectivity-title")).toHaveText("Forbindelsesproblem");
|
|
});
|
|
});
|