Stabilize Safari E2E contracts

This commit is contained in:
rcourtman 2026-08-05 10:19:43 +01:00
parent 9f870bf474
commit dee1f9c0be
2 changed files with 17 additions and 4 deletions

View file

@ -78,7 +78,8 @@ test.describe('VMware AI chat mentions', () => {
.filter({ hasText: /esxi-01\.lab\.local/ })
.first();
await expect(hostOption).toBeVisible({ timeout: 30_000 });
await hostOption.click();
await expect(hostOption).toHaveAttribute('aria-selected', 'true');
await textarea.press('Enter');
await expect(textarea).toHaveValue('@esxi-01.lab.local ');
// API-backed vSphere VMs use the same shared mention contract, carrying
@ -91,7 +92,8 @@ test.describe('VMware AI chat mentions', () => {
.filter({ hasText: /warehouse-api-01/ })
.first();
await expect(vmOption).toBeVisible({ timeout: 30_000 });
await vmOption.click();
await expect(vmOption).toHaveAttribute('aria-selected', 'true');
await textarea.press('Enter');
await expect(textarea).toHaveValue('@warehouse-api-01 ');
expect(unexpectedVMwareRequests).toEqual([]);

View file

@ -44,8 +44,16 @@ test("powered-off tolerance preserves inheritance, explicit zero, and strict val
};
const updates: Array<Record<string, unknown>> = [];
await page.route("**/api/resources?**", async (route: Route) => {
// Keep this policy contract deterministic. Live inventory frames can arrive
// after the REST response and replace the single resource fixture.
await page.routeWebSocket("**/ws*", () => {});
await page.route("**/api/resources**", async (route: Route) => {
const url = new URL(route.request().url());
if (url.pathname !== "/api/resources") {
await route.continue();
return;
}
const pageNumber = Number(url.searchParams.get("page") ?? "1");
const data =
pageNumber === 1
@ -135,7 +143,10 @@ test("powered-off tolerance preserves inheritance, explicit zero, and strict val
const override = page.getByRole("spinbutton", {
name: /Grace override \(seconds\)/,
});
await override.fill("1.5");
// Exponent syntax is valid for a number input, but intentionally rejected by
// the policy's whole-number grammar. WebKit clears step-invalid decimals.
await override.fill("1e2");
await expect(override).toHaveValue("1e2");
await page.getByRole("button", { name: "Save override" }).click();
await expect(
page.getByText("Grace override must be a whole number of seconds.", {