Refresh HiveGrid Cloud reference snapshot
No files matched your search
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 134 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
After Width: | Height: | Size: 201 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 143 KiB |
|
After Width: | Height: | Size: 132 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 150 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 157 KiB |
|
After Width: | Height: | Size: 134 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 108 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 111 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 153 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 164 KiB |
|
After Width: | Height: | Size: 97 KiB |
@@ -0,0 +1,29 @@
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
|
||||
import { TelephonyInterimVisualFixture as VisualFixture } from "../../apps/web/app/components/screens/telephony/telephony-interim.visual-fixture";
|
||||
|
||||
const VISUAL_SCREENS = ["settings", "calls", "call-detail", "click-to-call"] as const;
|
||||
|
||||
test.describe("AK-P15a telephony interim UI pixel baseline", () => {
|
||||
for (const screen of VISUAL_SCREENS) {
|
||||
test(`${screen} stays visually stable in light mode`, async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid={`ak-p15a-${screen}`} style={{ width: "1280px", minHeight: "720px" }}>
|
||||
<VisualFixture screen={screen} />
|
||||
</div>,
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
if (screen === "click-to-call") {
|
||||
await expect(page.locator("[data-ui-id='ui.telephony.clickToCall.dialog']")).toHaveCount(1);
|
||||
await expect(page).toHaveScreenshot("ak-p15a-telephony-click-to-call.png");
|
||||
} else {
|
||||
await expect(component.locator("[data-ui-id$='.page']")).toHaveCount(1);
|
||||
await expect(component).toHaveScreenshot(`ak-p15a-telephony-${screen}.png`);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,50 @@
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
import AxeBuilder from "@axe-core/playwright";
|
||||
|
||||
import { ChatInterimVisualFixture as VisualFixture } from "../../apps/web/app/components/screens/chat/chat-interim.visual-fixture";
|
||||
|
||||
const VISUAL_SCREENS = ["index", "detail"] as const;
|
||||
|
||||
test.describe("AK-P15b team chat interim UI pixel baseline", () => {
|
||||
for (const screen of VISUAL_SCREENS) {
|
||||
test(`${screen} stays visually stable in light mode`, async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid={`ak-p15b-${screen}`} style={{ width: "1280px", minHeight: "720px" }}>
|
||||
<VisualFixture screen={screen} />
|
||||
</div>
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
await expect(component.locator(`[data-ui-id='ui.chat.channel${screen === "index" ? "List" : "Detail"}']`)).toHaveCount(1);
|
||||
if (screen === "index") {
|
||||
await expect(component.locator("[data-channel-id]").first()).toHaveCSS("width", "1232px");
|
||||
}
|
||||
await expect(component).toHaveScreenshot(`ak-p15b-chat-${screen}.png`);
|
||||
});
|
||||
}
|
||||
|
||||
test("index keeps mobile navigation accessible with 44px touch targets", async ({ mount, page }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
const component = await mount(
|
||||
<div style={{ width: "390px", minHeight: "844px" }}>
|
||||
<VisualFixture screen="index" enableNavigation />
|
||||
</div>
|
||||
);
|
||||
|
||||
const mobileNavigation = component.locator("[data-ui-id='ui.chat.mobileNavigation']");
|
||||
await expect(mobileNavigation).toBeVisible();
|
||||
const targets = component.locator("button:not([disabled])");
|
||||
for (let index = 0; index < (await targets.count()); index += 1) {
|
||||
const box = await targets.nth(index).boundingBox();
|
||||
expect(box, `touch target ${index} must be rendered`).not.toBeNull();
|
||||
expect(box!.height, `touch target ${index} height`).toBeGreaterThanOrEqual(44);
|
||||
expect(box!.width, `touch target ${index} width`).toBeGreaterThanOrEqual(44);
|
||||
}
|
||||
|
||||
const results = await new AxeBuilder({ page }).include("[data-ui-id='ui.chat.channelList']").withTags(["wcag2a", "wcag2aa"]).analyze();
|
||||
expect(results.violations).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
|
||||
import { AkP20InterimVisualFixture as VisualFixture } from "../../apps/web/app/components/screens/ak-p20-interim.visual-fixture";
|
||||
|
||||
// Keep this component-only import separate from test data: Playwright CT turns
|
||||
// imported JSX components into browser registry references during compilation.
|
||||
const VISUAL_SCREENS = ["subscription", "usage", "billing", "demo-data", "first-steps"] as const;
|
||||
|
||||
test.describe("AK-P20 interim UI pixel baseline", () => {
|
||||
for (const screen of VISUAL_SCREENS) {
|
||||
test(`${screen} stays visually stable in light mode`, async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid={`ak-p20-${screen}`} style={{ width: "1280px" }}>
|
||||
<VisualFixture screen={screen} />
|
||||
</div>
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
await expect(component.locator("[data-ui-id$='.page']")).toHaveCount(1);
|
||||
await expect(component).toHaveScreenshot(`ak-p20-${screen}.png`);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,145 @@
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
|
||||
import { RegisterScreenVisualFixture as VisualFixture } from "../../apps/web/app/modules/users/components/RegisterScreen.visual-fixture";
|
||||
|
||||
test.describe("BILL-18 registration plan advisor visual baseline", () => {
|
||||
test("desktop separates team sizing from the recommended plan", async ({ mount, page }) => {
|
||||
await prepareCaptchaFixture(page);
|
||||
const component = await mount(<VisualFixture />);
|
||||
await openTeamStep(component);
|
||||
|
||||
await expect(component).toHaveScreenshot("bill-22-registration-team-desktop.png", { animations: "disabled" });
|
||||
|
||||
await component.locator('[name="selectedOfficeSeatQuantity"]').fill("5");
|
||||
await component.locator('[name="selectedFieldSeatQuantity"]').fill("15");
|
||||
await expect(component.locator('[name="selectedSubscriptionPriceId"]')).toHaveValue("price_pro");
|
||||
await component.locator('[data-ui-id="ui.auth.register.toPlanStep"]').click();
|
||||
await expect(component.locator('[data-ui-id="ui.auth.register.planSelection"]')).toContainText("Core");
|
||||
|
||||
await expect(component).toHaveScreenshot("bill-22-registration-plan-desktop.png", { animations: "disabled" });
|
||||
});
|
||||
|
||||
test("mobile stacks team and plan steps without horizontal overflow", async ({ mount, page }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await prepareCaptchaFixture(page);
|
||||
const component = await mount(<VisualFixture />);
|
||||
await openTeamStep(component);
|
||||
|
||||
await expect(component).toHaveCSS("width", "390px");
|
||||
await expect(page.locator("body")).toHaveJSProperty("scrollWidth", 390);
|
||||
await expect(component).toHaveScreenshot("bill-22-registration-team-mobile.png", { animations: "disabled" });
|
||||
|
||||
await component.locator('[data-ui-id="ui.auth.register.toPlanStep"]').click();
|
||||
await expect(component.locator('[data-ui-id="ui.auth.register.planSelection"]')).toBeVisible();
|
||||
await expect(component).toHaveScreenshot("bill-22-registration-plan-mobile.png", { animations: "disabled" });
|
||||
});
|
||||
});
|
||||
|
||||
async function openTeamStep(component: import("@playwright/experimental-ct-react").Locator) {
|
||||
await component.locator('[name="email"]').fill("ada@example.test");
|
||||
await component.locator('[name="first-name"]').fill("Ada");
|
||||
await component.locator('[name="last-name"]').fill("Lovelace");
|
||||
await component.locator('[name="company"]').fill("Analytical Engines GmbH");
|
||||
await component.locator('[data-ui-id="ui.auth.register.toTeamStep"]').click();
|
||||
await expect(component.locator('[data-ui-id="ui.auth.register.planStep"]')).toBeVisible();
|
||||
await expect(component.locator('[data-ui-id="ui.auth.register.teamStep"]')).toBeVisible();
|
||||
}
|
||||
|
||||
async function prepareCaptchaFixture(page: import("@playwright/test").Page) {
|
||||
await page.evaluate(() => {
|
||||
if (customElements.get("cap-widget")) return;
|
||||
customElements.define(
|
||||
"cap-widget",
|
||||
class extends HTMLElement {
|
||||
connectedCallback() {
|
||||
this.innerHTML =
|
||||
'<div style="display:flex;align-items:center;gap:12px;font:500 14px Inter,sans-serif"><span style="width:22px;height:22px;border:1px solid #a3a3a3;border-radius:6px"></span><span>Ich bin ein Mensch</span></div>';
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
await page.route("**/auth/registration-plan-advice**", async (route) => {
|
||||
const requestUrl = new URL(route.request().url());
|
||||
const officeSeatQuantity = Number(requestUrl.searchParams.get("office"));
|
||||
const fieldSeatQuantity = Number(requestUrl.searchParams.get("field"));
|
||||
const recommendsSwarm = officeSeatQuantity === 5 && fieldSeatQuantity === 15;
|
||||
await route.fulfill({
|
||||
contentType: "application/json",
|
||||
body: JSON.stringify({
|
||||
plans: recommendsSwarm ? swarmSizedPlans : plans,
|
||||
selectedPriceId: recommendsSwarm ? "price_pro" : "price_starter",
|
||||
recommendedPriceId: recommendsSwarm ? "price_pro" : "price_starter",
|
||||
officeSeatQuantity,
|
||||
fieldSeatQuantity,
|
||||
}),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const plans = [
|
||||
{
|
||||
planId: "product_starter",
|
||||
planCode: "starter",
|
||||
titleKey: "Core",
|
||||
descriptionKey: "Core",
|
||||
priceId: "price_starter",
|
||||
amountCents: 19_900,
|
||||
baseAmountCents: 19_900,
|
||||
currency: "EUR",
|
||||
billingPeriod: 3,
|
||||
includedOfficeSeatQuantity: 2,
|
||||
includedFieldSeatQuantity: 5,
|
||||
includedStorageGb: 100,
|
||||
extraOfficeSeatQuantity: 0,
|
||||
extraFieldSeatQuantity: 0,
|
||||
recommended: true,
|
||||
},
|
||||
{
|
||||
planId: "product_pro",
|
||||
planCode: "pro",
|
||||
titleKey: "Swarm",
|
||||
descriptionKey: "Swarm",
|
||||
priceId: "price_pro",
|
||||
amountCents: 49_900,
|
||||
baseAmountCents: 49_900,
|
||||
currency: "EUR",
|
||||
billingPeriod: 3,
|
||||
includedOfficeSeatQuantity: 5,
|
||||
includedFieldSeatQuantity: 15,
|
||||
includedStorageGb: 250,
|
||||
extraOfficeSeatQuantity: 0,
|
||||
extraFieldSeatQuantity: 0,
|
||||
recommended: false,
|
||||
},
|
||||
{
|
||||
planId: "product_business",
|
||||
planCode: "business",
|
||||
titleKey: "Colony",
|
||||
descriptionKey: "Colony",
|
||||
priceId: "price_business",
|
||||
amountCents: 99_900,
|
||||
baseAmountCents: 99_900,
|
||||
currency: "EUR",
|
||||
billingPeriod: 3,
|
||||
includedOfficeSeatQuantity: 10,
|
||||
includedFieldSeatQuantity: 30,
|
||||
includedStorageGb: 500,
|
||||
extraOfficeSeatQuantity: 0,
|
||||
extraFieldSeatQuantity: 0,
|
||||
recommended: false,
|
||||
},
|
||||
] as const;
|
||||
|
||||
const swarmSizedPlans = plans.map((plan) =>
|
||||
plan.planCode === "starter"
|
||||
? {
|
||||
...plan,
|
||||
amountCents: 62_600,
|
||||
extraOfficeSeatQuantity: 3,
|
||||
extraFieldSeatQuantity: 10,
|
||||
recommended: false,
|
||||
}
|
||||
: plan.planCode === "pro"
|
||||
? { ...plan, recommended: true }
|
||||
: plan
|
||||
);
|
||||
@@ -0,0 +1,117 @@
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
|
||||
import { VaP24aInterimVisualFixture as VisualFixture } from "../../apps/web/app/components/screens/billing/va-p24a-interim.visual-fixture";
|
||||
import { RegisterScreenVisualFixture } from "../../apps/web/app/modules/users/components/RegisterScreen.visual-fixture";
|
||||
|
||||
test.describe("BILL-19 registration activation checkout visual baseline", () => {
|
||||
test("password policy stays in the account step and explains the correction inline", async ({ mount, page }) => {
|
||||
await page.route("**/auth/registration-plan-advice**", async (route) => route.fulfill({ status: 503 }));
|
||||
const component = await mount(<RegisterScreenVisualFixture requireEmailVerification={false} />);
|
||||
|
||||
await component.locator('[name="email"]').fill("ada@example.test");
|
||||
await component.locator('[name="password"]').fill("TooShort1!");
|
||||
await component.locator('[name="first-name"]').fill("Ada");
|
||||
await component.locator('[name="last-name"]').fill("Lovelace");
|
||||
await component.locator('[name="company"]').fill("Analytical Engines GmbH");
|
||||
await component.locator('[data-ui-id="ui.auth.register.toTeamStep"]').click();
|
||||
|
||||
await expect(component.locator('[data-ui-id="ui.auth.register.accountStep"]')).toBeVisible();
|
||||
await expect(component.locator('[data-ui-id="ui.auth.register.passwordPolicyError"]')).toBeVisible();
|
||||
await expect(component.locator('[name="password"]')).toBeFocused();
|
||||
await expect(component).toHaveScreenshot("bill-19-registration-password-validation.png", {
|
||||
animations: "disabled",
|
||||
maxDiffPixelRatio: 0,
|
||||
});
|
||||
});
|
||||
|
||||
test("desktop walks through team, plan, storage, email and payment", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div style={{ width: "1200px" }}>
|
||||
<VisualFixture activationMode activationTrialDays={0} />
|
||||
</div>
|
||||
);
|
||||
|
||||
await page.evaluate(async () => document.fonts.ready);
|
||||
await expect(component.locator('[data-ui-id="ui.billing.activation.page"]')).toHaveCount(1);
|
||||
await expect(component.locator('[data-ui-id="ui.billing.selfServiceSubscription.usage"]')).toHaveCount(0);
|
||||
await expect(component.locator('[data-ui-id="ui.billing.selfServiceSubscription.emailMarketing"]')).toHaveCount(0);
|
||||
await expect(component.locator('[data-ui-id="ui.billing.activation.team"]')).toBeVisible();
|
||||
await expect(component).toHaveScreenshot("bill-22-activation-team-desktop.png", {
|
||||
animations: "disabled",
|
||||
maxDiffPixelRatio: 0,
|
||||
});
|
||||
|
||||
await goToNextActivationStep(component, "ui.billing.activation.plan");
|
||||
await expect(component).toHaveScreenshot("bill-22-activation-plan-desktop.png", { animations: "disabled", maxDiffPixelRatio: 0 });
|
||||
|
||||
await goToNextActivationStep(component, "ui.billing.activation.storage");
|
||||
await expect(component).toHaveScreenshot("bill-22-activation-storage-desktop.png", { animations: "disabled", maxDiffPixelRatio: 0 });
|
||||
|
||||
await goToNextActivationStep(component, "ui.billing.activation.emailMarketing");
|
||||
await component.getByRole("radio", { name: /Ja, Pakete ansehen/u }).click();
|
||||
await component.getByRole("radio", { name: /E-Mail-Marketing S/u }).click();
|
||||
await expect(component).toHaveScreenshot("bill-22-activation-email-desktop.png", { animations: "disabled", maxDiffPixelRatio: 0 });
|
||||
|
||||
await goToNextActivationStep(component, "ui.billing.activation.payment");
|
||||
await expect(component).toContainText("Kreditkarte");
|
||||
await expect(component).toContainText("Monatlicher Zahlbetrag");
|
||||
await expect(component).toHaveScreenshot("bill-22-activation-payment-desktop.png", { animations: "disabled", maxDiffPixelRatio: 0 });
|
||||
});
|
||||
|
||||
test("mobile preserves the activation hierarchy without horizontal overflow", async ({ mount, page }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
const component = await mount(<VisualFixture activationMode activationTrialDays={0} />);
|
||||
|
||||
await page.evaluate(async () => document.fonts.ready);
|
||||
await expect(component).toHaveCSS("width", "390px");
|
||||
await expect(page.locator("body")).toHaveJSProperty("scrollWidth", 390);
|
||||
await expect(component).toHaveScreenshot("bill-22-activation-team-mobile.png", {
|
||||
animations: "disabled",
|
||||
maxDiffPixelRatio: 0,
|
||||
});
|
||||
|
||||
await goToNextActivationStep(component, "ui.billing.activation.plan");
|
||||
await goToNextActivationStep(component, "ui.billing.activation.storage");
|
||||
await goToNextActivationStep(component, "ui.billing.activation.emailMarketing");
|
||||
await component.getByRole("radio", { name: /Nein, später entscheiden/u }).click();
|
||||
await goToNextActivationStep(component, "ui.billing.activation.payment");
|
||||
await expect(page.locator("body")).toHaveJSProperty("scrollWidth", 390);
|
||||
await expect(component).toHaveScreenshot("bill-22-activation-payment-mobile.png", { animations: "disabled", maxDiffPixelRatio: 0 });
|
||||
});
|
||||
|
||||
test("payment step exposes totals and the hosted Mollie handoff before redirect", async ({ mount, page }) => {
|
||||
await page.setViewportSize({ width: 1366, height: 1200 });
|
||||
const component = await mount(
|
||||
<div style={{ width: "1200px" }}>
|
||||
<VisualFixture activationMode activationTrialDays={0} />
|
||||
</div>
|
||||
);
|
||||
|
||||
await goToNextActivationStep(component, "ui.billing.activation.plan");
|
||||
await goToNextActivationStep(component, "ui.billing.activation.storage");
|
||||
await goToNextActivationStep(component, "ui.billing.activation.emailMarketing");
|
||||
await component.getByRole("radio", { name: /Nein, später entscheiden/u }).click();
|
||||
await goToNextActivationStep(component, "ui.billing.activation.payment");
|
||||
|
||||
const payment = component.locator('[data-ui-id="ui.billing.activation.payment"]');
|
||||
await expect(payment).toContainText("Monatlicher Nettobetrag");
|
||||
await expect(payment).toContainText("Monatlicher Zahlbetrag");
|
||||
await expect(payment).toContainText("Sicherer Hosted Checkout");
|
||||
await expect(payment).toHaveScreenshot("bill-22-activation-payment-detail.png", {
|
||||
animations: "disabled",
|
||||
maxDiffPixelRatio: 0,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
async function goToNextActivationStep(component: import("@playwright/experimental-ct-react").Locator, targetUiId: string): Promise<void> {
|
||||
const next = component.locator('[data-ui-id="ui.billing.activation.next"]');
|
||||
await expect(next).toBeEnabled();
|
||||
await next.click();
|
||||
await expect(component.locator(`[data-ui-id="${targetUiId}"]`)).toBeVisible();
|
||||
if (targetUiId === "ui.billing.activation.plan" || targetUiId === "ui.billing.activation.storage") {
|
||||
const livePrice = component.locator('[data-ui-id="ui.billing.activation.livePrice"]');
|
||||
await expect(livePrice).toContainText("Monatlicher Zahlbetrag");
|
||||
await expect(next).toBeEnabled();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
|
||||
import { Bill20BillingHubVisualFixture as BillingFixture } from "../../apps/web/app/components/screens/billing/bill-20-billing-hub.visual-fixture";
|
||||
import {
|
||||
Bill20CheckoutSuccessVisualFixture as CheckoutSuccessFixture,
|
||||
Bill20TrialSuccessVisualFixture as TrialSuccessFixture,
|
||||
Bill20WelcomeSetupVisualFixture as WelcomeSetupFixture,
|
||||
} from "../../apps/web/app/components/screens/onboarding/bill-20-welcome.visual-fixture";
|
||||
|
||||
test.describe("BILL-20 welcome and billing journey visual baseline", () => {
|
||||
test("confirmed payment hands off to workspace setup", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div style={{ width: "1200px" }}>
|
||||
<CheckoutSuccessFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
await waitForSettledFonts(page);
|
||||
await expect(component.locator('[data-ui-id="ui.subscription.checkout.success.page"]')).toHaveCount(1);
|
||||
await expect(component).toHaveScreenshot("bill-20-checkout-success-desktop.png", { maxDiffPixelRatio: 0 });
|
||||
});
|
||||
|
||||
test("a catalog trial never presents itself as an immediate charge", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div style={{ width: "1200px" }}>
|
||||
<TrialSuccessFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
await waitForSettledFonts(page);
|
||||
await expect(component.getByRole("heading", { name: "Deine Testphase läuft" })).toBeVisible();
|
||||
await expect(component).toContainText("Vor dem angezeigten Ende der Testphase wird nichts berechnet.");
|
||||
await expect(component).toHaveScreenshot("bill-20-checkout-trial-desktop.png", { maxDiffPixelRatio: 0 });
|
||||
});
|
||||
|
||||
test("payment handoff remains clear on mobile", async ({ mount, page }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
const component = await mount(<CheckoutSuccessFixture />);
|
||||
|
||||
await waitForSettledFonts(page);
|
||||
await expect(page.locator("body")).toHaveJSProperty("scrollWidth", 390);
|
||||
await expect(component).toHaveScreenshot("bill-20-checkout-success-mobile.png", { maxDiffPixelRatio: 0 });
|
||||
});
|
||||
|
||||
test("desktop welcome prioritizes automatic setup and team invitation", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div style={{ width: "1200px" }}>
|
||||
<WelcomeSetupFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
await waitForSettledFonts(page);
|
||||
await expect(component.locator('[data-ui-id="ui.onboarding.welcome.checklist"]')).toContainText("Team einladen");
|
||||
await expect(component).toHaveScreenshot("bill-20-welcome-setup-desktop.png", { maxDiffPixelRatio: 0 });
|
||||
});
|
||||
|
||||
test("mobile welcome remains a deliberate setup path without horizontal overflow", async ({ mount, page }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
const component = await mount(<WelcomeSetupFixture />);
|
||||
|
||||
await waitForSettledFonts(page);
|
||||
await expect(component).toHaveCSS("width", "390px");
|
||||
await expect(page.locator("body")).toHaveJSProperty("scrollWidth", 390);
|
||||
await expect(component).toHaveScreenshot("bill-20-welcome-setup-mobile.png", { maxDiffPixelRatio: 0 });
|
||||
});
|
||||
|
||||
test("active billing opens with status and usage instead of a purchase wall", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div style={{ width: "1200px" }}>
|
||||
<BillingFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
await waitForSettledFonts(page);
|
||||
await expect(component.locator('[data-ui-id="ui.billing.selfServiceSubscription.current"]')).toBeVisible();
|
||||
await expect(component.locator('[data-ui-id="ui.billing.selfServiceSubscription.builder"]')).toHaveCount(0);
|
||||
await expect(component).toHaveScreenshot("bill-20-billing-overview-desktop.png", { maxDiffPixelRatio: 0 });
|
||||
});
|
||||
|
||||
test("billing overview remains scannable on mobile", async ({ mount, page }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
const component = await mount(<BillingFixture />);
|
||||
|
||||
await waitForSettledFonts(page);
|
||||
await expect(page.locator("body")).toHaveJSProperty("scrollWidth", 390);
|
||||
await expect(component.locator('[data-ui-id="ui.billing.selfServiceSubscription.managementActions"]')).toBeVisible();
|
||||
await expect(component).toHaveScreenshot("bill-20-billing-overview-mobile.png", { maxDiffPixelRatio: 0 });
|
||||
});
|
||||
|
||||
test("plan and seat management has its own focused surface", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div style={{ width: "1200px" }}>
|
||||
<BillingFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
await component.getByRole("button", { name: "Tarif und Plätze verwalten" }).click();
|
||||
await waitForSettledFonts(page);
|
||||
await expect(component.locator('[data-ui-id="ui.billing.selfServiceSubscription.builder"]')).toBeVisible();
|
||||
await expect(component).toContainText("5 Büro + 15 Baustelle inklusive · 500 GB Speicher");
|
||||
await expect(component).toContainText("10 Büro + 30 Baustelle inklusive · 2 TB Speicher");
|
||||
await expect(component).toHaveScreenshot("bill-20-billing-plan-desktop.png", { maxDiffPixelRatio: 0 });
|
||||
});
|
||||
|
||||
test("commercial add-ons are separated from the base plan", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div style={{ width: "1200px" }}>
|
||||
<BillingFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
await component.getByRole("button", { name: "Zusatzmodule ansehen" }).click();
|
||||
await waitForSettledFonts(page);
|
||||
await expect(component.locator('[data-ui-id="ui.billing.selfServiceSubscription.storageAddOns"]')).toBeVisible();
|
||||
await expect(component.locator('[data-ui-id="ui.billing.selfServiceSubscription.emailMarketing"]')).toBeVisible();
|
||||
await expect(component.locator('[data-ui-id="ui.billing.selfServiceSubscription.customerPortal"]')).toBeVisible();
|
||||
await expect(component).toHaveScreenshot("bill-20-billing-addons-desktop.png", { maxDiffPixelRatio: 0 });
|
||||
});
|
||||
});
|
||||
|
||||
async function waitForSettledFonts(page: import("@playwright/test").Page): Promise<void> {
|
||||
await page.evaluate(async () => document.fonts.ready);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
|
||||
import { PlatformLeadsInterimVisualFixture as VisualFixture } from "../../apps/web/app/components/screens/admin/leads/platform-leads-interim.visual-fixture";
|
||||
|
||||
test.describe("R-LEADS interim UI pixel baseline", () => {
|
||||
test("platform lead inbox stays visually stable in light mode", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid="r-leads-platform-lead-inbox" style={{ width: "1280px", minHeight: "760px" }}>
|
||||
<VisualFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
await expect(component.locator('[data-ui-id="ui.admin.platformLeads.list"]')).toHaveCount(1);
|
||||
await expect(component).toHaveScreenshot("r-leads-platform-lead-inbox.png");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
|
||||
import { SpotlightSearchVisualFixture as VisualFixture } from "../../apps/web/app/components/ui/commandPalettes/spotlight-search.visual-fixture";
|
||||
|
||||
const DIALOG_ID = "ui.surface.commandPalette.portal";
|
||||
const SEARCH_ID = "ui.surface.commandPalette.search";
|
||||
const RESULT_ID = "ui.surface.commandPalette.result.project.project1";
|
||||
|
||||
test.describe("R-P11a Spotlight interim UI pixel baseline", () => {
|
||||
test("desktop modal stays visually stable", async ({ mount, page }) => {
|
||||
await mount(<VisualFixture />);
|
||||
await prepareReadyResults(page);
|
||||
|
||||
const dialog = page.locator(`[data-ui-id="${DIALOG_ID}"]`);
|
||||
await expect(dialog).toBeVisible();
|
||||
const viewport = page.viewportSize();
|
||||
const box = await dialog.boundingBox();
|
||||
expect(viewport).not.toBeNull();
|
||||
expect(box).not.toBeNull();
|
||||
expect(Math.abs(box!.x - (viewport!.width - box!.width) / 2)).toBeLessThan(1);
|
||||
expect(box!.x).toBeGreaterThanOrEqual(0);
|
||||
expect(box!.y).toBeGreaterThanOrEqual(0);
|
||||
await expect(dialog).toHaveScreenshot("r-p11a-spotlight-desktop.png");
|
||||
});
|
||||
|
||||
test("mobile viewport overlay stays visually stable", async ({ mount, page }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await mount(<VisualFixture />);
|
||||
await prepareReadyResults(page);
|
||||
|
||||
const dialog = page.locator(`[data-ui-id="${DIALOG_ID}"]`);
|
||||
await expect(dialog).toBeVisible();
|
||||
await expect(dialog).toHaveCSS("height", "844px");
|
||||
await expect(dialog).toHaveCSS("width", "390px");
|
||||
expect(await dialog.boundingBox()).toEqual({ x: 0, y: 0, width: 390, height: 844 });
|
||||
await expect(dialog).toHaveScreenshot("r-p11a-spotlight-mobile.png");
|
||||
});
|
||||
});
|
||||
|
||||
async function prepareReadyResults(page: import("@playwright/test").Page) {
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
await page.locator(`[data-ui-id="${SEARCH_ID}"]`).fill("solar");
|
||||
await expect(page.locator(`[data-ui-id="${RESULT_ID}"]`)).toBeVisible();
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
import AxeBuilder from "@axe-core/playwright";
|
||||
|
||||
import {
|
||||
CustomerPortalInterimVisualFixture as VisualFixture,
|
||||
CustomerPortalProjectDetailInterimVisualFixture as ProjectDetailFixture,
|
||||
} from "../../apps/web/app/components/screens/customer-portal/customer-portal-interim.visual-fixture";
|
||||
|
||||
test.describe("VA-P26a customer portal interim UI", () => {
|
||||
test("access-scoped dashboard stays visually stable in light mode", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid="va-p26a-customer-portal-dashboard" style={{ width: "1280px", minHeight: "720px" }}>
|
||||
<VisualFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
await expect(component.locator('[data-ui-id="ui.customerPortal.portalShell"]')).toHaveCount(1);
|
||||
await expect(component.locator('[data-ui-id="ui.customerPortal.projectCard"]')).toHaveCount(1);
|
||||
await expect(component).toContainText("Montagefreigabe.pdf");
|
||||
await expect(component).toHaveScreenshot("va-p26a-customer-portal-dashboard.png");
|
||||
});
|
||||
|
||||
test("ready project detail meets WCAG 2 A/AA", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid="va-p26a-customer-portal-project-detail" style={{ width: "1280px", minHeight: "720px" }}>
|
||||
<ProjectDetailFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
await expect(component.locator('[data-ui-id="ui.customerPortal.portalShell"]')).toHaveCount(1);
|
||||
await expect(component.getByRole("progressbar")).toHaveCount(1);
|
||||
|
||||
const results = await new AxeBuilder({ page })
|
||||
.include('[data-ui-id="ui.customerPortal.portalShell"]')
|
||||
.withTags(["wcag2a", "wcag2aa"])
|
||||
.analyze();
|
||||
expect(results.violations).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,111 @@
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
import AxeBuilder from "@axe-core/playwright";
|
||||
|
||||
import {
|
||||
P26bInteractionsInterimVisualFixture,
|
||||
P26bInterimVisualFixture as VisualFixture,
|
||||
type P26bInterimVisualScreen,
|
||||
} from "../../apps/web/app/components/screens/customer-portal/p26b-interim.visual-fixture";
|
||||
|
||||
const VISUAL_SCREENS = ["interactions", "lifecycle", "admin", "service-inbox"] as const satisfies readonly P26bInterimVisualScreen[];
|
||||
const ADMIN_AREAS = [
|
||||
{ tab: "Nutzer", screenshot: "va-p26b-customer-portal-admin-users.png" },
|
||||
{ tab: "Freigaben", screenshot: "va-p26b-customer-portal-admin-releases.png" },
|
||||
{ tab: "Domain & Mail", screenshot: "va-p26b-customer-portal-admin-domain-mail.png" },
|
||||
] as const;
|
||||
|
||||
test.describe("VA-P26b customer portal interim UI pixel baselines", () => {
|
||||
for (const screen of VISUAL_SCREENS) {
|
||||
test(`${screen} stays visually stable in light mode`, async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid={`va-p26b-${screen}`} style={{ width: "1280px", minHeight: "720px" }}>
|
||||
<VisualFixture screen={screen} />
|
||||
</div>
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
await expect(component.locator(`[data-ui-id="${screenUiId(screen)}"]`)).toHaveCount(1);
|
||||
if (screen === "interactions") {
|
||||
await expect(component).toContainText("baustelle.jpg");
|
||||
await expect(component).toContainText("Reklamation melden");
|
||||
}
|
||||
if (screen === "admin") await expect(component).toContainText("Einrichtung auf einen Blick");
|
||||
await expect(component).toHaveScreenshot(`va-p26b-customer-portal-${screen}.png`);
|
||||
});
|
||||
}
|
||||
|
||||
for (const area of ADMIN_AREAS) {
|
||||
test(`admin ${area.tab} area stays visually stable in light mode`, async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid="va-p26b-admin-area" style={{ width: "1280px", minHeight: "720px" }}>
|
||||
<VisualFixture screen="admin" />
|
||||
</div>
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
await component.getByRole("tab", { name: area.tab }).click();
|
||||
|
||||
await expect(component.getByRole("tabpanel")).toBeVisible();
|
||||
await expect(component).toHaveScreenshot(area.screenshot);
|
||||
});
|
||||
}
|
||||
|
||||
test("expanded admin basic settings stay visually stable in light mode", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid="va-p26b-admin-basic-settings" style={{ width: "1280px", minHeight: "720px" }}>
|
||||
<VisualFixture screen="admin" />
|
||||
</div>
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
await component.getByRole("button", { name: "Grundeinstellungen bearbeiten" }).click();
|
||||
|
||||
await expect(component.getByText("Grundeinstellungen", { exact: true })).toBeVisible();
|
||||
await expect(component).toHaveScreenshot("va-p26b-customer-portal-admin-basic-settings.png");
|
||||
});
|
||||
|
||||
test("admin areas remain usable without horizontal overflow on mobile", async ({ mount, page }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
const component = await mount(
|
||||
<div style={{ width: "390px", minHeight: "844px" }}>
|
||||
<VisualFixture screen="admin" />
|
||||
</div>
|
||||
);
|
||||
|
||||
for (const name of ["Übersicht", "Nutzer", "Freigaben", "Domain & Mail"]) {
|
||||
await component.getByRole("tab", { name }).click();
|
||||
expect(await component.evaluate((element) => element.scrollWidth - element.clientWidth)).toBeLessThanOrEqual(1);
|
||||
}
|
||||
});
|
||||
|
||||
test("complaint action stays named during the post-submit loading state", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div style={{ width: "1280px", minHeight: "720px" }}>
|
||||
<P26bInteractionsInterimVisualFixture busy />
|
||||
</div>
|
||||
);
|
||||
|
||||
const interactions = component.locator('[data-ui-id="ui.customerPortal.projectInteractions"]');
|
||||
const complaintButton = interactions.getByRole("button", { name: "Reklamation senden" });
|
||||
await expect(interactions.getByText("Deine Reklamation wurde gespeichert und das Projektteam informiert.")).toBeVisible();
|
||||
await expect(complaintButton).toBeDisabled();
|
||||
await expect(complaintButton).toHaveAttribute("aria-label", "Reklamation senden");
|
||||
|
||||
const results = await new AxeBuilder({ page }).include('[data-ui-id="ui.customerPortal.projectInteractions"]').withRules(["button-name"]).analyze();
|
||||
expect(results.violations).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
function screenUiId(screen: (typeof VISUAL_SCREENS)[number]): string {
|
||||
if (screen === "interactions") return "ui.customerPortal.projectInteractions";
|
||||
if (screen === "lifecycle") return "ui.customerPortal.lifecycle";
|
||||
if (screen === "admin") return "ui.customerPortal.admin";
|
||||
return "ui.customerPortal.serviceInbox";
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
|
||||
import { P26cDomainPendingSwitchVisualFixture } from "../../apps/web/app/components/screens/customer-portal/p26c-domain-interim.visual-fixture";
|
||||
|
||||
test.describe("VA-P26c customer portal domain-admin interim UI pixel baseline", () => {
|
||||
test("pending verified domain switch stays visually stable in light mode", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid="va-p26c-domain-admin" style={{ width: "1280px", minHeight: "900px" }}>
|
||||
<P26cDomainPendingSwitchVisualFixture />
|
||||
</div>,
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
await expect(component.locator('[data-ui-id="ui.customerPortal.domainAdmin"]')).toHaveCount(1);
|
||||
await expect(component).toContainText("portal.acme.de");
|
||||
await expect(component).toContainText("hivegrid-verification-proof-once");
|
||||
await expect(component).toHaveScreenshot("va-p26c-customer-portal-domain-admin.png", { fullPage: true });
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
import AxeBuilder from "@axe-core/playwright";
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
|
||||
import { AdminFeatureFlagBulkVisualFixture as VisualFixture } from "../../apps/web/app/components/screens/admin/sales/feature-flags/admin-feature-flag-bulk.visual-fixture";
|
||||
|
||||
test.describe("VA-P28b feature-flag rollout interim UI", () => {
|
||||
test("shows deterministic rollout sources and stays visually stable", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid="va-p28b-feature-flag-rollout" style={{ width: "1280px", minHeight: "760px" }}>
|
||||
<VisualFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
await expect(component.locator('[data-ui-id="ui.admin.sales.featureFlags.bulkPage"]')).toHaveCount(1);
|
||||
await expect(component.getByText("Muster SHK GmbH")).toBeVisible();
|
||||
await expect(component).toHaveScreenshot("va-p28b-feature-flag-rollout.png");
|
||||
});
|
||||
|
||||
test("meets WCAG 2 A/AA", async ({ mount, page }) => {
|
||||
await mount(
|
||||
<div style={{ width: "1280px", minHeight: "760px" }}>
|
||||
<VisualFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
const results = await new AxeBuilder({ page })
|
||||
.include('[data-ui-id="ui.admin.sales.featureFlags.bulkPage"]')
|
||||
.withTags(["wcag2a", "wcag2aa"])
|
||||
.analyze();
|
||||
|
||||
expect(results.violations).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,41 @@
|
||||
// Interim pixel baseline for the VD-MCP connect dialog (AD-28, DoD D.21).
|
||||
// The PNG baselines are not committed: this suite is not part of CI, and the
|
||||
// Playwright browser download was not available on the authoring machine. Run
|
||||
// `npx playwright install chromium` once, then
|
||||
// `npx playwright test --config=playwright-ct.config.ts vd-mcp-connect-interim --update-snapshots`
|
||||
// to write them.
|
||||
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
|
||||
import { McpConnectEmptyVisualFixture, McpConnectVisualFixture } from "../../apps/web/app/components/mcp/mcp-connect.visual-fixture";
|
||||
|
||||
const DIALOG_ID = "ui.mcp.connect.dialog";
|
||||
const CONNECTOR_ID = "ui.mcp.connect.connectorUrl";
|
||||
|
||||
test.describe("VD-MCP connect dialog interim UI pixel baseline", () => {
|
||||
test("desktop dialog stays visually stable", async ({ mount, page }) => {
|
||||
await mount(<McpConnectVisualFixture />);
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
const dialog = page.locator(`[data-ui-id="${DIALOG_ID}"]`);
|
||||
await expect(dialog).toBeVisible();
|
||||
// The connector URL is the one value a user must copy correctly; if it ever
|
||||
// renders truncated or empty the screenshot alone would not say so.
|
||||
await expect(page.locator(`[data-ui-id="${CONNECTOR_ID}"]`)).toContainText("https://mcp.hivegrid.example");
|
||||
await expect(dialog).toHaveScreenshot("vd-mcp-connect-desktop.png");
|
||||
});
|
||||
|
||||
test("empty connection list stays visually stable", async ({ mount, page }) => {
|
||||
await mount(<McpConnectEmptyVisualFixture />);
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
const dialog = page.locator(`[data-ui-id="${DIALOG_ID}"]`);
|
||||
await expect(dialog).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.mcp.connect.connections.empty"]')).toBeVisible();
|
||||
await expect(dialog).toHaveScreenshot("vd-mcp-connect-empty.png");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,104 @@
|
||||
import AxeBuilder from "@axe-core/playwright";
|
||||
import { expect, test } from "@playwright/experimental-ct-react";
|
||||
|
||||
import {
|
||||
AdminRolesInterimVisualFixture as RolesVisualFixture,
|
||||
AdminSecurityInterimVisualFixture as VisualFixture,
|
||||
} from "../../apps/web/app/components/screens/admin/sales/security/admin-security-interim.visual-fixture";
|
||||
import { AdminPersonalizedDashboardVisualFixture as DashboardVisualFixture } from "../../apps/web/app/components/screens/admin/admin-personalized-dashboard.visual-fixture";
|
||||
|
||||
test.describe("VR-P28a admin identity interim UI", () => {
|
||||
test("admin identity list stays visually stable in light mode", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid="vr-p28a-admin-security" style={{ width: "1280px", minHeight: "760px" }}>
|
||||
<VisualFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
await expect(component.locator('[data-ui-id="ui.admin.sales.security.adminUsersPage"]')).toHaveCount(1);
|
||||
await expect(component).toHaveScreenshot("vr-p28a-admin-security.png");
|
||||
});
|
||||
|
||||
test("admin identity list meets WCAG 2 A/AA", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid="vr-p28a-admin-security-a11y" style={{ width: "1280px", minHeight: "760px" }}>
|
||||
<VisualFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
const results = await new AxeBuilder({ page })
|
||||
.include('[data-ui-id="ui.admin.sales.security.adminUsersPage"]')
|
||||
.withTags(["wcag2a", "wcag2aa"])
|
||||
.analyze();
|
||||
|
||||
expect(results.violations).toEqual([]);
|
||||
await expect(component.getByRole("heading", { name: "Plattform-Admins" })).toHaveCount(1);
|
||||
});
|
||||
|
||||
test("role editor groups permissions and summarizes visible areas", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid="vr-p28a-admin-roles" style={{ width: "1280px", minHeight: "1400px" }}>
|
||||
<RolesVisualFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
await expect(component.getByText("Tatsächlich sichtbare Admin-Bereiche")).toHaveCount(1);
|
||||
await expect(component).toHaveScreenshot("vr-p28a-admin-roles.png", { fullPage: true });
|
||||
});
|
||||
|
||||
test("grouped role editor meets WCAG 2 A/AA", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid="vr-p28a-admin-roles-a11y" style={{ width: "1280px", minHeight: "1400px" }}>
|
||||
<RolesVisualFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
const results = await new AxeBuilder({ page })
|
||||
.include('[data-ui-id="ui.admin.sales.security.adminRolesPage"]')
|
||||
.withTags(["wcag2a", "wcag2aa"])
|
||||
.analyze();
|
||||
|
||||
expect(results.violations).toEqual([]);
|
||||
await expect(component.getByRole("heading", { name: "Admin-Rollen" })).toHaveCount(1);
|
||||
});
|
||||
|
||||
test("combined-role dashboard stays visually stable", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid="vr-p28a-admin-dashboard" style={{ width: "1280px", minHeight: "760px", padding: "24px" }}>
|
||||
<DashboardVisualFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
await document.fonts.ready;
|
||||
});
|
||||
|
||||
await expect(component.getByText("Vertrieb")).toHaveCount(1);
|
||||
await expect(component.getByText("Engineering")).toHaveCount(1);
|
||||
await expect(component).toHaveScreenshot("vr-p28a-admin-dashboard.png");
|
||||
});
|
||||
|
||||
test("combined-role dashboard meets WCAG 2 A/AA", async ({ mount, page }) => {
|
||||
const component = await mount(
|
||||
<div data-testid="vr-p28a-admin-dashboard-a11y" style={{ width: "1280px", minHeight: "760px", padding: "24px" }}>
|
||||
<DashboardVisualFixture />
|
||||
</div>
|
||||
);
|
||||
|
||||
const results = await new AxeBuilder({ page })
|
||||
.include('[data-ui-id="ui.admin.personalizedDashboard"]')
|
||||
.withTags(["wcag2a", "wcag2aa"])
|
||||
.analyze();
|
||||
|
||||
expect(results.violations).toEqual([]);
|
||||
await expect(component.getByRole("heading", { name: "Dein Arbeitsbereich" })).toHaveCount(1);
|
||||
});
|
||||
});
|
||||
@@ -1,14 +1,13 @@
|
||||
import { expect, test, type Page } from "./utils/test";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { loginAsTenantUser } from "./utils/auth";
|
||||
import { loginAsAdminUser } from "./utils/auth";
|
||||
import { expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
|
||||
import { escapeRegExp, interceptCurrentRoutePost, postDataIncludesField, skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
// Admin-host pages need a dedicated OPERATOR admin user — the shared tenant user
|
||||
// must not be one (it would redirect to the admin host on login and break every
|
||||
// tenant-app login flow). The seed provisions `e2e.admin@example.test` with an
|
||||
// AdminUser row + the global SuperAdmin role and emits E2E_ADMIN_EMAIL/PASSWORD.
|
||||
// Admin-host pages use the canonical local platform admin. The shared tenant
|
||||
// user must not be an operator (it would redirect to the admin host and break
|
||||
// tenant-app login flows), so the seed emits the identities separately.
|
||||
const adminCredentials =
|
||||
process.env.E2E_ADMIN_EMAIL && process.env.E2E_ADMIN_PASSWORD
|
||||
? { email: process.env.E2E_ADMIN_EMAIL, password: process.env.E2E_ADMIN_PASSWORD }
|
||||
@@ -97,7 +96,7 @@ test.describe("admin email sequences mobile a11y", () => {
|
||||
});
|
||||
|
||||
async function openAdminEmailSequences(page: Page): Promise<void> {
|
||||
await loginAsTenantUser(page, adminCredentials!);
|
||||
await loginAsAdminUser(page, adminCredentials!);
|
||||
const response = await page.goto(adminEmailSequencesPath!, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "Admin email sequence path is not reachable in this environment");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { loginAsAdminUser } from "./utils/auth";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
const credentials = process.env.E2E_ADMIN_EMAIL && process.env.E2E_ADMIN_PASSWORD
|
||||
? { email: process.env.E2E_ADMIN_EMAIL, password: process.env.E2E_ADMIN_PASSWORD }
|
||||
: null;
|
||||
|
||||
test.describe("AK-P19 platform admin interim screens", () => {
|
||||
test("opens billing, jobs, health and support through the admin host", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_ADMIN_EMAIL", "E2E_ADMIN_PASSWORD"], "Skipping authenticated platform-admin smoke");
|
||||
await loginAsAdminUser(page, credentials!);
|
||||
const routes = ["/accounts/billing", "/jobs", "/health", "/support", "/accounts/new"] as const;
|
||||
const ids = ["ui.admin.billing.page", "ui.admin.jobs.page", "ui.admin.health.page", "ui.admin.support.page", "ui.admin.accounts.create.page"] as const;
|
||||
|
||||
for (let index = 0; index < routes.length; index += 1) {
|
||||
const response = await page.goto(routes[index], { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, `AK-P19 admin route ${routes[index]} is unavailable`);
|
||||
await expect(page.locator(`[data-ui-id="${ids[index]}"]`)).toBeVisible();
|
||||
}
|
||||
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
});
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { loginAsTenantUser } from "./utils/auth";
|
||||
import { loginAsAdminUser } from "./utils/auth";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
@@ -24,7 +24,7 @@ const auditPath = process.env.E2E_ADMIN_AUDIT_PATH ?? "/audit";
|
||||
test.describe("audit viewer smoke", () => {
|
||||
test("renders the audit list with filter bar and export CTA", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_ADMIN_EMAIL", "E2E_ADMIN_PASSWORD"], "Audit smoke inputs not configured");
|
||||
await loginAsTenantUser(page, adminCredentials!);
|
||||
await loginAsAdminUser(page, adminCredentials!);
|
||||
|
||||
const response = await page.goto(auditPath, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "Audit path is not reachable in this environment");
|
||||
|
||||
@@ -23,8 +23,7 @@ test.describe("auth golden path", () => {
|
||||
|
||||
const passwordInput = page.locator('input[type="password"], input[name="password"], input#password').first();
|
||||
if ((await passwordInput.count()) > 0 && (await passwordInput.isVisible())) {
|
||||
const requirements = page.locator('[aria-live="polite"]').first();
|
||||
await expect(requirements).toBeVisible();
|
||||
await expect(page.getByRole("progressbar", { name: /password strength|passwortstärke/iu })).toHaveAttribute("aria-label");
|
||||
}
|
||||
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
@@ -8,8 +8,8 @@ const authRoutes = ["/login", "/forgot-password", "/reset", "/auth/magic-link",
|
||||
// before auth and redirects home instead. Falls back to the default-seed "acme".
|
||||
const tenantSlug = process.env.E2E_TENANT_ACCOUNT_SLUG ?? "acme";
|
||||
const tenantProtectedRoutes = [
|
||||
`/${tenantSlug}/settings/plugins`,
|
||||
`/${tenantSlug}/settings/subscription`,
|
||||
`/${tenantSlug}/settings/integrations/plugins`,
|
||||
`/${tenantSlug}/settings/billing`,
|
||||
`/${tenantSlug}/workflow-engine`,
|
||||
`/${tenantSlug}/workflow-engine/workflows/example/run/manual`,
|
||||
];
|
||||
|
||||
@@ -39,10 +39,10 @@ test.describe("authenticated mobile locale persistence", () => {
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(dashboardPath)}(?:[?#].*)?$`, "u"));
|
||||
await expectAuthenticatedLocaleMobileReadinessPage(page, targetLocale);
|
||||
|
||||
const mobileSidebar = page.locator('[data-ui-id="ui.surface.app.sidebar.mobile"], [data-mobile="true"]').first();
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
const mobileSidebar = page.locator('[data-ui-id="ui.surface.app.sidebar"]').first();
|
||||
await expect.poll(() => sidebarLeft(mobileSidebar)).toBeLessThan(0);
|
||||
await page.locator('[data-ui-id="ui.action.shell.sidebarTrigger"]').click();
|
||||
await expect(mobileSidebar).toBeVisible();
|
||||
await expect.poll(() => sidebarLeft(mobileSidebar)).toBeGreaterThanOrEqual(0);
|
||||
await expect(mobileSidebar.locator('[data-ui-id="ui.nav.app.dashboard"]').first()).toBeVisible();
|
||||
|
||||
const settingsLink = mobileSidebar.locator('[data-ui-id="ui.nav.app.settings"]').first();
|
||||
@@ -50,7 +50,7 @@ test.describe("authenticated mobile locale persistence", () => {
|
||||
await settingsLink.click();
|
||||
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(tenantSettingsProfilePath(dashboardPath))}(?:[?#].*)?$`, "u"));
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
await expect.poll(() => sidebarLeft(mobileSidebar)).toBeLessThan(0);
|
||||
await expectAuthenticatedLocaleMobileReadinessPage(page, targetLocale);
|
||||
} finally {
|
||||
await restoreLocale(page, initialLocale);
|
||||
@@ -58,6 +58,10 @@ test.describe("authenticated mobile locale persistence", () => {
|
||||
});
|
||||
});
|
||||
|
||||
async function sidebarLeft(sidebar: ReturnType<Page["locator"]>): Promise<number> {
|
||||
return (await sidebar.boundingBox())?.x ?? Number.NEGATIVE_INFINITY;
|
||||
}
|
||||
|
||||
async function currentHtmlLocale(page: Page): Promise<string> {
|
||||
return (await page.locator("html").getAttribute("lang")) ?? "";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
// R-P12b flow editor smoke (DoD 19): login -> /automations -> open the flow
|
||||
// editor -> the fullscreen canvas renders, the picker drawer opens from the
|
||||
// bottom toolbar, and the dry-run dialog opens without side effects.
|
||||
|
||||
import { expect, test } from "./utils/test";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const automationsPath = process.env.E2E_TENANT_AUTOMATIONS_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/automations");
|
||||
|
||||
test.describe("automation flow editor (R-P12b)", () => {
|
||||
test("opens the editor, the picker drawer, and the dry-run dialog", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Skipping authenticated automations smoke");
|
||||
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
const listResponse = await page.goto(automationsPath, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, listResponse, automationsPath);
|
||||
|
||||
// The list links every rule to its editor route; without a seeded rule the
|
||||
// smoke cannot exercise the editor and is skipped rather than red.
|
||||
const editLink = page.locator(`a[href*="/automations/"][href$="/edit"]`).first();
|
||||
if ((await editLink.count()) === 0) {
|
||||
test.skip(true, "No automation rule available to open the flow editor");
|
||||
}
|
||||
await editLink.click();
|
||||
await page.waitForURL(/\/automations\/[^/]+\/edit/u);
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.automation.editor"]')).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.automation.editor.canvas"]')).toBeVisible();
|
||||
await expect(page.locator(".react-flow__node").first()).toBeVisible({ timeout: 10_000 });
|
||||
|
||||
// Main action: the picker drawer opens and offers catalog nodes.
|
||||
await page.locator('[data-ui-id="ui.automation.editor.openPicker"]').click();
|
||||
await expect(page.locator('[data-ui-id="ui.automation.editor.picker"]')).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id^="ui.automation.editor.picker.category."]').first()).toBeVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
|
||||
// Dry run stays a preview: the dialog opens, nothing is submitted yet.
|
||||
await page.locator('[data-ui-id="ui.automation.editor.dryRunTrigger"]').click();
|
||||
await expect(page.locator('[data-ui-id="ui.automation.editor.dryRun"]')).toBeVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
|
||||
// No horizontal page overflow on the fullscreen editor.
|
||||
const overflow = await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth);
|
||||
expect(overflow).toBeLessThanOrEqual(1);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,54 @@
|
||||
import { mkdir } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
import { expect, test, type Page, type TestInfo } from "@playwright/test";
|
||||
|
||||
const reviewDirectory = process.env.BILL14_SCREENSHOT_DIR?.trim();
|
||||
|
||||
async function capture(page: Page, testInfo: TestInfo, name: string): Promise<void> {
|
||||
const screenshotPath = reviewDirectory ? path.join(reviewDirectory, `${name}.png`) : testInfo.outputPath(`${name}.png`);
|
||||
await mkdir(path.dirname(screenshotPath), { recursive: true });
|
||||
await page.screenshot({ path: screenshotPath, fullPage: true, animations: "disabled" });
|
||||
}
|
||||
|
||||
test.describe("BILL-14 public registration plan advisor", () => {
|
||||
test("keeps account data while recommending and overriding a team plan", async ({ page }, testInfo) => {
|
||||
const adviceReady = page.waitForResponse((response) => {
|
||||
const url = new URL(response.url());
|
||||
return url.pathname === "/auth/registration-plan-advice" && response.status() === 200;
|
||||
});
|
||||
await page.goto("/register");
|
||||
await adviceReady;
|
||||
await expect(page.locator('[data-ui-id="ui.auth.register.accountStep"]')).toBeVisible();
|
||||
await capture(page, testInfo, "01-register-account");
|
||||
|
||||
await page.locator('[data-ui-id="ui.auth.register.email"]').fill("bill14-visual@example.test");
|
||||
const password = page.locator('[data-ui-id="ui.auth.register.password"]');
|
||||
if (await password.isVisible().catch(() => false)) await password.fill("HiveGrid-BILL14-Visual-2026!");
|
||||
await page.locator('[data-ui-id="ui.auth.register.firstName"]').fill("Ada");
|
||||
await page.locator('[data-ui-id="ui.auth.register.lastName"]').fill("Lovelace");
|
||||
await page.locator('[data-ui-id="ui.auth.register.company"]').fill("BILL-14 Review GmbH");
|
||||
const teamStepButton = page.getByRole("button", { name: /Set team size|Teamgröße festlegen/u });
|
||||
await expect(teamStepButton).toBeEnabled();
|
||||
await teamStepButton.click();
|
||||
|
||||
const planStep = page.locator('[data-ui-id="ui.auth.register.planStep"]');
|
||||
await expect(planStep).toBeVisible();
|
||||
await capture(page, testInfo, "02-register-team-default");
|
||||
|
||||
await page.locator('[data-ui-id="ui.auth.register.officeSeats"]').getByRole("spinbutton").fill("5");
|
||||
await page.locator('[data-ui-id="ui.auth.register.fieldSeats"]').getByRole("spinbutton").fill("15");
|
||||
await page.getByRole("button", { name: /View plans and live prices|Tarife und Live-Preise anzeigen/u }).click();
|
||||
const recommendedSwarm = planStep.getByRole("radio", { name: /Swarm/u });
|
||||
await expect(recommendedSwarm).toBeChecked();
|
||||
await expect(recommendedSwarm.locator("xpath=..").getByText(/Empfohlen|Recommended/u)).toBeVisible();
|
||||
await capture(page, testInfo, "03-register-team-recommended");
|
||||
|
||||
await planStep.getByRole("radio", { name: /Core/u }).click();
|
||||
await capture(page, testInfo, "04-register-team-manual-override");
|
||||
await page.getByRole("button", { name: /Back to team size|Zurück zur Teamgröße/u }).click();
|
||||
await page.getByRole("button", { name: /Back to account details|Zurück zu den Kontodaten/u }).click();
|
||||
await expect(page.locator('[data-ui-id="ui.auth.register.company"]')).toHaveValue("BILL-14 Review GmbH");
|
||||
await capture(page, testInfo, "05-register-back-navigation");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,29 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
|
||||
/**
|
||||
* Public-Booking smoke (AK-P16b / DoD D.19): oeffentliche Buchungsseite
|
||||
* /b/{tenant}/{slug} oeffnen -> Buchungsformular sichtbar.
|
||||
*
|
||||
* Kein Login (public Route). Braucht eine published BookingPage im
|
||||
* Ziel-Environment; der Pfad kommt aus `E2E_PUBLIC_BOOKING_PATH`
|
||||
* (z.B. /b/demo-pro-crm/beratungstermin — Slug aus dem Staging-Seed
|
||||
* `seedDemoTenantBookingData`). Bewusst weicher Skip statt
|
||||
* REQUIRE_E2E_READINESS-fail-closed: die Readiness-Lane seedet (noch)
|
||||
* keine Booking-Fixtures.
|
||||
*/
|
||||
const bookingPath = process.env.E2E_PUBLIC_BOOKING_PATH;
|
||||
|
||||
test.describe("public booking smoke", () => {
|
||||
test("renders the public booking page with the booking form", async ({ page }) => {
|
||||
test.skip(!bookingPath?.trim(), "E2E_PUBLIC_BOOKING_PATH not configured");
|
||||
|
||||
const response = await page.goto(bookingPath!, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "Public booking path is not reachable in this environment");
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.booking.public"]')).toBeVisible();
|
||||
// Hauptaktion: das Buchungsformular (Slot-Auswahl + Submit) ist da — oder
|
||||
// die Seite meldet ehrlich "keine Slots" (Empty-State, DoD E.23).
|
||||
await expect(page.locator('[data-ui-id="ui.booking.public.form"], [data-ui-id="ui.booking.public.empty"]').first()).toBeVisible();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,95 @@
|
||||
// AK-P15b interim-UI smoke (AD-28): log in, open the dedicated private
|
||||
// readiness channel, send through the live WebSocket gateway, then reload and
|
||||
// prove that the acknowledged message was persisted by the server.
|
||||
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { skipIfUnavailable, waitForHydration } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eInputsMissing, skipOrFailWhenE2eOptInMissing } from "./utils/readiness";
|
||||
import { expect, test } from "./utils/test";
|
||||
|
||||
const credentials = getTenantCredentials();
|
||||
const peerCredentials =
|
||||
process.env.E2E_PLUGIN_READONLY_EMAIL && process.env.E2E_PLUGIN_READONLY_PASSWORD
|
||||
? { email: process.env.E2E_PLUGIN_READONLY_EMAIL, password: process.env.E2E_PLUGIN_READONLY_PASSWORD }
|
||||
: null;
|
||||
const chatPath = process.env.E2E_TENANT_CHAT_PATH;
|
||||
|
||||
test.describe("AK-P15b team chat interim smoke", () => {
|
||||
test.beforeEach(() => {
|
||||
skipOrFailWhenE2eInputsMissing(
|
||||
["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_PLUGIN_READONLY_EMAIL", "E2E_PLUGIN_READONLY_PASSWORD", "E2E_TENANT_CHAT_PATH"],
|
||||
"Team chat smoke inputs not configured"
|
||||
);
|
||||
skipOrFailWhenE2eOptInMissing("E2E_ALLOW_CHAT_SEND", "skipping the mutating team chat send flow");
|
||||
});
|
||||
|
||||
test("delivers typing, messages, and reads live between two members, then reloads the persisted result", async ({ browser, page }, testInfo) => {
|
||||
const peerContext = await browser.newContext();
|
||||
const peerPage = await peerContext.newPage();
|
||||
|
||||
try {
|
||||
await loginAsTenantUser(peerPage, peerCredentials!);
|
||||
const peerChatUrl = new URL(chatPath!, peerPage.url()).toString();
|
||||
const peerResponse = await peerPage.goto(peerChatUrl, { waitUntil: "domcontentloaded" });
|
||||
await waitForHydration(peerPage);
|
||||
await skipIfUnavailable(peerPage, peerResponse, `Team chat channel path ${chatPath}`);
|
||||
expect(peerResponse?.ok(), `Peer team chat channel returned ${peerResponse?.status() ?? "no response"}`).toBe(true);
|
||||
|
||||
const peerScreen = peerPage.locator('[data-ui-id="ui.chat.channelDetail"]').first();
|
||||
await expect(peerScreen).toBeVisible();
|
||||
await expect(peerScreen.locator("[data-connection-state]")).toHaveCount(0, { timeout: 45_000 });
|
||||
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const chatUrl = new URL(chatPath!, page.url()).toString();
|
||||
const response = await page.goto(chatUrl, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, `Team chat channel path ${chatPath}`);
|
||||
expect(response?.ok(), `Team chat channel returned ${response?.status() ?? "no response"}`).toBe(true);
|
||||
|
||||
const screen = page.locator('[data-ui-id="ui.chat.channelDetail"]').first();
|
||||
await expect(screen).toBeVisible();
|
||||
|
||||
// The connection alert is rendered for every non-online state. Waiting for
|
||||
// it to disappear proves authentication and channel gap-sync completed.
|
||||
await expect(screen.locator("[data-connection-state]")).toHaveCount(0, { timeout: 45_000 });
|
||||
await expect(screen.locator('[data-ui-id="ui.chat.channelDetail.presence"]')).toBeVisible({ timeout: 15_000 });
|
||||
|
||||
const peerComposer = peerScreen.locator('[data-ui-id="ui.chat.channelDetail.composer"] textarea').first();
|
||||
await peerComposer.fill(`typing probe ${Date.now()}`);
|
||||
await expect(screen.locator('[data-ui-id="ui.chat.channelDetail.typing"]')).toBeVisible({ timeout: 10_000 });
|
||||
await peerComposer.fill("");
|
||||
|
||||
const body = `E2E chat smoke ${testInfo.project.name} ${Date.now()}`;
|
||||
const composer = screen.locator('[data-ui-id="ui.chat.channelDetail.composer"] textarea').first();
|
||||
await expect(composer).toBeVisible();
|
||||
await expect(composer).toBeEnabled();
|
||||
await composer.fill(body);
|
||||
|
||||
const sendButton = screen.getByRole("button", { name: /^(Senden|Send)$/iu }).first();
|
||||
await expect(sendButton).toBeEnabled();
|
||||
await sendButton.click();
|
||||
|
||||
const acknowledgedMessage = screen.locator("[data-message-id]").filter({ hasText: body }).last();
|
||||
await expect(acknowledgedMessage).toBeVisible();
|
||||
const acknowledgedDelivery = acknowledgedMessage.locator("[data-delivery-state]").first();
|
||||
await expect(acknowledgedDelivery).toHaveAttribute("data-delivery-state", "sent", { timeout: 30_000 });
|
||||
await expect(acknowledgedDelivery).toHaveAttribute("data-transport-source", /^(http_ack|websocket)$/u);
|
||||
|
||||
const peerLiveMessage = peerScreen.locator("[data-message-id]").filter({ hasText: body }).last();
|
||||
await expect(peerLiveMessage).toBeVisible({ timeout: 15_000 });
|
||||
await expect(peerLiveMessage.locator("[data-delivery-state]").first()).toHaveAttribute("data-transport-source", "websocket");
|
||||
|
||||
const readReceipt = acknowledgedMessage.locator('[data-ui-id="ui.chat.channelDetail.readReceipt"]');
|
||||
await expect(readReceipt).toHaveAttribute("data-read-count", "1", { timeout: 15_000 });
|
||||
await expect(readReceipt).toHaveAttribute("data-recipient-count", "1");
|
||||
|
||||
await page.reload({ waitUntil: "domcontentloaded" });
|
||||
|
||||
const persistedMessage = page.locator('[data-ui-id="ui.chat.channelDetail"] [data-message-id]').filter({ hasText: body }).last();
|
||||
await expect(persistedMessage).toBeVisible({ timeout: 15_000 });
|
||||
await expect(persistedMessage.locator("[data-delivery-state]").first()).toHaveAttribute("data-transport-source", "persisted");
|
||||
} finally {
|
||||
await peerContext.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,65 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
/**
|
||||
* CRM interim-UI smoke (R-P6, AD-28, DoD D.19): Login -> /contacts open ->
|
||||
* the interim list screen from ~/ui renders -> main action: follow the
|
||||
* "new contact" button into the inline create dialog -> the contact fields
|
||||
* and guarded submit action are reachable.
|
||||
*
|
||||
* The module is connector-gated (`tenantHasModule('crm-basic')`). Without the
|
||||
* entitlement the loader returns a locked View-Model that renders
|
||||
* `ui.crm.list.locked` instead of the table; without the route the shell
|
||||
* answers 404. Local runs skip those fixture gaps; required readiness fails
|
||||
* closed.
|
||||
*/
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const crmPath = process.env.E2E_TENANT_CRM_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/contacts");
|
||||
|
||||
test.describe("crm interim screen (R-P6)", () => {
|
||||
test("renders the contact list and reaches the create form", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Skipping authenticated CRM smoke");
|
||||
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(crmPath, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "CRM module is not reachable in this environment");
|
||||
if (!page.url().includes("/contacts")) {
|
||||
skipOrFailWhenE2eFixtureMissing("CRM route is not available for the test tenant");
|
||||
}
|
||||
|
||||
// The interim list shell always renders; a locked entitlement swaps the
|
||||
// table for the locked empty-state. Local runs skip; readiness fails closed.
|
||||
await expect(page.locator('[data-ui-id="ui.crm.list"]')).toBeVisible();
|
||||
const locked = page.locator('[data-ui-id="ui.crm.list.locked"]');
|
||||
if (await locked.isVisible()) {
|
||||
skipOrFailWhenE2eFixtureMissing("CRM connector (crm-basic) is not enabled for the test tenant");
|
||||
}
|
||||
|
||||
// Main action: open the inline create dialog without leaving the list.
|
||||
const newButton = page.locator('[data-ui-id="ui.crm.list.new"]');
|
||||
await expect(newButton).toBeVisible();
|
||||
await newButton.click();
|
||||
|
||||
// Expected result: the inline form is usable and the submit remains guarded
|
||||
// until a contact identity is present.
|
||||
const createDialog = page.locator('[data-ui-id="ui.crm.new.dialog"]');
|
||||
const firstName = createDialog.locator('[data-ui-id="ui.crm.new.dialog.vorname"]');
|
||||
const submit = createDialog.locator('[data-ui-id="ui.crm.new.dialog.submit"]');
|
||||
await expect(createDialog).toBeVisible();
|
||||
await expect(firstName).toBeEditable();
|
||||
await expect(submit).toBeDisabled();
|
||||
await firstName.fill("Pilot");
|
||||
await expect(submit).toBeEnabled();
|
||||
|
||||
// No horizontal page overflow on the interim screen.
|
||||
const overflow = await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth);
|
||||
expect(overflow).toBeLessThanOrEqual(1);
|
||||
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,50 @@
|
||||
// R-P11b interim-UI smoke (AD-28, DoD 19): login -> /dashboard -> the interim
|
||||
// screen renders the one layout the server derived from the member's seat, and
|
||||
// a widget tile drills through to its module.
|
||||
|
||||
import { expect, test } from "./utils/test";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
|
||||
test.describe("dashboard interim screen (R-P11b)", () => {
|
||||
test("renders the derived layout and drills into a widget", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Skipping authenticated dashboard smoke");
|
||||
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
await page.goto(dashboardPath, { waitUntil: "domcontentloaded" });
|
||||
expect(page.url()).toContain(dashboardPath);
|
||||
|
||||
const roleLayouts = page.locator('[data-ui-id="ui.dashboard.roleLayouts"]');
|
||||
await expect(roleLayouts).toBeVisible();
|
||||
|
||||
// The layout follows the member's seat, so no switcher is offered.
|
||||
await expect(page.locator('[data-ui-id^="ui.dashboard.roleSwitcher"]')).toHaveCount(0);
|
||||
|
||||
// At least one widget card renders for the derived layout.
|
||||
await expect(page.locator('[data-ui-id^="ui.dashboard.widget."]').first()).toBeVisible();
|
||||
|
||||
// Live updates are always on, so the screen carries no live controls.
|
||||
await expect(page.locator('[data-ui-id="ui.dashboard.live.toggle"]')).toHaveCount(0);
|
||||
|
||||
// Main action: a linked KPI tile drills through to its module.
|
||||
const drilldown = page.locator('[data-ui-id$=".link"][data-ui-id^="ui.dashboard.widget."]').first();
|
||||
if (await drilldown.count()) {
|
||||
const href = await drilldown.getAttribute("href");
|
||||
await drilldown.click();
|
||||
await page.waitForURL((url) => url.pathname === href || url.pathname.startsWith(href ?? "/"));
|
||||
await expect(page.locator('[data-ui-id="ui.surface.shell.main"]').first()).toBeVisible();
|
||||
await page.goBack({ waitUntil: "domcontentloaded" });
|
||||
await expect(roleLayouts).toBeVisible();
|
||||
}
|
||||
|
||||
// No horizontal page overflow on the interim screen.
|
||||
const overflow = await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth);
|
||||
expect(overflow).toBeLessThanOrEqual(1);
|
||||
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
});
|
||||
});
|
||||
@@ -4,18 +4,25 @@ import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
/**
|
||||
* Email-Inbox smoke (VA-P23 / DoD D.19): Login -> /emails oeffnen -> Inbox
|
||||
* Email-Inbox smoke (VA-P23 / AK-UI-01..03 / DoD D.19): Login -> /emails,
|
||||
* /emails/new und /emails/:id oeffnen -> der jeweilige Interim-Screen ist
|
||||
* sichtbar; Settings-Seite rendert die Connect-Flaechen.
|
||||
*
|
||||
* Beide Routen sind modul-gegated (tenantHasModule "email-inbox") + permission-
|
||||
* gegated (email.read_own). Ohne verbundenes Postfach zeigt die Inbox den
|
||||
* Klartext-Empty-State (kein Postfach verbunden) — auch das ist ein gueltiger
|
||||
* Smoke-Durchlauf. Skippt ohne E2E-Credentials / wenn die Route im Environment
|
||||
* nicht erreichbar ist (404 bei fehlendem Modul/Recht).
|
||||
* Alle Routen sind modul-gegated (tenantHasModule "email-inbox") + permission-
|
||||
* gegated (email.read_own, Compose zusaetzlich email.write). Ohne verbundenes
|
||||
* Postfach zeigen Inbox und Compose den Klartext-No-Mailbox-State — auch das
|
||||
* ist ein gueltiger Smoke-Durchlauf. Skippt ohne E2E-Credentials / wenn die
|
||||
* Route im Environment nicht erreichbar ist (404 bei fehlendem Modul/Recht).
|
||||
*
|
||||
* Der Detail-Smoke braucht eine echte Message-ID und laeuft daher nur, wenn
|
||||
* E2E_TENANT_EMAIL_MESSAGE_PATH gesetzt ist (sonst gibt es im Environment keine
|
||||
* Mail zum Oeffnen).
|
||||
*/
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const emailsPath = process.env.E2E_TENANT_EMAILS_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/emails");
|
||||
const emailComposePath = process.env.E2E_TENANT_EMAIL_COMPOSE_PATH ?? `${emailsPath}/new`;
|
||||
const emailMessagePath = process.env.E2E_TENANT_EMAIL_MESSAGE_PATH;
|
||||
const emailSettingsPath =
|
||||
process.env.E2E_TENANT_EMAIL_SETTINGS_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/settings/integrations/email");
|
||||
|
||||
@@ -30,6 +37,28 @@ test.describe("email inbox smoke", () => {
|
||||
await expect(page.locator('[data-ui-id="ui.email.inbox"]')).toBeVisible();
|
||||
});
|
||||
|
||||
test("renders the compose screen (or its Klartext no-mailbox state)", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Email inbox smoke inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(emailComposePath, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "Email compose path is not reachable in this environment");
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.email.compose"]')).toBeVisible();
|
||||
});
|
||||
|
||||
test("opens a message detail with its thread", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Email inbox smoke inputs not configured");
|
||||
test.skip(!emailMessagePath, "E2E_TENANT_EMAIL_MESSAGE_PATH is not configured — no seeded mail to open");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(emailMessagePath!, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "Email message path is not reachable in this environment");
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.email.detail"]')).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.email.detail.thread"]')).toBeVisible();
|
||||
});
|
||||
|
||||
test("renders the mailbox connect settings", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Email inbox smoke inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
/**
|
||||
* Email-Marketing-Smoke (AK-P14a/AK-P14b, DoD D.19): Login -> /email-marketing
|
||||
* oeffnen -> Setup oder Overview sichtbar -> Kampagnen-Liste und den
|
||||
* sechs-stufigen Kampagnen-Wizard erreichen.
|
||||
*
|
||||
* Das Modul ist feature-gegated (`featureKeys.emailMarketing` via
|
||||
* requireTenantProductAccess) + permission-gegated (emailMarketing.view).
|
||||
* Ohne Entitlement redirectet die Shell (z.B. /plan-required), ohne Recht
|
||||
* antwortet sie 404 — beides skippt den Smoke sauber statt zu failen.
|
||||
*/
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const emailMarketingPath = process.env.E2E_TENANT_EMAIL_MARKETING_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/email-marketing");
|
||||
|
||||
test.describe("email marketing smoke", () => {
|
||||
test("renders the overview and reaches the campaigns list", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Email marketing smoke inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(emailMarketingPath, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "Email marketing module is not reachable in this environment");
|
||||
test.skip(!page.url().includes("/email-marketing"), "Email marketing entitlement is not enabled for the test tenant");
|
||||
|
||||
const overview = page.locator('[data-ui-id="email-marketing.overview"]');
|
||||
const setup = page.locator('[data-ui-id="email-marketing.setup"]');
|
||||
await expect.poll(async () => (await overview.count()) + (await setup.count())).toBeGreaterThan(0);
|
||||
|
||||
await page.goto(`${emailMarketingPath}/campaigns`, { waitUntil: "domcontentloaded" });
|
||||
await expect(page.locator('[data-ui-id="email-marketing.campaigns"]')).toBeVisible();
|
||||
|
||||
await page.getByRole("searchbox").fill("smoke");
|
||||
await page.getByRole("button", { name: /Filtern|Apply/iu }).click();
|
||||
await expect(page).toHaveURL(/query=smoke/u);
|
||||
|
||||
await page.goto(`${emailMarketingPath}/campaigns/new`, { waitUntil: "domcontentloaded" });
|
||||
await expect(page.locator('[data-ui-id="email-marketing.campaign-editor"]')).toBeVisible();
|
||||
await expect(page.getByText(/Grundlagen|Basics/iu).first()).toBeVisible();
|
||||
await expect(page.getByText(/Test/iu).first()).toBeVisible();
|
||||
await expect(page.getByText(/Prüfen|Review/iu).first()).toBeVisible();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,43 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { compactMobileViewport, expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const emailMarketingPath =
|
||||
process.env.E2E_TENANT_EMAIL_MARKETING_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/email-marketing");
|
||||
|
||||
test.describe("email marketing mobile a11y", () => {
|
||||
for (const viewport of [narrowMobileViewport, compactMobileViewport]) {
|
||||
test(`keeps setup, campaign cards and the six-step wizard usable at ${viewport.width}px`, async ({ page }) => {
|
||||
test.setTimeout(60_000);
|
||||
skipOrFailWhenE2eInputsMissing(
|
||||
["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"],
|
||||
"Email marketing mobile a11y inputs not configured",
|
||||
);
|
||||
await page.setViewportSize(viewport);
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(emailMarketingPath, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "Email marketing module is not reachable in this environment");
|
||||
test.skip(!page.url().includes("/email-marketing"), "Email marketing entitlement is not enabled for the test tenant");
|
||||
|
||||
await expect(page.locator("body")).toBeVisible();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
await page.goto(`${emailMarketingPath}/campaigns`, { waitUntil: "domcontentloaded" });
|
||||
await expect(page.locator('[data-ui-id="email-marketing.campaigns"]')).toBeVisible();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
await page.goto(`${emailMarketingPath}/campaigns/new`, { waitUntil: "domcontentloaded" });
|
||||
await expect(page.locator('[data-ui-id="email-marketing.campaign-editor"]')).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="email-marketing.campaign.autosave"]')).toBeVisible();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -6,7 +6,6 @@ import { escapeRegExp, interceptCurrentRoutePost, postDataIncludesField } from "
|
||||
const forgotForm = '[data-ui-id="ui.auth.forgot.form"], form';
|
||||
const forgotEmailInput = '[data-ui-id="ui.auth.forgot.email"], input[name="email"]';
|
||||
const forgotResetButton = '[data-ui-id="ui.auth.forgot.submit"], button[name="mode"][value="reset"]';
|
||||
const forgotMagicLinkButton = '[data-ui-id="ui.auth.forgot.magicLinkSubmit"], button[name="mode"][value="magic"]';
|
||||
const resetForm = '[data-ui-id="ui.auth.reset.form"], form';
|
||||
const resetEmailInput = '[data-ui-id="ui.auth.reset.email"], input[type="email"], input[name="email"], input#email';
|
||||
const resetPasswordInput = '[data-ui-id="ui.auth.reset.password"], input[name="password"]';
|
||||
@@ -21,7 +20,7 @@ test.describe("forgot-password page a11y", () => {
|
||||
});
|
||||
}
|
||||
|
||||
test("submits reset and magic-link requests without account enumeration", async ({ page }) => {
|
||||
test("submits reset requests without account enumeration", async ({ page }) => {
|
||||
await page.goto("/forgot-password", { waitUntil: "domcontentloaded" });
|
||||
|
||||
const form = page.locator(forgotForm).first();
|
||||
@@ -33,10 +32,6 @@ test.describe("forgot-password page a11y", () => {
|
||||
await form.locator(forgotEmailInput).fill("unknown-e2e-user@example.invalid");
|
||||
await form.locator(forgotResetButton).click();
|
||||
await expect(page.getByText(/if an account exists|wenn es ein konto/iu)).toBeVisible({ timeout: 5_000 });
|
||||
|
||||
await form.locator(forgotEmailInput).fill("unknown-e2e-magic@example.invalid");
|
||||
await form.locator(forgotMagicLinkButton).click();
|
||||
await expect(page.getByText(/if an account exists|wenn es ein konto/iu)).toBeVisible({ timeout: 5_000 });
|
||||
});
|
||||
|
||||
test("submits reset-token form with csrf and token fields without mutating data", async ({ page }) => {
|
||||
@@ -58,35 +53,18 @@ test.describe("forgot-password page a11y", () => {
|
||||
await expect(confirmInput).toBeEditable();
|
||||
await expect(submit).toBeEnabled();
|
||||
|
||||
let resolveSubmitted!: (formData: URLSearchParams) => void;
|
||||
const submitted = new Promise<URLSearchParams>((resolve) => {
|
||||
resolveSubmitted = resolve;
|
||||
});
|
||||
await page.route("**/*", async (route) => {
|
||||
const request = route.request();
|
||||
const requestUrl = new URL(request.url());
|
||||
if (request.method() !== "POST" || requestUrl.pathname !== "/reset") {
|
||||
await route.continue();
|
||||
return;
|
||||
}
|
||||
|
||||
resolveSubmitted(new URLSearchParams(request.postData() ?? ""));
|
||||
await route.fulfill({
|
||||
status: 204,
|
||||
body: "",
|
||||
});
|
||||
});
|
||||
const submitted = await interceptCurrentRoutePost(page, { status: 204 });
|
||||
|
||||
await passwordInput.fill("LongEnough1!");
|
||||
await confirmInput.fill("LongEnough1!");
|
||||
await submit.click();
|
||||
|
||||
const formData = await submitted;
|
||||
expect(formData.get("csrf") ?? "").not.toBe("");
|
||||
expect(formData.get("verify-token")).toBe("dummy-token");
|
||||
expect(formData.get("email")).toBe("contract@example.test");
|
||||
expect(formData.get("password")).toBe("LongEnough1!");
|
||||
expect(formData.get("password-confirm")).toBe("LongEnough1!");
|
||||
await expect.poll(() => submitted.value, { timeout: 5_000 }).not.toBeNull();
|
||||
expect(postDataIncludesField(submitted.value, "csrf", /.+/u)).toBe(true);
|
||||
expect(postDataIncludesField(submitted.value, "verify-token", /^dummy-token$/u)).toBe(true);
|
||||
expect(postDataIncludesField(submitted.value, "email", /^contract@example\.test$/u)).toBe(true);
|
||||
expect(postDataIncludesField(submitted.value, "password", /^LongEnough1!$/u)).toBe(true);
|
||||
expect(postDataIncludesField(submitted.value, "password-confirm", /^LongEnough1!$/u)).toBe(true);
|
||||
});
|
||||
|
||||
test("shows an accessible error for an invalid reset token without losing context", async ({ page }) => {
|
||||
@@ -110,36 +88,32 @@ test.describe("forgot-password page a11y", () => {
|
||||
test.describe("forgot-password mobile contract a11y", () => {
|
||||
test.use({ viewport: narrowMobileViewport, isMobile: true, hasTouch: true });
|
||||
|
||||
test("posts reset and magic-link contracts on mobile without sending mail", async ({ page }) => {
|
||||
for (const mode of [
|
||||
{ button: forgotResetButton, email: "mobile-reset-contract@example.invalid", value: "reset" },
|
||||
{ button: forgotMagicLinkButton, email: "mobile-magic-contract@example.invalid", value: "magic" },
|
||||
] as const) {
|
||||
await page.goto("/forgot-password", { waitUntil: "domcontentloaded" });
|
||||
test("posts the reset contract on mobile without sending mail", async ({ page }) => {
|
||||
const email = "mobile-reset-contract@example.invalid";
|
||||
await page.goto("/forgot-password", { waitUntil: "domcontentloaded" });
|
||||
|
||||
const form = page.locator(forgotForm).first();
|
||||
const emailInput = form.locator(forgotEmailInput).first();
|
||||
const submitButton = form.locator(mode.button).first();
|
||||
await expect(form).toBeVisible();
|
||||
await expect(emailInput).toBeVisible();
|
||||
await expect(submitButton).toBeVisible();
|
||||
const form = page.locator(forgotForm).first();
|
||||
const emailInput = form.locator(forgotEmailInput).first();
|
||||
const submitButton = form.locator(forgotResetButton).first();
|
||||
await expect(form).toBeVisible();
|
||||
await expect(emailInput).toBeVisible();
|
||||
await expect(submitButton).toBeVisible();
|
||||
|
||||
await emailInput.fill(mode.email);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
await emailInput.fill(email);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
const submitted = await interceptCurrentRoutePost(page, {
|
||||
status: 200,
|
||||
body: "<!doctype html><title>Forgot password intercepted</title>",
|
||||
contentType: "text/html",
|
||||
});
|
||||
await submitButton.click();
|
||||
await expect.poll(() => submitted.value, { timeout: 5_000 }).not.toBeNull();
|
||||
const submitted = await interceptCurrentRoutePost(page, {
|
||||
status: 200,
|
||||
body: "<!doctype html><title>Forgot password intercepted</title>",
|
||||
contentType: "text/html",
|
||||
});
|
||||
await submitButton.click();
|
||||
await expect.poll(() => submitted.value, { timeout: 5_000 }).not.toBeNull();
|
||||
|
||||
expect(postDataIncludesField(submitted.value, "csrf", /.+/u)).toBe(true);
|
||||
expect(postDataIncludesField(submitted.value, "email", new RegExp(`^${escapeRegExp(mode.email)}$`, "u"))).toBe(true);
|
||||
expect(postDataIncludesField(submitted.value, "mode", new RegExp(`^${mode.value}$`, "u"))).toBe(true);
|
||||
await page.unroute("**/*");
|
||||
}
|
||||
expect(postDataIncludesField(submitted.value, "csrf", /.+/u)).toBe(true);
|
||||
expect(postDataIncludesField(submitted.value, "email", new RegExp(`^${escapeRegExp(email)}$`, "u"))).toBe(true);
|
||||
expect(postDataIncludesField(submitted.value, "mode", /^reset$/u)).toBe(true);
|
||||
await page.unroute("**/*");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,30 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
/**
|
||||
* Forms smoke (AK-P16c / DoD D.19): Login -> /forms oeffnen -> Verwaltungs-
|
||||
* Liste sichtbar.
|
||||
*
|
||||
* Die Route ist modul-gegated (tenantHasModule "forms") + permission-gegated
|
||||
* (forms.basic). Bei aktivem Modul + Berechtigung rendert sie die
|
||||
* Formular-Verwaltung mit `data-ui-id="ui.forms.list"`. Skippt ohne
|
||||
* E2E-Credentials / wenn die Route im Environment nicht erreichbar ist
|
||||
* (404 bei fehlendem Modul/Recht).
|
||||
*/
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const formsPath = process.env.E2E_TENANT_FORMS_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/forms");
|
||||
|
||||
test.describe("forms smoke", () => {
|
||||
test("renders the forms admin list", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Forms smoke inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(formsPath, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "Forms path is not reachable in this environment");
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.forms.list"]')).toBeVisible();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,48 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
/**
|
||||
* AK-P17a HR-core smoke (DoD D.19): Login -> /hr hub -> directory via hub link
|
||||
* -> table/empty state visible; then the password-safe list where the
|
||||
* never-list contract must hold (no revealed secret value anywhere before an
|
||||
* explicit, audited reveal).
|
||||
*
|
||||
* The routes are module-gated (`tenantHasModule('hr')`) and permission-gated
|
||||
* (`hr.read_own` / `hr.passwordsafe.use`, 404 instead of 403). Skips without
|
||||
* E2E credentials or when the route is not reachable in this environment.
|
||||
*/
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const hrHubPath = process.env.E2E_TENANT_HR_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/hr");
|
||||
const tenantSlug = hrHubPath.split("/").filter(Boolean)[0] ?? "app";
|
||||
|
||||
test.describe("hr core smoke", () => {
|
||||
test("opens the hub, the employee directory and the password-safe list", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "HR smoke inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(hrHubPath, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "HR hub is not reachable in this environment");
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.hr.hub.section.forMe"]')).toBeVisible();
|
||||
|
||||
// Main action: follow the hub link into the employee directory. The
|
||||
// directory renders either the table or the plain-text empty state.
|
||||
const directoryLink = page
|
||||
.locator('[data-ui-id="ui.hr.hub.item.teamDirectory"], [data-ui-id="ui.hr.hub.item.directory"]')
|
||||
.first();
|
||||
await expect(directoryLink).toBeVisible();
|
||||
await directoryLink.click();
|
||||
await page.waitForURL(/\/hr\/directory(?:[/?#]|$)/u);
|
||||
await expect(page.locator('[data-ui-id="ui.hr.directory.table"], [data-ui-id="ui.hr.directory.empty"]').first()).toBeVisible();
|
||||
|
||||
// Password-safe list: vault cards or empty state — and never a revealed
|
||||
// secret value outside the audited on-demand reveal (DoD #3 never-list).
|
||||
const safeResponse = await page.goto(`/${tenantSlug}/passwords`, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, safeResponse, "Password safe is not reachable in this environment");
|
||||
await expect(page.locator('[data-ui-id="ui.hr.passwordSafe.list"], [data-ui-id="ui.hr.passwordSafe.empty"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.hr.vault.revealed"]')).toHaveCount(0);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,44 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
/**
|
||||
* AK-P17b HR-workflows smoke (DoD D.19): Login -> /hr/leave -> tabs visible ->
|
||||
* open the "new leave request" dialog (main action) -> dialog renders ->
|
||||
* switch to the team tab via its server link (loader roundtrip, tab reflected
|
||||
* in the URL).
|
||||
*
|
||||
* Module- and permission-gated like the HR core routes; skips without E2E
|
||||
* credentials or when the route is not reachable in this environment.
|
||||
*/
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const leavePath = process.env.E2E_TENANT_HR_LEAVE_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/hr/leave");
|
||||
|
||||
test.describe("hr workflows smoke", () => {
|
||||
test("renders the leave workflow, opens the request dialog and switches tabs", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "HR leave smoke inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(leavePath, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "HR leave is not reachable in this environment");
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.hr.leave.tabs"]')).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.hr.leave.own.list"], [data-ui-id="ui.hr.leave.own.empty"]').first()).toBeVisible();
|
||||
|
||||
// Main action: open the new-request dialog (write stays out of the smoke
|
||||
// run — the dialog itself proves the action wiring).
|
||||
const newButton = page.locator('[data-ui-id="ui.hr.leave.new"]');
|
||||
if (await newButton.isVisible()) {
|
||||
await newButton.click();
|
||||
await expect(page.locator('[data-ui-id="ui.hr.leave.newDialog"]')).toBeVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
}
|
||||
|
||||
// Tab switch is a server link: the loader reflects the tab into the URL.
|
||||
await page.locator('[data-ui-id="ui.hr.leave.tabs"] a').last().click();
|
||||
await page.waitForURL(/[?&]tab=team(?:&|$)/u);
|
||||
await expect(page.locator('[data-ui-id="ui.hr.leave.team.list"], [data-ui-id="ui.hr.leave.team.empty"]').first()).toBeVisible();
|
||||
});
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
/**
|
||||
* Integrations-Smoke (R-P5 / DoD D.19): Login -> Integrations-Katalog oeffnen ->
|
||||
@@ -14,7 +14,8 @@ import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH;
|
||||
const integrationsPath =
|
||||
process.env.E2E_TENANT_INTEGRATIONS_PATH ?? (dashboardPath?.endsWith("/dashboard") ? dashboardPath.replace(/\/dashboard$/u, "/integrations") : undefined);
|
||||
process.env.E2E_TENANT_INTEGRATIONS_PATH ??
|
||||
(dashboardPath?.endsWith("/dashboard") ? dashboardPath.replace(/\/dashboard$/u, "/settings/integrations") : undefined);
|
||||
|
||||
test.describe("integrations smoke (R-P5)", () => {
|
||||
test.beforeEach(() => {
|
||||
@@ -22,7 +23,9 @@ test.describe("integrations smoke (R-P5)", () => {
|
||||
});
|
||||
|
||||
test("opens the catalog, an app's connection management and the connect wizard", async ({ page }) => {
|
||||
test.skip(!integrationsPath, "Integrations path not derivable from E2E_TENANT_DASHBOARD_PATH");
|
||||
if (!integrationsPath) {
|
||||
skipOrFailWhenE2eFixtureMissing("Integrations path not derivable from E2E_TENANT_DASHBOARD_PATH");
|
||||
}
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(integrationsPath!, { waitUntil: "domcontentloaded" });
|
||||
@@ -33,7 +36,7 @@ test.describe("integrations smoke (R-P5)", () => {
|
||||
// Open the P5 reference app card (always in the code catalog).
|
||||
const card = page.locator('[data-row-id="sample-data-sync"]').first();
|
||||
if (!(await card.isVisible())) {
|
||||
test.skip(true, "sample-data-sync card not visible (catalog empty for this tenant)");
|
||||
skipOrFailWhenE2eFixtureMissing("sample-data-sync card not visible (catalog empty for this tenant)");
|
||||
}
|
||||
await card.click();
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH;
|
||||
const importPath = process.env.E2E_TENANT_KWP_PROJECT_IMPORT_PATH ?? dashboardPath?.replace(/\/dashboard\/?$/u, "/settings/integrations/kwp/import");
|
||||
const readOnlyQuery = process.env.E2E_KWP_PROJECT_QUERY?.trim();
|
||||
|
||||
test.describe("VR-P32 KWP project import interim smoke", () => {
|
||||
test.beforeEach(() => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_DASHBOARD_PATH"], "KWP project import smoke inputs not configured");
|
||||
});
|
||||
|
||||
test("opens the import flow and optionally executes a read-only targeted search", async ({ page }) => {
|
||||
if (!importPath) {
|
||||
skipOrFailWhenE2eFixtureMissing("KWP project import path is not derivable");
|
||||
}
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(importPath!, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, `KWP project import path ${importPath}`);
|
||||
await expect(page.locator('[data-ui-id="ui.integrations.kwp.project-import"]')).toBeVisible();
|
||||
|
||||
if (!readOnlyQuery || readOnlyQuery.length < 2) {
|
||||
await expect(
|
||||
page
|
||||
.getByText(/Kein KWP-Projekt ausgewählt|No KWP project selected/iu)
|
||||
.or(page.getByText(/Keine KWP-Verbindung|No KWP connection/iu))
|
||||
.first()
|
||||
).toBeVisible();
|
||||
return;
|
||||
}
|
||||
|
||||
await page.getByLabel(/Suchbegriff|Search term/iu).fill(readOnlyQuery);
|
||||
await page.getByRole("button", { name: /Suchen|Search/iu }).click();
|
||||
await page.waitForLoadState("domcontentloaded");
|
||||
await expect(page.locator('[data-ui-id="ui.integrations.kwp.project-import"]')).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.integrations.kwp.project-import.results"]')).toBeVisible();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,68 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
/**
|
||||
* Lead-inbox interim-UI smoke (R-P7, AD-28, DoD D.19): Login -> /leads open ->
|
||||
* the interim triage inbox from ~/ui renders -> main action: follow the
|
||||
* "new lead" button into the inline manual-entry dialog -> the identity fields
|
||||
* and guarded submit control are reachable.
|
||||
*
|
||||
* The module is connector-gated (`tenantHasModule('leads')`). Without the
|
||||
* entitlement the loader returns a locked View-Model that renders the locked
|
||||
* empty-state (no filter bar) instead of the triage table; without the route
|
||||
* the shell answers 404. Local runs skip those fixture gaps; required readiness
|
||||
* fails closed.
|
||||
*/
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const leadsPath = process.env.E2E_TENANT_LEADS_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/leads");
|
||||
|
||||
test.describe("lead inbox interim screen (R-P7)", () => {
|
||||
test("renders the triage inbox and reaches the manual-entry form", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Skipping authenticated lead-inbox smoke");
|
||||
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(leadsPath, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "Leads module is not reachable in this environment");
|
||||
if (!page.url().includes("/leads")) {
|
||||
skipOrFailWhenE2eFixtureMissing("Leads route is not available for the test tenant");
|
||||
}
|
||||
|
||||
// The interim inbox shell always renders; a locked entitlement swaps the
|
||||
// filter bar + table for the locked empty-state. Local runs skip; readiness
|
||||
// fails closed.
|
||||
await expect(page.locator('[data-ui-id="ui.leads.list"]')).toBeVisible();
|
||||
const filterBar = page.locator('[data-ui-id="ui.leads.list.filter"]');
|
||||
if (!(await filterBar.isVisible())) {
|
||||
skipOrFailWhenE2eFixtureMissing("Leads connector (leads) is not enabled for the test tenant");
|
||||
}
|
||||
|
||||
// Main action: open the inline manual-entry dialog without leaving the inbox.
|
||||
const newButton = page.locator('[data-ui-id="ui.leads.list.new"]');
|
||||
if (!(await newButton.isVisible())) {
|
||||
skipOrFailWhenE2eFixtureMissing("Test tenant lacks leads.write - create action not rendered");
|
||||
}
|
||||
await newButton.click();
|
||||
|
||||
// Expected result: identity fields are usable and submit stays guarded until
|
||||
// at least one identifying value is present.
|
||||
const createDialog = page.locator('[data-ui-id="ui.leads.new.dialog"]');
|
||||
const email = createDialog.locator('[data-ui-id="ui.leads.new.dialog.email"]');
|
||||
const submit = createDialog.locator('[data-ui-id="ui.leads.new.dialog.submit"]');
|
||||
await expect(createDialog).toBeVisible();
|
||||
await expect(email).toBeEditable();
|
||||
await expect(submit).toBeDisabled();
|
||||
await email.fill("pilot@example.test");
|
||||
await expect(submit).toBeEnabled();
|
||||
|
||||
// No horizontal page overflow on the interim screen.
|
||||
const overflow = await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth);
|
||||
expect(overflow).toBeLessThanOrEqual(1);
|
||||
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
});
|
||||
});
|
||||
@@ -42,15 +42,15 @@ test.describe("login page a11y", () => {
|
||||
await page.locator('input[name="password"], input#password, input[type="password"]').first().fill("x");
|
||||
await page.locator('button[type="submit"]').first().click();
|
||||
|
||||
await expect(page.locator("#email-error")).toHaveRole("alert");
|
||||
await expect(page.locator("#email-error")).toHaveText("Invalid email");
|
||||
await expect(page.locator("#password-error")).toHaveRole("alert");
|
||||
await expect(page.locator("#password-error")).toHaveText("Invalid password");
|
||||
await expect(page.locator("#login-email-error")).toHaveRole("alert");
|
||||
await expect(page.locator("#login-email-error")).toHaveText("Invalid email");
|
||||
await expect(page.locator("#login-password-error")).toHaveRole("alert");
|
||||
await expect(page.locator("#login-password-error")).toHaveText("Invalid password");
|
||||
await expect(page.getByRole("alert")).toHaveCount(2);
|
||||
await expect(page.locator('input[name="email"]')).toHaveValue("not-an-email");
|
||||
await expect(page.locator('input[name="email"]')).toHaveAttribute("aria-invalid", "true");
|
||||
await expect(page.locator('input[name="email"]')).toHaveAttribute("aria-describedby", "email-error");
|
||||
await expect(page.locator('input[name="email"]')).toHaveAttribute("aria-describedby", "login-email-error");
|
||||
await expect(page.locator('input[name="password"]')).toHaveAttribute("aria-invalid", "true");
|
||||
await expect(page.locator('input[name="password"]')).toHaveAttribute("aria-describedby", "password-error");
|
||||
await expect(page.locator('input[name="password"]')).toHaveAttribute("aria-describedby", "login-password-error");
|
||||
});
|
||||
});
|
||||
@@ -15,8 +15,7 @@ import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH;
|
||||
const membersPath = process.env.E2E_TENANT_MEMBERS_PATH ?? (dashboardPath ? tenantSettingsMembersPath(dashboardPath) : undefined);
|
||||
const rolesAndPermissionsPath =
|
||||
process.env.E2E_TENANT_ROLES_AND_PERMISSIONS_PATH ?? (dashboardPath ? tenantRolesAndPermissionsPath(dashboardPath) : undefined);
|
||||
const rolesAndPermissionsPath = process.env.E2E_TENANT_ROLES_AND_PERMISSIONS_PATH ?? (dashboardPath ? tenantRolesAndPermissionsPath(dashboardPath) : undefined);
|
||||
|
||||
test.describe("members and roles smoke (R-P2b)", () => {
|
||||
test.beforeEach(() => {
|
||||
@@ -58,8 +57,8 @@ test.describe("members and roles smoke (R-P2b)", () => {
|
||||
test("opens the merged roles tab and reaches the M04A/M02 editor chain", async ({ page }) => {
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(`${rolesAndPermissionsPath!}/roles`, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, `Roles path ${rolesAndPermissionsPath}/roles`);
|
||||
const response = await page.goto(rolesAndPermissionsPath!, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, `Roles path ${rolesAndPermissionsPath}`);
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles"]').first()).toBeVisible();
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ test.describe("mobile auth pages", () => {
|
||||
test("tenant protected deep links redirect unauthenticated mobile users to login with redirectTo", async ({ page }) => {
|
||||
const tenantProtectedPaths = [
|
||||
`/${tenantSlug}/dashboard`,
|
||||
`/${tenantSlug}/settings/account`,
|
||||
`/${tenantSlug}/settings/plugins`,
|
||||
`/${tenantSlug}/settings/workspace`,
|
||||
`/${tenantSlug}/settings/integrations/plugins`,
|
||||
`/${tenantSlug}/workflow-engine`,
|
||||
`/${tenantSlug}/workflow-engine/workflows/example/run/manual`,
|
||||
];
|
||||
@@ -94,12 +94,12 @@ test.describe("mobile auth pages", () => {
|
||||
await expectNoHorizontalOverflow(page);
|
||||
});
|
||||
|
||||
test("/reset without a token keeps password inputs disabled on mobile", async ({ page }) => {
|
||||
test("/reset without a token shows the invalid-link recovery state on mobile", async ({ page }) => {
|
||||
await page.goto("/reset", { waitUntil: "domcontentloaded" });
|
||||
|
||||
await expect(page.locator(resetEmailInput).first()).toBeVisible();
|
||||
await expect(page.locator(resetPasswordInput).first()).toBeVisible();
|
||||
await expect(page.locator(resetSubmitButton).first()).toBeDisabled();
|
||||
await expect(page.locator('[data-ui-id="ui.auth.reset.invalid"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.auth.reset.requestNew"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.auth.reset.invalidBackToLogin"]').first()).toBeVisible();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
});
|
||||
|
||||
@@ -116,7 +116,8 @@ test.describe("mobile auth pages", () => {
|
||||
await page.goto("/auth/magic-link", { waitUntil: "domcontentloaded" });
|
||||
|
||||
await expect(page.getByRole("heading", { level: 1 })).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: /request a new.*link|neuen.*link/i })).toHaveAttribute("href", "/forgot-password");
|
||||
await expect(page.locator('[data-ui-id="ui.auth.magicLink.requestNew"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.auth.magicLink.backToLogin"]').first()).toBeVisible();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
});
|
||||
|
||||
@@ -126,17 +127,17 @@ test.describe("mobile auth pages", () => {
|
||||
await expect(page).toHaveURL(/\/forgot-password(?:[?#].*)?$/);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
await page.locator('a[href="/login"]').click();
|
||||
await page.locator('[data-ui-id="ui.auth.forgot.backToLoginLink"]').click();
|
||||
await expect(page).toHaveURL(/\/login(?:[?#].*)?$/);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
await page.goto("/auth/magic-link", { waitUntil: "domcontentloaded" });
|
||||
await page.locator('a[href="/forgot-password"]').click();
|
||||
await expect(page).toHaveURL(/\/forgot-password(?:[?#].*)?$/);
|
||||
await page.locator('[data-ui-id="ui.auth.magicLink.requestNew"]').click();
|
||||
await expect(page).toHaveURL(/\/login(?:[?#].*)?$/);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
await page.goto("/reset", { waitUntil: "domcontentloaded" });
|
||||
await page.locator('a[href="/login"]').click();
|
||||
await page.locator('[data-ui-id="ui.auth.reset.invalidBackToLogin"]').click();
|
||||
await expect(page).toHaveURL(/\/login(?:[?#].*)?$/);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
});
|
||||
@@ -154,12 +155,12 @@ test.describe("compact mobile auth pages", () => {
|
||||
});
|
||||
}
|
||||
|
||||
test("/reset without a token keeps controls disabled at 320px", async ({ page }) => {
|
||||
test("/reset without a token keeps recovery actions usable at 320px", async ({ page }) => {
|
||||
await page.goto("/reset", { waitUntil: "domcontentloaded" });
|
||||
|
||||
await expect(page.locator(resetEmailInput).first()).toBeVisible();
|
||||
await expect(page.locator(resetPasswordInput).first()).toBeVisible();
|
||||
await expect(page.locator(resetSubmitButton).first()).toBeDisabled();
|
||||
await expect(page.locator('[data-ui-id="ui.auth.reset.invalid"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.auth.reset.requestNew"]').first()).toBeEnabled();
|
||||
await expect(page.locator('[data-ui-id="ui.auth.reset.invalidBackToLogin"]').first()).toBeEnabled();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect, type Page, test } from "./utils/test";
|
||||
import { expect, type Locator, type Page, test } from "./utils/test";
|
||||
import { getTenantCredentials, loginAsTenantUser, tenantSettingsAccountPath, tenantSettingsProfilePath, tenantSettingsSubscriptionPath } from "./utils/auth";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { compactMobileViewport, expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
|
||||
@@ -10,7 +10,7 @@ const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const pluginSettingsPath = process.env.E2E_PLUGIN_SETTINGS_PATH;
|
||||
const workflowBuilderPath = process.env.E2E_WORKFLOW_BUILDER_PATH;
|
||||
const workflowRunManualPath = process.env.E2E_WORKFLOW_RUN_MANUAL_PATH;
|
||||
const mobileSidebarSelector = '[data-ui-id="ui.surface.app.sidebar.mobile"]';
|
||||
const mobileSidebarSelector = '[data-ui-id="ui.surface.app.sidebar"]';
|
||||
|
||||
type MobileShellRouteCheck = {
|
||||
name: string;
|
||||
@@ -22,6 +22,21 @@ function requireMobileShellInputs(reason: string): void {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], reason);
|
||||
}
|
||||
|
||||
async function isMobileSidebarOpen(sidebar: Locator): Promise<boolean> {
|
||||
return sidebar.evaluate((element) => element.classList.contains("max-md:translate-x-0"));
|
||||
}
|
||||
|
||||
async function expectMobileSidebarOpen(sidebar: Locator): Promise<void> {
|
||||
await expect(sidebar).toBeVisible();
|
||||
await expect(sidebar).toHaveClass(/(?:^|\s)max-md:translate-x-0(?:\s|$)/u);
|
||||
await expect(sidebar).not.toHaveAttribute("aria-hidden", "true");
|
||||
}
|
||||
|
||||
async function expectMobileSidebarClosed(sidebar: Locator): Promise<void> {
|
||||
await expect(sidebar).toHaveClass(/(?:^|\s)max-md:-translate-x-full(?:\s|$)/u);
|
||||
await expect(sidebar).toHaveAttribute("aria-hidden", "true");
|
||||
}
|
||||
|
||||
async function expectFocusInsideMobileSidebar(page: Page, stepName: string): Promise<void> {
|
||||
await expect
|
||||
.poll(
|
||||
@@ -66,15 +81,15 @@ async function expectMobileShellControlsUsable(page: Page): Promise<void> {
|
||||
// click can race that close and leave the drawer shut. Retry-open, only
|
||||
// clicking while it's closed, so the toggle never clobbers an open drawer.
|
||||
await expect(async () => {
|
||||
if (!(await mobileSidebar.isVisible())) {
|
||||
if (!(await isMobileSidebarOpen(mobileSidebar))) {
|
||||
await sidebarTrigger.click();
|
||||
}
|
||||
await expect(mobileSidebar).toBeVisible({ timeout: 2000 });
|
||||
await expectMobileSidebarOpen(mobileSidebar);
|
||||
}).toPass({ timeout: 15000 });
|
||||
await expect(mobileSidebar.locator('[data-ui-id="ui.nav.app.dashboard"]').first()).toBeVisible();
|
||||
await expect(mobileSidebar.locator('[data-ui-id="ui.nav.app.settings"]').first()).toBeVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
}
|
||||
|
||||
async function expectAuthenticatedMobileShellRoute(page: Page, routeCheck: MobileShellRouteCheck): Promise<void> {
|
||||
@@ -130,14 +145,14 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(dashboardPath)}(?:[?#].*)?$`, "u"));
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
const mobileSidebar = page.locator('[data-ui-id="ui.surface.app.sidebar.mobile"], [data-mobile="true"]');
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
const mobileSidebar = page.locator(mobileSidebarSelector);
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
|
||||
await page.locator('[data-ui-id="ui.action.shell.sidebarTrigger"]').click();
|
||||
await expect(mobileSidebar).toBeVisible();
|
||||
await expectMobileSidebarOpen(mobileSidebar);
|
||||
await expect(mobileSidebar).toHaveAttribute("role", "dialog");
|
||||
await expect(mobileSidebar).toHaveAttribute("aria-modal", "true");
|
||||
await expect(mobileSidebar).toHaveAccessibleName(/.+/u);
|
||||
await expect(mobileSidebar).toHaveAccessibleDescription(/.+/u);
|
||||
|
||||
const settingsLink = mobileSidebar.locator('[data-ui-id="ui.nav.app.settings"]').first();
|
||||
await expect(settingsLink).toBeVisible();
|
||||
@@ -145,7 +160,7 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
|
||||
const settingsProfilePath = tenantSettingsProfilePath(dashboardPath);
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(settingsProfilePath)}(?:[?#].*)?$`, "u"));
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
});
|
||||
|
||||
@@ -157,16 +172,16 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
const trigger = page.locator('[data-ui-id="ui.action.shell.sidebarTrigger"]');
|
||||
const mobileSidebar = page.locator('[data-ui-id="ui.surface.app.sidebar.mobile"], [data-mobile="true"]');
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
const mobileSidebar = page.locator(mobileSidebarSelector);
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
|
||||
await trigger.click();
|
||||
await expect(mobileSidebar).toBeVisible();
|
||||
await expectMobileSidebarOpen(mobileSidebar);
|
||||
await expect(mobileSidebar.locator('[data-ui-id="ui.nav.app.dashboard"]').first()).toBeVisible();
|
||||
await expect(mobileSidebar.locator('[data-ui-id="ui.nav.app.settings"]').first()).toBeVisible();
|
||||
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
await expect(trigger).toBeVisible();
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(dashboardPath)}(?:[?#].*)?$`, "u"));
|
||||
await expectNoHorizontalOverflow(page);
|
||||
@@ -181,13 +196,13 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
|
||||
const trigger = page.locator('[data-ui-id="ui.action.shell.sidebarTrigger"]');
|
||||
const mobileSidebar = page.locator(mobileSidebarSelector);
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
|
||||
await trigger.focus();
|
||||
await expect(trigger).toBeFocused();
|
||||
await page.keyboard.press("Enter");
|
||||
|
||||
await expect(mobileSidebar).toBeVisible();
|
||||
await expectMobileSidebarOpen(mobileSidebar);
|
||||
await expectFocusInsideMobileSidebar(page, "opening");
|
||||
|
||||
const focusableItemCount = await countMobileSidebarFocusableItems(page);
|
||||
@@ -199,7 +214,7 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
}
|
||||
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
await expect(trigger).toBeVisible();
|
||||
await expect(trigger).toBeFocused();
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(dashboardPath)}(?:[?#].*)?$`, "u"));
|
||||
@@ -213,17 +228,17 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(dashboardPath)}(?:[?#].*)?$`, "u"));
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
const mobileSidebar = page.locator('[data-mobile="true"]');
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
const mobileSidebar = page.locator(mobileSidebarSelector);
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
|
||||
await page.keyboard.press("Control+e");
|
||||
await expect(mobileSidebar).toBeVisible();
|
||||
await expectMobileSidebarOpen(mobileSidebar);
|
||||
await expect(mobileSidebar.locator('[data-ui-id="ui.nav.app.dashboard"]').first()).toBeVisible();
|
||||
await expect(mobileSidebar.locator('[data-ui-id="ui.nav.app.settings"]').first()).toBeVisible();
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(dashboardPath)}(?:[?#].*)?$`, "u"));
|
||||
|
||||
await page.keyboard.press("Control+e");
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(dashboardPath)}(?:[?#].*)?$`, "u"));
|
||||
await expectNoHorizontalOverflow(page);
|
||||
});
|
||||
@@ -239,11 +254,12 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
|
||||
const profileTarget = page.locator('[data-ui-id="ui.action.shell.profile"]').first();
|
||||
await expect(profileTarget).toBeVisible();
|
||||
await expect(profileTarget.locator("xpath=ancestor::a[1]")).toHaveAttribute("href", /settings\/profile/u);
|
||||
await expect(profileTarget).toHaveAttribute("role", "menuitem");
|
||||
|
||||
const signOut = page.locator('[data-ui-id="ui.action.shell.signOut"]').first();
|
||||
await expect(signOut).toBeVisible();
|
||||
await expect(signOut.locator("xpath=ancestor::form[1]")).toHaveAttribute("action", /\/logout$/u);
|
||||
await expect(signOut).toHaveAttribute("role", "menuitem");
|
||||
await expect(signOut.locator("xpath=ancestor::form[1]")).toHaveCount(0);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
});
|
||||
@@ -276,7 +292,7 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(dashboardPath)}(?:[?#].*)?$`, "u"));
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
const trigger = page.locator('[data-ui-id="ui.action.shell.search"]');
|
||||
const trigger = page.locator('[data-ui-id="ui.action.shell.searchMobile"]');
|
||||
await trigger.click();
|
||||
|
||||
const palette = page.locator('[data-ui-id="ui.surface.commandPalette.portal"]');
|
||||
@@ -302,11 +318,11 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(dashboardPath)}(?:[?#].*)?$`, "u"));
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
await page.locator('[data-ui-id="ui.action.shell.search"]').click();
|
||||
await page.locator('[data-ui-id="ui.action.shell.searchMobile"]').click();
|
||||
|
||||
const palette = page.locator('[data-ui-id="ui.surface.commandPalette.portal"]');
|
||||
const searchInput = page.locator('[data-ui-id="ui.surface.commandPalette.search"]');
|
||||
const rows = page.locator('[data-ui-id="ui.surface.commandPalette.row"]');
|
||||
const rows = page.locator('[data-ui-id^="ui.surface.commandPalette.action."], [data-ui-id^="ui.surface.commandPalette.result."]');
|
||||
await expect(palette).toBeVisible();
|
||||
await expect(searchInput).toBeFocused();
|
||||
|
||||
@@ -331,7 +347,7 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
|
||||
const palette = page.locator('[data-ui-id="ui.surface.commandPalette.portal"]');
|
||||
const searchInput = page.locator('[data-ui-id="ui.surface.commandPalette.search"]');
|
||||
const rows = page.locator('[data-ui-id="ui.surface.commandPalette.row"]');
|
||||
const rows = page.locator('[data-ui-id^="ui.surface.commandPalette.action."], [data-ui-id^="ui.surface.commandPalette.result."]');
|
||||
await expect(palette).toBeVisible();
|
||||
await expect(searchInput).toBeVisible();
|
||||
await expect(searchInput).toBeFocused();
|
||||
@@ -374,18 +390,18 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
const mobileSidebar = page.locator('[data-mobile="true"]');
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
const mobileSidebar = page.locator(mobileSidebarSelector);
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
|
||||
await page.locator('[data-ui-id="ui.action.shell.sidebarTrigger"]').click();
|
||||
await expect(mobileSidebar).toBeVisible();
|
||||
await expectMobileSidebarOpen(mobileSidebar);
|
||||
|
||||
const dashboardLink = mobileSidebar.locator('[data-ui-id="ui.nav.app.dashboard"]').first();
|
||||
await expect(dashboardLink).toBeVisible();
|
||||
await dashboardLink.click();
|
||||
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(dashboardPath)}(?:[?#].*)?$`, "u"));
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
});
|
||||
|
||||
@@ -401,16 +417,16 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
await expect(form).toBeVisible();
|
||||
await expect(form.locator('input[name="action"][value="profile"]')).toHaveCount(1);
|
||||
|
||||
const email = form.locator('[data-ui-id="ui.settings.profile.email"]').first();
|
||||
const email = page.locator('[data-ui-id="ui.settings.profile.email"]').first();
|
||||
await expect(email).toBeVisible();
|
||||
await expect(email).toBeDisabled();
|
||||
await expect(email).not.toHaveValue("");
|
||||
|
||||
await expect(form.locator('[data-ui-id="ui.settings.profile.firstName"]').first()).toBeVisible();
|
||||
await expect(form.locator('[data-ui-id="ui.settings.profile.lastName"]').first()).toBeVisible();
|
||||
await expect(form.locator('[data-ui-id="ui.settings.profile.save"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.profile.session.panel"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.profile.danger.delete"]').first()).toBeVisible();
|
||||
await expect(form.locator('[data-ui-id="ui.settings.profile.basicInfo.save"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.profile.password.open"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.profile.security.manage"]').first()).toBeVisible();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
});
|
||||
|
||||
@@ -420,7 +436,11 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
const routeChecks = [
|
||||
{ name: "account settings", path: tenantSettingsAccountPath(dashboardPath) },
|
||||
{ name: "profile settings", path: tenantSettingsProfilePath(dashboardPath) },
|
||||
{ name: "subscription settings", path: tenantSettingsSubscriptionPath(dashboardPath), readySelector: '[data-ui-id="ui.subscription.page"]' },
|
||||
{
|
||||
name: "subscription settings",
|
||||
path: tenantSettingsSubscriptionPath(dashboardPath),
|
||||
readySelector: '[data-ui-id^="ui.billing.selfServiceSubscription."]',
|
||||
},
|
||||
...(pluginSettingsPath ? [{ name: "plugin settings", path: pluginSettingsPath }] : []),
|
||||
...(workflowBuilderPath ? [{ name: "workflow builder", path: workflowBuilderPath }] : []),
|
||||
];
|
||||
@@ -449,12 +469,12 @@ test.describe("authenticated mobile shell flow", () => {
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
await sidebarTrigger.click();
|
||||
await expect(mobileSidebar).toBeVisible();
|
||||
await expectMobileSidebarOpen(mobileSidebar);
|
||||
await expect(mobileSidebar.locator('[data-ui-id="ui.nav.app.dashboard"]').first()).toBeVisible();
|
||||
await expect(mobileSidebar.locator('[data-ui-id="ui.nav.app.settings"]').first()).toBeVisible();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
|
||||
await moreTrigger.click();
|
||||
await expect(page.locator('[data-ui-id="ui.action.shell.signOut"]').first()).toBeVisible();
|
||||
@@ -577,10 +597,10 @@ test.describe("authenticated mobile shell browser history slice", () => {
|
||||
const settingsProfilePath = tenantSettingsProfilePath(dashboardPath);
|
||||
const mobileSidebar = page.locator(mobileSidebarSelector);
|
||||
await page.locator('[data-ui-id="ui.action.shell.sidebarTrigger"]').click();
|
||||
await expect(mobileSidebar).toBeVisible();
|
||||
await expectMobileSidebarOpen(mobileSidebar);
|
||||
await mobileSidebar.locator('[data-ui-id="ui.nav.app.settings"]').first().click();
|
||||
await expect(page).toHaveURL(pathPattern(settingsProfilePath));
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
await expectMobileShellControlsUsable(page);
|
||||
|
||||
await page.goBack({ waitUntil: "domcontentloaded" });
|
||||
@@ -602,11 +622,13 @@ test.describe("authenticated mobile shell browser history slice", () => {
|
||||
|
||||
const originRoute = { name: "profile settings", path: settingsProfilePath, readySelector: '[data-ui-id="ui.settings.profile.page"]' };
|
||||
const crossSurfaceRoutes = [
|
||||
{ name: "subscription settings", path: tenantSettingsSubscriptionPath(dashboardPath), readySelector: '[data-ui-id="ui.subscription.page"]' },
|
||||
{
|
||||
name: "subscription settings",
|
||||
path: tenantSettingsSubscriptionPath(dashboardPath),
|
||||
readySelector: '[data-ui-id^="ui.billing.selfServiceSubscription."]',
|
||||
},
|
||||
...(pluginSettingsPath ? [{ name: "plugin settings", path: pluginSettingsPath, readySelector: '[data-ui-id="ui.plugins.page"]' }] : []),
|
||||
...(workflowBuilderPath
|
||||
? [{ name: "workflow builder", path: workflowBuilderPath, readySelector: '[data-ui-id="ui.workflows.builder.canvas"]' }]
|
||||
: []),
|
||||
...(workflowBuilderPath ? [{ name: "workflow builder", path: workflowBuilderPath, readySelector: '[data-ui-id="ui.workflows.builder.canvas"]' }] : []),
|
||||
...(workflowRunManualPath
|
||||
? [{ name: "workflow manual run", path: workflowRunManualPath, readySelector: '[data-ui-id="ui.workflows.run.manual.form"]' }]
|
||||
: []),
|
||||
@@ -638,12 +660,12 @@ test.describe("authenticated compact mobile shell flow", () => {
|
||||
const sidebarTrigger = page.locator('[data-ui-id="ui.action.shell.sidebarTrigger"]');
|
||||
const mobileSidebar = page.locator(mobileSidebarSelector);
|
||||
await sidebarTrigger.click();
|
||||
await expect(mobileSidebar).toBeVisible();
|
||||
await expectMobileSidebarOpen(mobileSidebar);
|
||||
await expect(mobileSidebar.locator('[data-ui-id="ui.nav.app.dashboard"]').first()).toBeVisible();
|
||||
await expect(mobileSidebar.locator('[data-ui-id="ui.nav.app.settings"]').first()).toBeVisible();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
await expect(sidebarTrigger).toBeFocused();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
@@ -657,14 +679,14 @@ test.describe("authenticated compact mobile shell flow", () => {
|
||||
await expect(moreTrigger).toBeFocused();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
const searchTrigger = page.locator('[data-ui-id="ui.action.shell.search"]');
|
||||
const searchTrigger = page.locator('[data-ui-id="ui.action.shell.searchMobile"]');
|
||||
await searchTrigger.click();
|
||||
const palette = page.locator('[data-ui-id="ui.surface.commandPalette.portal"]');
|
||||
const searchInput = page.locator('[data-ui-id="ui.surface.commandPalette.search"]');
|
||||
await expect(palette).toBeVisible();
|
||||
await expect(searchInput).toBeFocused();
|
||||
await searchInput.fill("settings");
|
||||
await expect(page.locator('[data-ui-id="ui.surface.commandPalette.row"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id^="ui.surface.commandPalette.action."], [data-ui-id^="ui.surface.commandPalette.result."]').first()).toBeVisible();
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await page.keyboard.press("Escape");
|
||||
@@ -674,23 +696,23 @@ test.describe("authenticated compact mobile shell flow", () => {
|
||||
|
||||
const settingsProfilePath = tenantSettingsProfilePath(dashboardPath);
|
||||
await sidebarTrigger.click();
|
||||
await expect(mobileSidebar).toBeVisible();
|
||||
await expectMobileSidebarOpen(mobileSidebar);
|
||||
await mobileSidebar.locator('[data-ui-id="ui.nav.app.settings"]').first().click();
|
||||
await expect(page).toHaveURL(pathPattern(settingsProfilePath));
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
// Reopening the drawer right after the settings SPA navigation can race the
|
||||
// closing Sheet's state, dropping the first trigger click. Retry the open
|
||||
// (only clicking while it is still closed, so we never toggle it back shut).
|
||||
await expect(async () => {
|
||||
if (!(await mobileSidebar.isVisible())) {
|
||||
if (!(await isMobileSidebarOpen(mobileSidebar))) {
|
||||
await sidebarTrigger.click();
|
||||
}
|
||||
await expect(mobileSidebar).toBeVisible({ timeout: 2000 });
|
||||
await expectMobileSidebarOpen(mobileSidebar);
|
||||
}).toPass({ timeout: 15000 });
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(mobileSidebar).toBeHidden();
|
||||
await expectMobileSidebarClosed(mobileSidebar);
|
||||
await expect(sidebarTrigger).toBeFocused();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
/**
|
||||
* Notifications-Smoke (AK-P3 / DoD D.19): Login -> Notification-Center oeffnen
|
||||
* -> Interim-Screen (AD-28) sichtbar; Topbar-Glocke oeffnet den Drawer;
|
||||
* -> Interim-Screen (AD-28) sichtbar; Topbar-Glocke oeffnet das Center;
|
||||
* Notification-Settings rendern die Modul-Gruppen + Master-Switch.
|
||||
*
|
||||
* Skippt ohne E2E-Credentials / wenn die Routen im Environment nicht erreichbar
|
||||
@@ -16,7 +16,7 @@ const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const notificationsPath = process.env.E2E_TENANT_NOTIFICATIONS_CENTER_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/notifications");
|
||||
|
||||
test.describe("notifications smoke", () => {
|
||||
test("renders the notification center and opens the topbar drawer", async ({ page }) => {
|
||||
test("renders the notification center and follows the topbar bell link", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Notifications smoke inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
@@ -25,12 +25,14 @@ test.describe("notifications smoke", () => {
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.notifications.center"]')).toBeVisible();
|
||||
|
||||
// Topbar bell opens the interim drawer (AD-28) instead of navigating.
|
||||
// The shell exposes the notification center as a regular link so keyboard,
|
||||
// browser-history and open-in-new-tab behaviour remain native.
|
||||
const bell = page.locator('[data-ui-id="ui.action.shell.notifications"]');
|
||||
if (await bell.isVisible()) {
|
||||
await expect(bell).toHaveAttribute("href", notificationsPath);
|
||||
await bell.click();
|
||||
await expect(page.locator('[data-ui-id="ui.notifications.drawer"]')).toBeVisible();
|
||||
await page.locator('[data-ui-id="ui.notifications.drawer.close"]').click();
|
||||
await expect(page).toHaveURL(new RegExp(`${notificationsPath.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&")}(?:[?#].*)?$`, "u"));
|
||||
await expect(page.locator('[data-ui-id="ui.notifications.center"]')).toBeVisible();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
/**
|
||||
* R-P9 Plantafel-Smoke (DoD D.19): Login -> /projects/plantafel oeffnen ->
|
||||
* Filterleiste (Suche + Monteur-Auswahl) sichtbar -> auf die Wochenansicht
|
||||
* wechseln -> Loader-Roundtrip (view=calendar in der URL, Mo-So-Raster samt
|
||||
* Wochennavigation sichtbar).
|
||||
*
|
||||
* Die Route ist modul-gegated (Projekt-Connector) + permission-gegated
|
||||
* (plantafel.read_own). Bei aktivem Modul + Berechtigung rendert sie die
|
||||
* interim PlantafelPage mit der Filterleiste
|
||||
* (`data-ui-id="ui.projects.plantafel.filter"`). Skippt ohne E2E-Credentials /
|
||||
* wenn die Route im Environment nicht erreichbar ist (404 bei fehlendem
|
||||
* Modul/Recht).
|
||||
*/
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const plantafelPath = process.env.E2E_TENANT_PLANTAFEL_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/projects/plantafel");
|
||||
|
||||
test.describe("p9 operations smoke", () => {
|
||||
test("renders the plantafel and switches to the week view", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Plantafel smoke inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(plantafelPath, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "Plantafel path is not reachable in this environment");
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.projects.plantafel.filter"]')).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.projects.plantafel.filter.search"]')).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.projects.plantafel.filter.assignee"]')).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.projects.plantafel.filter.sort"]')).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.projects.plantafel.filter.past"]')).toBeVisible();
|
||||
|
||||
// Main action: switch to the week view. The route reflects it into the URL
|
||||
// via a server-side re-load, proving the loader roundtrip.
|
||||
await page.locator('[data-ui-id="ui.projects.plantafel.viewToggle.calendar"]').click();
|
||||
|
||||
await page.waitForURL(/[?&]view=calendar(?:&|$)/u);
|
||||
await expect(page.locator('[data-ui-id="ui.projects.plantafel.week"]')).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.projects.plantafel.weekNav"]')).toBeVisible();
|
||||
// The table-only controls step aside in the week view.
|
||||
await expect(page.locator('[data-ui-id="ui.projects.plantafel.filter.search"]')).toHaveCount(0);
|
||||
await expect(page.locator('[data-ui-id="ui.projects.plantafel.filter.sort"]')).toHaveCount(0);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,57 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
|
||||
import { skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const tenantSlug = dashboardPath.split("/").filter(Boolean)[0] ?? "app";
|
||||
const passwordsPath = process.env.E2E_TENANT_PASSWORDS_PATH ?? `/${tenantSlug}/passwords`;
|
||||
|
||||
test.describe("password manager mobile, accessibility and primary flow", () => {
|
||||
test.use({ viewport: narrowMobileViewport, isMobile: true, hasTouch: true });
|
||||
|
||||
test("opens a vault and keeps entries, grants and redacted activities reachable", async ({ page }) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Password manager E2E inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(passwordsPath, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "Password manager is not reachable in this environment");
|
||||
await expect(page.locator('[data-ui-id="ui.hr.passwordSafe.list"], [data-ui-id="ui.hr.passwordSafe.empty"]').first()).toBeVisible();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page, { include: '[data-ui-id="ui.hr.passwordSafe"]' });
|
||||
|
||||
const firstVault = page.locator('[data-ui-id="ui.hr.passwordSafe.list"] [data-row-id]').first();
|
||||
if ((await firstVault.count()) === 0) {
|
||||
skipOrFailWhenE2eFixtureMissing("Password manager review fixture needs at least one accessible vault");
|
||||
}
|
||||
await firstVault.click();
|
||||
await expect(page.locator('[data-ui-id="ui.hr.vault"]')).toBeVisible();
|
||||
await expect(page.getByRole("tab", { name: /Einträge|Entries/u })).toBeVisible();
|
||||
|
||||
const reveal = page.locator('[data-ui-id="ui.hr.vault.reveal"]').first();
|
||||
await expect(reveal).toBeVisible();
|
||||
await reveal.click();
|
||||
await expect(page.locator('[data-ui-id="ui.hr.vault.revealed"]').first()).toBeVisible();
|
||||
await page.getByRole("button", { name: /Ausblenden|Hide/u }).first().click();
|
||||
await expect(page.locator('[data-ui-id="ui.hr.vault.revealed"]')).toHaveCount(0);
|
||||
|
||||
await page.getByRole("tab", { name: /Freigaben|Access/u }).click();
|
||||
await expect(page.locator('[data-ui-id="ui.hr.vault.access"]')).toBeVisible();
|
||||
await page.getByRole("button", { name: /Freigaben verwalten|Manage access/u }).click();
|
||||
const accessDialog = page.locator('[data-ui-id="ui.hr.vault.grantAccess"]');
|
||||
await expect(accessDialog).toBeVisible();
|
||||
await expect(accessDialog.getByRole("combobox", { name: /Person|User/u })).toBeVisible();
|
||||
await expectNoCriticalA11yViolations(page, { include: '[data-ui-id="ui.hr.vault.grantAccess"]' });
|
||||
await accessDialog.getByRole("button", { name: /Abbrechen|Cancel/u }).click();
|
||||
|
||||
await page.getByRole("tab", { name: /Aktivitäten|Activities/u }).click();
|
||||
await expect(page.locator('[data-ui-id="ui.hr.vault.activities"]')).toBeVisible();
|
||||
|
||||
await expect(page.locator("body")).not.toContainText(/passwordCiphertext|usernameCiphertext|notesCiphertext/u);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page, { include: '[data-ui-id="ui.hr.vault"]' });
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,104 @@
|
||||
import * as OTPAuth from "otpauth";
|
||||
|
||||
import { expect, test, type Page } from "./utils/test";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { loginAsAdminUser } from "./utils/auth";
|
||||
import { waitForHydration } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
const credentials =
|
||||
process.env.E2E_ADMIN_EMAIL && process.env.E2E_ADMIN_PASSWORD ? { email: process.env.E2E_ADMIN_EMAIL, password: process.env.E2E_ADMIN_PASSWORD } : null;
|
||||
const platformLeadsPath = process.env.E2E_ADMIN_PLATFORM_LEADS_PATH ?? "/leads";
|
||||
const platformLeadSourceName = process.env.E2E_ADMIN_PLATFORM_LEAD_SOURCE_NAME ?? "E2E Readiness Platform Leads";
|
||||
|
||||
async function establishTemporaryAdminMfaStepUp(page: Page): Promise<() => Promise<void>> {
|
||||
if (new URL(page.url()).pathname !== "/settings/profile") return async () => undefined;
|
||||
|
||||
const password = page.locator('[data-ui-id="ui.settings.profile.mfa.passwordCurrent"]');
|
||||
const toggle = page.locator('[data-ui-id="ui.settings.profile.mfa.toggle.submit"]');
|
||||
await expect(password).toBeVisible();
|
||||
await password.fill(credentials!.password);
|
||||
await toggle.click();
|
||||
|
||||
const setupUri = page.getByLabel(/Authenticator setup URI|Authenticator-Einrichtungs-URI/iu);
|
||||
await expect(setupUri).toBeVisible();
|
||||
const uri = (await setupUri.textContent())?.trim();
|
||||
expect(uri, "Temporary E2E admin MFA enrollment returned no setup URI").toBeTruthy();
|
||||
const code = OTPAuth.URI.parse(uri!).generate();
|
||||
|
||||
await page.locator('[data-ui-id="ui.settings.profile.mfa.confirm.code"]').fill(code);
|
||||
await page.locator('[data-ui-id="ui.settings.profile.mfa.confirm.submit"]').click();
|
||||
await expect(page.getByText(/^(Enabled|Aktiviert)$/iu).first()).toBeVisible();
|
||||
|
||||
return async () => {
|
||||
await page.goto("/settings/profile", { waitUntil: "domcontentloaded" });
|
||||
await expect(password).toBeVisible();
|
||||
await password.fill(credentials!.password);
|
||||
await toggle.click();
|
||||
await expect(page.getByText(/^(Not enabled|Nicht aktiviert)$/iu).first()).toBeVisible();
|
||||
};
|
||||
}
|
||||
|
||||
test.describe("R-LEADS platform lead inbox", () => {
|
||||
test("creates a lead through the native inbox and shows the persisted result", async ({ page }, testInfo) => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_ADMIN_EMAIL", "E2E_ADMIN_PASSWORD"], "Skipping authenticated platform-lead smoke");
|
||||
await loginAsAdminUser(page, credentials!);
|
||||
const cleanupMfa = await establishTemporaryAdminMfaStepUp(page);
|
||||
|
||||
try {
|
||||
const newLeadPath = `${platformLeadsPath.replace(/\/$/u, "")}/new`;
|
||||
const response = await page.goto(newLeadPath, { waitUntil: "domcontentloaded" });
|
||||
expect(response, "Platform lead intake returned no document response").not.toBeNull();
|
||||
expect(response!.ok(), `Platform lead intake returned ${response!.status()}`).toBe(true);
|
||||
expect(new URL(page.url()).pathname).toBe(newLeadPath);
|
||||
await waitForHydration(page);
|
||||
|
||||
const createScreen = page.locator('[data-ui-id="ui.admin.platformLeads.new"]');
|
||||
await expect(createScreen).toBeVisible();
|
||||
await expect(page.getByRole("heading", { name: /^(Lead manuell anlegen|Create lead manually)$/iu })).toBeVisible();
|
||||
|
||||
const sourceSelect = page.getByRole("combobox", { name: /^(Quelle|Source)$/iu }).first();
|
||||
await expect(sourceSelect).toBeEnabled();
|
||||
await sourceSelect.click();
|
||||
const sourceOption = page.getByRole("option", { name: platformLeadSourceName, exact: true });
|
||||
await expect(sourceOption, `Seeded platform lead source ${platformLeadSourceName} must be available`).toBeVisible();
|
||||
await sourceOption.click();
|
||||
|
||||
const suffix = `${Date.now()}-${testInfo.workerIndex}`;
|
||||
const firstName = "E2E";
|
||||
const lastName = `Smoke ${suffix}`;
|
||||
const displayName = `${firstName} ${lastName}`;
|
||||
const company = `HiveGrid E2E ${suffix}`;
|
||||
const message = `Persisted platform lead smoke ${suffix}`;
|
||||
await createScreen.locator('input[name="firstName"]').fill(firstName);
|
||||
await createScreen.locator('input[name="lastName"]').fill(lastName);
|
||||
await createScreen.locator('input[name="email"]').fill(`platform-lead-${suffix}@example.test`);
|
||||
await createScreen.locator('input[name="company"]').fill(company);
|
||||
await createScreen.locator('textarea[name="message"]').fill(message);
|
||||
|
||||
await createScreen.getByRole("button", { name: /^(Lead erstellen|Create lead)$/iu }).click();
|
||||
await page.waitForURL((url) => /^\/leads\/[^/]+$/u.test(url.pathname) && url.searchParams.get("feedback") === "created");
|
||||
|
||||
const detailScreen = page.locator('[data-ui-id="ui.admin.platformLeads.detail"]');
|
||||
await expect(detailScreen).toBeVisible();
|
||||
await expect(page.getByRole("heading", { name: displayName, exact: true })).toBeVisible();
|
||||
await expect(detailScreen.getByText(/^(Lead wurde angelegt\.|Lead created\.)$/iu)).toBeVisible();
|
||||
await expect(detailScreen.getByText(company, { exact: true })).toBeVisible();
|
||||
await expect(detailScreen.getByText(message, { exact: true })).toBeVisible();
|
||||
await expect(detailScreen.getByText(platformLeadSourceName, { exact: true })).toBeVisible();
|
||||
|
||||
const note = `Verified in platform lead smoke ${suffix}`;
|
||||
await detailScreen.locator('textarea[name="note"]').fill(note);
|
||||
await detailScreen.getByRole("button", { name: /^(Notiz hinzufügen|Add note)$/iu }).click();
|
||||
await page.waitForURL((url) => /^\/leads\/[^/]+$/u.test(url.pathname) && url.searchParams.get("feedback") === "updated");
|
||||
await expect(detailScreen.getByText(/^(Lead wurde aktualisiert\.|Lead updated\.)$/iu)).toBeVisible();
|
||||
await expect(detailScreen.getByText(note, { exact: true })).toBeVisible();
|
||||
await expectNoCriticalA11yViolations(page, { include: '[data-ui-id="ui.admin.platformLeads.detail"]' });
|
||||
} finally {
|
||||
// Preserve the primary assertion error if the page is already being
|
||||
// closed by Playwright's test timeout. A fresh readiness seed also
|
||||
// clears disposable MFA fixture state before the next live run.
|
||||
await cleanupMfa().catch(() => undefined);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -135,7 +135,7 @@ test.describe("plugin hook lifecycle mobile a11y", () => {
|
||||
});
|
||||
|
||||
await auditLink.click();
|
||||
await expect(page).toHaveURL(/\/settings\/plugins\/[^/?#]+\/audit(?:[?#].*)?$/u);
|
||||
await expect(page).toHaveURL(/\/settings\/integrations\/plugins\/[^/?#]+\/audit(?:[?#].*)?$/u);
|
||||
|
||||
// No data-ui-ids exist on the audit route; assert via real rendered text.
|
||||
await expect(page.getByRole("heading", { name: new RegExp(escapeRegExp(lifecyclePluginId), "u") }).first()).toBeVisible();
|
||||
@@ -216,8 +216,10 @@ test.describe("plugin hook lifecycle mobile a11y", () => {
|
||||
await skipIfUnavailable(page, response, "Plugin hook lifecycle deactivate/re-enable path");
|
||||
|
||||
let pluginRow = await readinessPluginRow(page);
|
||||
const lifecycleForm = pluginRow.locator('[data-ui-id="ui.plugins.lifecycle.form"]').first();
|
||||
if ((await lifecycleForm.count()) === 0 || !(await lifecycleForm.isVisible())) {
|
||||
// AK-UI-05: the lifecycle control is a ~/ui button carrying its op in
|
||||
// `data-op`, not a <Form> with a hidden input.
|
||||
const lifecycleControl = lifecycleButton(pluginRow);
|
||||
if ((await lifecycleControl.count()) === 0 || !(await lifecycleControl.isVisible())) {
|
||||
skipOrFailWhenE2eFixtureMissing("Plugin readiness fixture has no manageable lifecycle controls");
|
||||
}
|
||||
|
||||
@@ -235,22 +237,21 @@ test.describe("plugin hook lifecycle mobile a11y", () => {
|
||||
pluginRow = await readinessPluginRow(page);
|
||||
|
||||
// Deactivate.
|
||||
await pluginRow.locator('[data-ui-id="ui.plugins.lifecycle.form"] [data-ui-id="ui.plugins.lifecycle.button"]').first().click();
|
||||
await expect(pluginRow.locator('input[name="op"]').first()).toHaveValue("enable");
|
||||
await lifecycleButton(pluginRow).click();
|
||||
await expect(lifecycleButton(pluginRow)).toHaveAttribute("data-op", "enable");
|
||||
await page.reload({ waitUntil: "domcontentloaded" });
|
||||
pluginRow = await readinessPluginRow(page);
|
||||
await expect(pluginRow.locator('[data-ui-id="ui.plugins.lifecycle.form"] input[name="op"]').first()).toHaveValue("enable");
|
||||
await expect(lifecycleButton(pluginRow)).toHaveAttribute("data-op", "enable");
|
||||
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
// Re-enable.
|
||||
const enableForm = pluginRow.locator('[data-ui-id="ui.plugins.lifecycle.form"]').first();
|
||||
await enableForm.locator('[data-ui-id="ui.plugins.lifecycle.button"]').click();
|
||||
await expect(pluginRow.locator('input[name="op"]').first()).toHaveValue("disable");
|
||||
await lifecycleButton(pluginRow).click();
|
||||
await expect(lifecycleButton(pluginRow)).toHaveAttribute("data-op", "disable");
|
||||
await page.reload({ waitUntil: "domcontentloaded" });
|
||||
pluginRow = await readinessPluginRow(page);
|
||||
await expect(pluginRow.locator('[data-ui-id="ui.plugins.lifecycle.form"] input[name="op"]').first()).toHaveValue("disable");
|
||||
await expect(lifecycleButton(pluginRow)).toHaveAttribute("data-op", "disable");
|
||||
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
@@ -357,15 +358,22 @@ type CapabilityGrantSnapshot = {
|
||||
granted: boolean;
|
||||
};
|
||||
|
||||
function capabilityRevokeForm(pluginRow: Locator, capabilityName: string): Locator {
|
||||
return pluginRow
|
||||
.locator(`[data-ui-id="ui.plugins.capability.revoke.form"]:has(input[name="capabilityNames[]"][value="${capabilityName}"])`)
|
||||
.first();
|
||||
/**
|
||||
* AK-UI-05: revoking is a per-capability trigger that opens a destructive
|
||||
* confirm dialog. The trigger only renders while the capability is granted, so
|
||||
* its presence still IS the "granted" signal.
|
||||
*/
|
||||
function capabilityRevokeTrigger(pluginRow: Locator, capabilityName: string): Locator {
|
||||
return pluginRow.locator(`[data-ui-id="ui.plugins.capability.revoke.button"][data-capability="${capabilityName}"]`).first();
|
||||
}
|
||||
|
||||
function lifecycleButton(pluginRow: Locator): Locator {
|
||||
return pluginRow.locator('[data-ui-id="ui.plugins.lifecycle.button"]').first();
|
||||
}
|
||||
|
||||
async function isCapabilityGranted(pluginRow: Locator, capabilityName: string): Promise<boolean> {
|
||||
const form = capabilityRevokeForm(pluginRow, capabilityName);
|
||||
return (await form.count()) > 0 && (await form.isVisible());
|
||||
const trigger = capabilityRevokeTrigger(pluginRow, capabilityName);
|
||||
return (await trigger.count()) > 0 && (await trigger.isVisible());
|
||||
}
|
||||
|
||||
async function snapshotCapabilityGrant(page: Page, capabilityName: string): Promise<CapabilityGrantSnapshot> {
|
||||
@@ -387,13 +395,12 @@ async function ensureCapabilityGranted(page: Page, capabilityName: string): Prom
|
||||
}
|
||||
|
||||
await reviewButton.click();
|
||||
const reviewRow = reviewButton.locator("xpath=ancestor::li[1]");
|
||||
const reviewForm = reviewRow.locator('[data-ui-id="ui.plugins.capabilityReview.form"]').first();
|
||||
const reviewForm = page.locator('[data-ui-id="ui.plugins.capabilityReview.form"]').first();
|
||||
await expect(reviewForm).toBeVisible();
|
||||
|
||||
const capabilityCheckbox = reviewForm.locator(`input[name="capabilities[]"][value="${capabilityName}"]`).first();
|
||||
const capabilityCheckbox = reviewForm.locator(`[data-ui-id="ui.plugins.capabilityReview.checkbox"][data-capability="${capabilityName}"]`).first();
|
||||
if ((await capabilityCheckbox.count()) === 0) {
|
||||
skipOrFailWhenE2eFixtureMissing(`Plugin readiness fixture review form has no ${capabilityName} capability to grant`);
|
||||
skipOrFailWhenE2eFixtureMissing(`Plugin readiness fixture review dialog has no ${capabilityName} capability to grant`);
|
||||
}
|
||||
|
||||
const checkboxes = reviewForm.locator('[data-ui-id="ui.plugins.capabilityReview.checkbox"]:not([disabled])');
|
||||
@@ -429,7 +436,10 @@ async function restoreCapabilityGrant(page: Page, snapshot: CapabilityGrantSnaps
|
||||
const granted = await isCapabilityGranted(pluginRow, snapshot.capabilityName);
|
||||
|
||||
if (granted && !snapshot.granted) {
|
||||
await capabilityRevokeForm(pluginRow, snapshot.capabilityName).locator('[data-ui-id="ui.plugins.capability.revoke.button"]').click();
|
||||
await capabilityRevokeTrigger(pluginRow, snapshot.capabilityName).click();
|
||||
const revokeDialog = page.locator('[data-ui-id="ui.plugins.capability.revoke.form"]').first();
|
||||
await expect(revokeDialog).toBeVisible();
|
||||
await revokeDialog.locator('[data-ui-id="ui.plugins.capability.revoke.confirm"]').click();
|
||||
await page.reload({ waitUntil: "domcontentloaded" });
|
||||
pluginRow = await readinessPluginRow(page);
|
||||
} else if (!granted && snapshot.granted) {
|
||||
@@ -445,9 +455,9 @@ async function restoreCapabilityGrant(page: Page, snapshot: CapabilityGrantSnaps
|
||||
}
|
||||
|
||||
async function lifecycleOperation(pluginRow: Locator): Promise<"enable" | "disable" | null> {
|
||||
const op = pluginRow.locator('[data-ui-id="ui.plugins.lifecycle.form"] input[name="op"]').first();
|
||||
if ((await op.count()) === 0) return null;
|
||||
const value = await op.inputValue();
|
||||
const button = lifecycleButton(pluginRow);
|
||||
if ((await button.count()) === 0) return null;
|
||||
const value = await button.getAttribute("data-op");
|
||||
return value === "enable" || value === "disable" ? value : null;
|
||||
}
|
||||
|
||||
@@ -462,12 +472,10 @@ async function restoreLifecycleEnabled(page: Page, enabled: boolean): Promise<vo
|
||||
const currentEnabled = operation === "disable";
|
||||
if (currentEnabled === enabled) return;
|
||||
|
||||
await pluginRow.locator('[data-ui-id="ui.plugins.lifecycle.button"]').first().click();
|
||||
await expect(pluginRow.locator('input[name="op"]').first()).toHaveValue(enabled ? "disable" : "enable");
|
||||
await lifecycleButton(pluginRow).click();
|
||||
await expect(lifecycleButton(pluginRow)).toHaveAttribute("data-op", enabled ? "disable" : "enable");
|
||||
await page.reload({ waitUntil: "domcontentloaded" });
|
||||
await expect((await readinessPluginRow(page)).locator('[data-ui-id="ui.plugins.lifecycle.form"] input[name="op"]').first()).toHaveValue(
|
||||
enabled ? "disable" : "enable"
|
||||
);
|
||||
await expect(lifecycleButton(await readinessPluginRow(page))).toHaveAttribute("data-op", enabled ? "disable" : "enable");
|
||||
}
|
||||
|
||||
async function firstExistingLocator(primary: Locator, fallback: Locator): Promise<Locator> {
|
||||
|
||||
@@ -61,23 +61,20 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
skipOrFailWhenE2eFixtureMissing("Plugin settings fixture has no missing capabilities to review");
|
||||
}
|
||||
|
||||
const reviewPanelId = await reviewButton.getAttribute("aria-controls");
|
||||
expect(reviewPanelId).toMatch(/.+/u);
|
||||
// AK-UI-05: the review is a real ~/ui dialog. It is portaled to the body, so
|
||||
// it is scoped from the page, not from the plugin row. The "reviewed" state
|
||||
// lives in React (no hidden input any more) — the approve button's enabled
|
||||
// state IS the observable contract.
|
||||
await expect(reviewButton).toHaveAttribute("aria-haspopup", "dialog");
|
||||
await expect(reviewButton).toHaveAttribute("aria-expanded", "false");
|
||||
await reviewButton.focus();
|
||||
await expect(reviewButton).toBeFocused();
|
||||
await page.keyboard.press("Space");
|
||||
await expect(reviewButton).toHaveAttribute("aria-expanded", "true");
|
||||
|
||||
const reviewRow = reviewButton.locator("xpath=ancestor::li[1]");
|
||||
const reviewForm = reviewRow.locator('[data-ui-id="ui.plugins.capabilityReview.form"]').first();
|
||||
const reviewForm = page.locator('[data-ui-id="ui.plugins.capabilityReview.form"]').first();
|
||||
await expect(reviewForm).toBeVisible();
|
||||
await expect(reviewForm).toHaveAttribute("id", reviewPanelId!);
|
||||
await expect(reviewForm).toHaveAccessibleName(new RegExp(readinessPluginId, "u"));
|
||||
await expect(reviewForm.locator('input[name="id"]')).toHaveValue(/.+/u);
|
||||
await expect(reviewForm.locator('input[name="op"]')).toHaveValue(/^(grant|grantAndEnable)$/u);
|
||||
await expect(reviewForm.locator('input[name="capabilityReviewDigest"]')).toHaveValue(/.+/u);
|
||||
await expect(reviewForm.locator('input[name="capabilitiesReviewed"]')).toHaveValue("no");
|
||||
const approveButton = await firstExistingLocator(reviewForm.locator('[data-ui-id="ui.plugins.capabilityReview.button"]').first(), page.getByRole("button", { name: /approve|freigeben/i }).last());
|
||||
await expect(approveButton).toBeDisabled();
|
||||
|
||||
@@ -87,20 +84,14 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
for (let index = 0; index < checkboxCount; index += 1) {
|
||||
await checkboxes.nth(index).check();
|
||||
}
|
||||
await expect(reviewForm.locator('input[name="capabilitiesReviewed"]')).toHaveValue("yes");
|
||||
await expect(approveButton).toBeEnabled();
|
||||
|
||||
await checkboxes.first().uncheck();
|
||||
await expect(reviewForm.locator('input[name="capabilitiesReviewed"]')).toHaveValue("no");
|
||||
await expect(approveButton).toBeDisabled();
|
||||
|
||||
const confirmation = await firstExistingLocator(
|
||||
checkboxes.first(),
|
||||
page.getByLabel(/reviewed the requested plugin capabilities|angeforderten plugin-berechtigungen geprüft/i).first(),
|
||||
);
|
||||
const confirmation = checkboxes.first();
|
||||
await expect(confirmation).toBeVisible();
|
||||
await confirmation.check();
|
||||
await expect(reviewForm.locator('input[name="capabilitiesReviewed"]')).toHaveValue("yes");
|
||||
await expect(approveButton).toBeEnabled();
|
||||
|
||||
await expectNoHorizontalOverflow(page);
|
||||
@@ -135,8 +126,7 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
const submittedPost = await capturePluginPost(page);
|
||||
|
||||
await reviewButton.click();
|
||||
const reviewRow = reviewButton.locator("xpath=ancestor::li[1]");
|
||||
const reviewForm = reviewRow.locator('[data-ui-id="ui.plugins.capabilityReview.form"]').first();
|
||||
const reviewForm = page.locator('[data-ui-id="ui.plugins.capabilityReview.form"]').first();
|
||||
await expect(reviewForm).toBeVisible();
|
||||
|
||||
const checkboxes = reviewForm.locator('[data-ui-id="ui.plugins.capabilityReview.checkbox"]:not([disabled])');
|
||||
@@ -151,7 +141,6 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
for (let index = 0; index < checkboxCount; index += 1) {
|
||||
await checkboxes.nth(index).check();
|
||||
}
|
||||
await expect(reviewForm.locator('input[name="capabilitiesReviewed"]')).toHaveValue("yes");
|
||||
await expect(approveButton).toBeEnabled();
|
||||
|
||||
await denyButton.click();
|
||||
@@ -160,10 +149,10 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
await expect(reviewForm).toHaveCount(0);
|
||||
await expect.poll(submittedPost, { message: "capability deny stays non-mutating", timeout: 500 }).toBeNull();
|
||||
|
||||
// Deny drops every tick: re-opening starts from an unreviewed, blocked state.
|
||||
await reviewButton.click();
|
||||
await expect(reviewForm).toBeVisible();
|
||||
await expect(reviewForm.locator('[data-ui-id="ui.plugins.capabilityReview.checkbox"]').first()).not.toBeChecked();
|
||||
await expect(reviewForm.locator('input[name="capabilitiesReviewed"]')).toHaveValue("no");
|
||||
await expect(reviewForm.locator('[data-ui-id="ui.plugins.capabilityReview.button"]').first()).toBeDisabled();
|
||||
|
||||
await expectNoHorizontalOverflow(page);
|
||||
@@ -187,8 +176,7 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
|
||||
await reviewButton.click();
|
||||
await expect(reviewButton).toHaveAttribute("aria-expanded", "true");
|
||||
const reviewRow = reviewButton.locator("xpath=ancestor::li[1]");
|
||||
const reviewForm = reviewRow.locator('[data-ui-id="ui.plugins.capabilityReview.form"]').first();
|
||||
const reviewForm = page.locator('[data-ui-id="ui.plugins.capabilityReview.form"]').first();
|
||||
await expect(reviewForm).toBeVisible();
|
||||
const approveButton = await firstExistingLocator(
|
||||
reviewForm.locator('[data-ui-id="ui.plugins.capabilityReview.button"]').first(),
|
||||
@@ -205,7 +193,6 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
for (let index = 0; index < confirmationCount; index += 1) {
|
||||
await confirmations.nth(index).check();
|
||||
}
|
||||
await expect(reviewForm.locator('input[name="capabilitiesReviewed"]')).toHaveValue("yes");
|
||||
await expect(approveButton).toBeEnabled();
|
||||
|
||||
const expectedPathname = new URL(page.url()).pathname;
|
||||
@@ -226,18 +213,21 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
});
|
||||
|
||||
await approveButton.click();
|
||||
// AK-UI-05: a rejected grant must NOT tear the dialog down. The error is
|
||||
// announced inside the dialog the manager is standing in, and the controls
|
||||
// stay usable so they can retry.
|
||||
const alert = page.getByRole("alert").filter({ hasText: /capability review is stale|berechtigungsprüfung.*veraltet/i });
|
||||
await expect(alert).toBeVisible();
|
||||
await expect(reviewButton).toHaveAttribute("aria-expanded", "true");
|
||||
await expect(alert.first()).toBeVisible();
|
||||
await expect(reviewForm).toBeVisible();
|
||||
await expect(reviewForm.locator('[data-ui-id="ui.plugins.capabilityReview.error"]')).toBeVisible();
|
||||
await expect(reviewButton).toHaveAttribute("aria-expanded", "true");
|
||||
await expect(approveButton).toBeEnabled();
|
||||
|
||||
await reviewButton.focus();
|
||||
await expect(reviewButton).toBeFocused();
|
||||
await page.keyboard.press("Enter");
|
||||
// Escape closes the modal (standard dialog semantics); the trigger reopens it.
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(reviewForm).toHaveCount(0);
|
||||
await expect(reviewButton).toHaveAttribute("aria-expanded", "false");
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(reviewButton).toHaveAttribute("aria-expanded", "true");
|
||||
await reviewButton.click();
|
||||
await expect(reviewForm).toBeVisible();
|
||||
});
|
||||
|
||||
@@ -252,7 +242,7 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
const initialState = await snapshotPluginCapabilityState(page, readinessPluginId, "audit");
|
||||
try {
|
||||
let pluginRow = await readinessPluginRow(page);
|
||||
await revokeCapabilityIfGranted(pluginRow, "audit");
|
||||
await revokeCapabilityIfGranted(page, pluginRow, "audit");
|
||||
await page.reload({ waitUntil: "domcontentloaded" });
|
||||
pluginRow = await readinessPluginRow(page);
|
||||
|
||||
@@ -265,10 +255,9 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
}
|
||||
|
||||
await reviewButton.click();
|
||||
const reviewRow = reviewButton.locator("xpath=ancestor::li[1]");
|
||||
const reviewForm = reviewRow.locator('[data-ui-id="ui.plugins.capabilityReview.form"]').first();
|
||||
const reviewForm = page.locator('[data-ui-id="ui.plugins.capabilityReview.form"]').first();
|
||||
await expect(reviewForm).toBeVisible();
|
||||
await expect(reviewForm.locator('input[name="capabilities[]"][value="audit"]')).toHaveCount(1);
|
||||
await expect(reviewForm.locator('[data-ui-id="ui.plugins.capabilityReview.checkbox"][data-capability="audit"]')).toHaveCount(1);
|
||||
|
||||
const approveButton = await firstExistingLocator(
|
||||
reviewForm.locator('[data-ui-id="ui.plugins.capabilityReview.button"]').first(),
|
||||
@@ -293,20 +282,19 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
// fetch, so the reloaded loader can read stale (pre-grant) state and the
|
||||
// revoke form never appears.
|
||||
pluginRow = await readinessPluginRow(page);
|
||||
await expect(capabilityRevokeForm(pluginRow, "audit")).toBeVisible();
|
||||
await expect(capabilityRevokeTrigger(pluginRow, "audit")).toBeVisible();
|
||||
|
||||
await page.reload({ waitUntil: "domcontentloaded" });
|
||||
pluginRow = await readinessPluginRow(page);
|
||||
const auditRevokeForm = capabilityRevokeForm(pluginRow, "audit");
|
||||
await expect(auditRevokeForm).toBeVisible();
|
||||
await expect(capabilityRevokeTrigger(pluginRow, "audit")).toBeVisible();
|
||||
|
||||
await auditRevokeForm.locator('[data-ui-id="ui.plugins.capability.revoke.button"]').click();
|
||||
// Same race on revoke: let the revalidation drop the revoke form before the
|
||||
// explicit reload re-asserts persistence.
|
||||
await expect(capabilityRevokeForm(await readinessPluginRow(page), "audit")).toHaveCount(0);
|
||||
await confirmCapabilityRevoke(page, pluginRow, "audit");
|
||||
// Same race on revoke: let the revalidation drop the revoke trigger before
|
||||
// the explicit reload re-asserts persistence.
|
||||
await expect(capabilityRevokeTrigger(await readinessPluginRow(page), "audit")).toHaveCount(0);
|
||||
await page.reload({ waitUntil: "domcontentloaded" });
|
||||
pluginRow = await readinessPluginRow(page);
|
||||
await expect(capabilityRevokeForm(pluginRow, "audit")).toHaveCount(0);
|
||||
await expect(capabilityRevokeTrigger(pluginRow, "audit")).toHaveCount(0);
|
||||
|
||||
const restoredReviewButton = await firstExistingLocator(
|
||||
pluginRow.locator('[data-ui-id="ui.plugins.capabilityReview.toggle"]').first(),
|
||||
@@ -343,7 +331,7 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
await expect(manifestButton).toHaveAttribute("aria-expanded", "false");
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(manifestButton).toHaveAttribute("aria-expanded", "true");
|
||||
const manifestRow = manifestButton.locator("xpath=ancestor::li[1]");
|
||||
const manifestRow = manifestButton.locator('xpath=ancestor::*[@data-ui-id="ui.plugins.item"][1]');
|
||||
const manifestPanel = await firstExistingLocator(manifestRow.locator('[data-ui-id="ui.plugins.manifest.panel"]').first(), pluginRow.locator(`[id="${manifestPanelId}"]`).first());
|
||||
await expect(manifestPanel).toBeVisible();
|
||||
await expect(manifestPanel).toContainText(readinessPluginId);
|
||||
@@ -360,33 +348,25 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
await skipIfUnavailable(page, response, "Plugin settings lifecycle path");
|
||||
|
||||
const pluginRow = await readinessPluginRow(page);
|
||||
const lifecycleForm = pluginRow.locator('[data-ui-id="ui.plugins.lifecycle.form"]').first();
|
||||
if ((await lifecycleForm.count()) === 0 || !(await lifecycleForm.isVisible())) {
|
||||
const lifecycleControl = lifecycleButton(pluginRow);
|
||||
if ((await lifecycleControl.count()) === 0 || !(await lifecycleControl.isVisible())) {
|
||||
skipOrFailWhenE2eFixtureMissing("Plugin fixture has no manageable lifecycle controls");
|
||||
}
|
||||
|
||||
const lifecycleButton = lifecycleForm.locator('[data-ui-id="ui.plugins.lifecycle.button"]').first();
|
||||
const form = lifecycleForm;
|
||||
await expect(form).toHaveCount(1);
|
||||
await expect(form.locator('input[name="id"]')).toHaveValue(/.+/u);
|
||||
await expect(form.locator('input[name="op"]')).toHaveValue(/^(enable|disable)$/u);
|
||||
const csrf = form.locator('input[name="csrf"]');
|
||||
if ((await csrf.count()) > 0) {
|
||||
await expect(csrf).toHaveValue(/.+/u);
|
||||
}
|
||||
// AK-UI-05: there is no hidden-input form any more. The wire contract is now
|
||||
// only observable on the POST body — which is exactly what it always was.
|
||||
await expect(lifecycleControl).toHaveAttribute("data-op", /^(enable|disable)$/u);
|
||||
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
const submittedPost = await capturePluginPost(page);
|
||||
await lifecycleButton.click();
|
||||
await lifecycleControl.click();
|
||||
await expect.poll(submittedPost, { message: "lifecycle POST payload was captured" }).not.toBeNull();
|
||||
const postData = submittedPost()?.postData ?? null;
|
||||
expect(postDataIncludesField(postData, "id", /.+/u)).toBe(true);
|
||||
expect(postDataIncludesField(postData, "op", /^(enable|disable)$/u)).toBe(true);
|
||||
if ((await csrf.count()) > 0) {
|
||||
expect(postDataIncludesField(postData, "csrf", /.+/u)).toBe(true);
|
||||
}
|
||||
expect(postDataIncludesField(postData, "csrf", /.+/u)).toBe(true);
|
||||
});
|
||||
|
||||
test("lifecycle errors stay announced and keep controls retryable", async ({ page }) => {
|
||||
@@ -396,13 +376,12 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
await skipIfUnavailable(page, response, "Plugin settings lifecycle error path");
|
||||
|
||||
const pluginRow = await readinessPluginRow(page);
|
||||
const lifecycleForm = pluginRow.locator('[data-ui-id="ui.plugins.lifecycle.form"]').first();
|
||||
if ((await lifecycleForm.count()) === 0 || !(await lifecycleForm.isVisible())) {
|
||||
const lifecycleControl = lifecycleButton(pluginRow);
|
||||
if ((await lifecycleControl.count()) === 0 || !(await lifecycleControl.isVisible())) {
|
||||
skipOrFailWhenE2eFixtureMissing("Plugin fixture has no manageable lifecycle controls");
|
||||
}
|
||||
|
||||
const lifecycleButton = lifecycleForm.locator('[data-ui-id="ui.plugins.lifecycle.button"]').first();
|
||||
const initialOperation = await lifecycleForm.locator('input[name="op"]').inputValue();
|
||||
const initialOperation = await lifecycleControl.getAttribute("data-op");
|
||||
expect(initialOperation).toMatch(/^(enable|disable)$/u);
|
||||
|
||||
const expectedPathname = new URL(page.url()).pathname;
|
||||
@@ -424,17 +403,19 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
await route.continue();
|
||||
});
|
||||
|
||||
await lifecycleButton.focus();
|
||||
await expect(lifecycleButton).toBeFocused();
|
||||
await lifecycleControl.focus();
|
||||
await expect(lifecycleControl).toBeFocused();
|
||||
await page.keyboard.press("Enter");
|
||||
|
||||
const alert = page.getByRole("alert").filter({ hasText: /plugin lifecycle temporarily unavailable/i });
|
||||
await expect(alert).toBeVisible();
|
||||
await expect(alert.first()).toBeVisible();
|
||||
await expect.poll(() => attempts, { message: "lifecycle error POST was intercepted" }).toBe(1);
|
||||
await expect(lifecycleForm.locator('input[name="op"]')).toHaveValue(initialOperation);
|
||||
await expect(lifecycleButton).toBeEnabled();
|
||||
await lifecycleButton.focus();
|
||||
await expect(lifecycleButton).toBeFocused();
|
||||
// The rejected mutation left the plugin state untouched, so the control still
|
||||
// offers the same operation and stays retryable.
|
||||
await expect(lifecycleControl).toHaveAttribute("data-op", initialOperation!);
|
||||
await expect(lifecycleControl).toBeEnabled();
|
||||
await lifecycleControl.focus();
|
||||
await expect(lifecycleControl).toBeFocused();
|
||||
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
@@ -449,31 +430,30 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
await skipIfUnavailable(page, response, "Plugin settings persisted lifecycle path");
|
||||
|
||||
const pluginRow = await pluginRowById(page, lifecyclePluginId);
|
||||
const lifecycleForm = pluginRow.locator('[data-ui-id="ui.plugins.lifecycle.form"]').first();
|
||||
if ((await lifecycleForm.count()) === 0 || !(await lifecycleForm.isVisible())) {
|
||||
const lifecycleControl = lifecycleButton(pluginRow);
|
||||
if ((await lifecycleControl.count()) === 0 || !(await lifecycleControl.isVisible())) {
|
||||
skipOrFailWhenE2eFixtureMissing("Lifecycle plugin fixture has no manageable lifecycle controls");
|
||||
}
|
||||
|
||||
const initialState = await snapshotPluginLifecycleState(page, lifecyclePluginId);
|
||||
try {
|
||||
await expect(lifecycleForm.locator('input[name="op"]')).toHaveValue("disable");
|
||||
await expect(lifecycleControl).toHaveAttribute("data-op", "disable");
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
await lifecycleForm.locator('[data-ui-id="ui.plugins.lifecycle.button"]').click();
|
||||
await expect(pluginRow.locator('input[name="op"]').first()).toHaveValue("enable");
|
||||
await lifecycleControl.click();
|
||||
await expect(lifecycleButton(pluginRow)).toHaveAttribute("data-op", "enable");
|
||||
|
||||
await page.reload({ waitUntil: "domcontentloaded" });
|
||||
const disabledPluginRow = await pluginRowById(page, lifecyclePluginId);
|
||||
await expect(disabledPluginRow.locator('input[name="op"]').first()).toHaveValue("enable");
|
||||
await expect(lifecycleButton(disabledPluginRow)).toHaveAttribute("data-op", "enable");
|
||||
|
||||
const enableForm = disabledPluginRow.locator('[data-ui-id="ui.plugins.lifecycle.form"]').first();
|
||||
await enableForm.locator('[data-ui-id="ui.plugins.lifecycle.button"]').click();
|
||||
await expect(disabledPluginRow.locator('input[name="op"]').first()).toHaveValue("disable");
|
||||
await lifecycleButton(disabledPluginRow).click();
|
||||
await expect(lifecycleButton(disabledPluginRow)).toHaveAttribute("data-op", "disable");
|
||||
|
||||
await page.reload({ waitUntil: "domcontentloaded" });
|
||||
const enabledPluginRow = await pluginRowById(page, lifecyclePluginId);
|
||||
await expect(enabledPluginRow.locator('input[name="op"]').first()).toHaveValue("disable");
|
||||
await expect(lifecycleButton(enabledPluginRow)).toHaveAttribute("data-op", "disable");
|
||||
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
@@ -492,7 +472,7 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
const settingsLink = pluginRow.locator('[data-ui-id="ui.plugins.settings.open"]').first();
|
||||
if ((await settingsLink.count()) > 0 && (await settingsLink.isVisible())) {
|
||||
await settingsLink.click();
|
||||
await expect(page).toHaveURL(/\/settings\/plugins\/[^/?#]+(?:[?#].*)?$/u);
|
||||
await expect(page).toHaveURL(/\/settings\/integrations\/plugins\/[^/?#]+(?:[?#].*)?$/u);
|
||||
}
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.settings.page"]').first()).toBeVisible();
|
||||
@@ -659,42 +639,39 @@ test.describe("plugin settings mobile a11y", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("capability revoke controls expose a non-mutating form contract", async ({ page }) => {
|
||||
test("capability revoke confirms in a dialog and keeps the revoke wire contract", async ({ page }) => {
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(pluginSettingsPath!, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, "Plugin settings revoke path");
|
||||
|
||||
const pluginRow = await readinessPluginRow(page);
|
||||
const form = pluginRow.locator('[data-ui-id="ui.plugins.capability.revoke.form"]').first();
|
||||
if ((await form.count()) === 0 || !(await form.isVisible())) {
|
||||
const trigger = pluginRow.locator('[data-ui-id="ui.plugins.capability.revoke.button"]').first();
|
||||
if ((await trigger.count()) === 0 || !(await trigger.isVisible())) {
|
||||
skipOrFailWhenE2eFixtureMissing("Plugin fixture has no granted capability revoke controls");
|
||||
}
|
||||
|
||||
await expect(form.locator('input[name="id"]')).toHaveValue(/.+/u);
|
||||
await expect(form.locator('input[name="pluginId"]')).toHaveValue(readinessPluginId);
|
||||
await expect(form.locator('input[name="op"]')).toHaveValue("revoke");
|
||||
await expect(form.locator('input[name="capabilityNames[]"]')).toHaveValue(/.+/u);
|
||||
await expect(form.locator('[data-ui-id="ui.plugins.capability.revoke.button"]')).toBeVisible();
|
||||
const csrf = form.locator('input[name="csrf"]');
|
||||
if ((await csrf.count()) > 0) {
|
||||
await expect(csrf).toHaveValue(/.+/u);
|
||||
}
|
||||
await expect(trigger).toHaveAttribute("data-capability", /.+/u);
|
||||
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
// AK-UI-05: revoking disables the plugin, so it is gated behind a destructive
|
||||
// confirm dialog. Opening it must not mutate anything.
|
||||
const submittedPost = await capturePluginPost(page);
|
||||
await form.locator('[data-ui-id="ui.plugins.capability.revoke.button"]').click();
|
||||
await trigger.click();
|
||||
const dialog = page.locator('[data-ui-id="ui.plugins.capability.revoke.form"]').first();
|
||||
await expect(dialog).toBeVisible();
|
||||
await expect.poll(submittedPost, { message: "opening the revoke dialog stays non-mutating", timeout: 500 }).toBeNull();
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
await dialog.locator('[data-ui-id="ui.plugins.capability.revoke.confirm"]').click();
|
||||
await expect.poll(submittedPost, { message: "capability revoke POST payload was captured" }).not.toBeNull();
|
||||
const postData = submittedPost()?.postData ?? null;
|
||||
expect(postDataIncludesField(postData, "id", /.+/u)).toBe(true);
|
||||
expect(postDataIncludesField(postData, "pluginId", new RegExp(`^${escapeRegExp(readinessPluginId)}$`, "u"))).toBe(true);
|
||||
expect(postDataIncludesField(postData, "op", /^revoke$/u)).toBe(true);
|
||||
expect(postDataIncludesField(postData, "capabilityNames[]", /.+/u)).toBe(true);
|
||||
if ((await csrf.count()) > 0) {
|
||||
expect(postDataIncludesField(postData, "csrf", /.+/u)).toBe(true);
|
||||
}
|
||||
expect(postDataIncludesField(postData, "csrf", /.+/u)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -719,8 +696,8 @@ test.describe("plugin settings read-only permissions", () => {
|
||||
await expect(pluginRow).toBeVisible();
|
||||
await expect(pluginRow.locator('[data-ui-id="ui.plugins.manifest.toggle"]').first()).toBeVisible();
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.lifecycle.form"]')).toHaveCount(0);
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.capability.revoke.form"]')).toHaveCount(0);
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.lifecycle.button"]')).toHaveCount(0);
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.capability.revoke.button"]')).toHaveCount(0);
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.capabilityReview.toggle"]')).toHaveCount(0);
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.capabilityReview.form"]')).toHaveCount(0);
|
||||
|
||||
@@ -755,7 +732,7 @@ test.describe("plugin settings read-only permissions", () => {
|
||||
|
||||
const manifestPanelId = await manifestButton.getAttribute("aria-controls");
|
||||
expect(manifestPanelId).toMatch(/.+/u);
|
||||
const manifestRow = manifestButton.locator("xpath=ancestor::li[1]");
|
||||
const manifestRow = manifestButton.locator('xpath=ancestor::*[@data-ui-id="ui.plugins.item"][1]');
|
||||
const manifestPanel = await firstExistingLocator(
|
||||
manifestRow.locator('[data-ui-id="ui.plugins.manifest.panel"]').first(),
|
||||
pluginRow.locator(`[id="${manifestPanelId}"]`).first()
|
||||
@@ -763,8 +740,8 @@ test.describe("plugin settings read-only permissions", () => {
|
||||
await expect(manifestPanel).toBeVisible();
|
||||
await expect(manifestPanel).toContainText(readinessPluginId);
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.lifecycle.form"]')).toHaveCount(0);
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.capability.revoke.form"]')).toHaveCount(0);
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.lifecycle.button"]')).toHaveCount(0);
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.capability.revoke.button"]')).toHaveCount(0);
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.capabilityReview.toggle"]')).toHaveCount(0);
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.capabilityReview.form"]')).toHaveCount(0);
|
||||
await expect.poll(submittedPost, { message: "manifest disclosure stays non-mutating", timeout: 500 }).toBeNull();
|
||||
@@ -781,7 +758,7 @@ test.describe("plugin settings read-only permissions", () => {
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.page"]').first()).toBeVisible();
|
||||
await expect(await readinessPluginRow(page)).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.lifecycle.form"]')).toHaveCount(0);
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.lifecycle.button"]')).toHaveCount(0);
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.capabilityReview.form"]')).toHaveCount(0);
|
||||
|
||||
const expectedRedirectPath = new URL(page.url()).pathname;
|
||||
@@ -896,7 +873,7 @@ async function openReadinessPluginSettingsFrame(page: Page, reason: string): Pro
|
||||
skipOrFailWhenE2eFixtureMissing(`${reason}: plugin fixture has no settings link`);
|
||||
}
|
||||
await settingsLink.click();
|
||||
await expect(page).toHaveURL(/\/settings\/plugins\/[^/?#]+(?:[?#].*)?$/u);
|
||||
await expect(page).toHaveURL(/\/settings\/integrations\/plugins\/[^/?#]+(?:[?#].*)?$/u);
|
||||
}
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.plugins.settings.page"]').first()).toBeVisible();
|
||||
@@ -1006,7 +983,7 @@ async function restorePluginCapabilityState(page: Page, state: PluginCapabilityS
|
||||
const row = await pluginRowById(page, state.pluginId);
|
||||
const granted = await isCapabilityGranted(row, state.capabilityName);
|
||||
if (granted && !state.granted) {
|
||||
await revokeCapabilityIfGranted(row, state.capabilityName);
|
||||
await revokeCapabilityIfGranted(page, row, state.capabilityName);
|
||||
await page.reload({ waitUntil: "domcontentloaded" });
|
||||
} else if (!granted && state.granted) {
|
||||
await grantMissingCapabilities(page, row);
|
||||
@@ -1049,39 +1026,53 @@ async function ensurePluginEnabledState(page: Page, pluginId: string, enabled: b
|
||||
throw new Error(`Unable to restore ${pluginId} lifecycle state because lifecycle controls are unavailable`);
|
||||
}
|
||||
|
||||
const form = row.locator('[data-ui-id="ui.plugins.lifecycle.form"]').first();
|
||||
await form.locator('[data-ui-id="ui.plugins.lifecycle.button"]').click();
|
||||
await expect(row.locator('input[name="op"]').first()).toHaveValue(enabled ? "disable" : "enable");
|
||||
// AK-UI-05: the lifecycle control is a ~/ui button carrying its op, not a
|
||||
// hidden form input. A plugin that is enabled offers "disable" and vice versa.
|
||||
await row.locator('[data-ui-id="ui.plugins.lifecycle.button"]').first().click();
|
||||
await expect(lifecycleButton(row)).toHaveAttribute("data-op", enabled ? "disable" : "enable");
|
||||
await page.reload({ waitUntil: "domcontentloaded" });
|
||||
await expect((await pluginRowById(page, pluginId)).locator('input[name="op"]').first()).toHaveValue(enabled ? "disable" : "enable");
|
||||
await expect(lifecycleButton(await pluginRowById(page, pluginId))).toHaveAttribute("data-op", enabled ? "disable" : "enable");
|
||||
}
|
||||
|
||||
function lifecycleButton(pluginRow: Locator): Locator {
|
||||
return pluginRow.locator('[data-ui-id="ui.plugins.lifecycle.button"]').first();
|
||||
}
|
||||
|
||||
async function getPluginLifecycleOperation(pluginRow: Locator): Promise<"enable" | "disable" | null> {
|
||||
const op = pluginRow.locator('[data-ui-id="ui.plugins.lifecycle.form"] input[name="op"]').first();
|
||||
if ((await op.count()) === 0) return null;
|
||||
const value = await op.inputValue();
|
||||
const button = lifecycleButton(pluginRow);
|
||||
if ((await button.count()) === 0) return null;
|
||||
const value = await button.getAttribute("data-op");
|
||||
return value === "enable" || value === "disable" ? value : null;
|
||||
}
|
||||
|
||||
function capabilityRevokeForm(pluginRow: Locator, capabilityName: string): Locator {
|
||||
return pluginRow
|
||||
.locator(
|
||||
`[data-ui-id="ui.plugins.capability.revoke.form"]:has(input[name="capabilityNames[]"][value="${capabilityName}"])`
|
||||
)
|
||||
.first();
|
||||
/**
|
||||
* AK-UI-05: revoking is no longer an inline <Form> but a per-capability trigger
|
||||
* that opens a destructive confirm dialog. The trigger only exists while the
|
||||
* capability is granted, so its presence still IS the "granted" signal.
|
||||
*/
|
||||
function capabilityRevokeTrigger(pluginRow: Locator, capabilityName: string): Locator {
|
||||
return pluginRow.locator(`[data-ui-id="ui.plugins.capability.revoke.button"][data-capability="${capabilityName}"]`).first();
|
||||
}
|
||||
|
||||
async function revokeCapabilityIfGranted(pluginRow: Locator, capabilityName: string): Promise<void> {
|
||||
const form = capabilityRevokeForm(pluginRow, capabilityName);
|
||||
if ((await form.count()) === 0 || !(await form.isVisible())) {
|
||||
/** Clicks the revoke trigger and confirms in the ~/ui dialog it opens. */
|
||||
async function confirmCapabilityRevoke(page: Page, pluginRow: Locator, capabilityName: string): Promise<void> {
|
||||
await capabilityRevokeTrigger(pluginRow, capabilityName).click();
|
||||
const dialog = page.locator('[data-ui-id="ui.plugins.capability.revoke.form"]').first();
|
||||
await expect(dialog).toBeVisible();
|
||||
await dialog.locator('[data-ui-id="ui.plugins.capability.revoke.confirm"]').click();
|
||||
}
|
||||
|
||||
async function revokeCapabilityIfGranted(page: Page, pluginRow: Locator, capabilityName: string): Promise<void> {
|
||||
const trigger = capabilityRevokeTrigger(pluginRow, capabilityName);
|
||||
if ((await trigger.count()) === 0 || !(await trigger.isVisible())) {
|
||||
return;
|
||||
}
|
||||
await form.locator('[data-ui-id="ui.plugins.capability.revoke.button"]').click();
|
||||
await confirmCapabilityRevoke(page, pluginRow, capabilityName);
|
||||
}
|
||||
|
||||
async function isCapabilityGranted(pluginRow: Locator, capabilityName: string): Promise<boolean> {
|
||||
const form = capabilityRevokeForm(pluginRow, capabilityName);
|
||||
return (await form.count()) > 0 && (await form.isVisible());
|
||||
const trigger = capabilityRevokeTrigger(pluginRow, capabilityName);
|
||||
return (await trigger.count()) > 0 && (await trigger.isVisible());
|
||||
}
|
||||
|
||||
async function grantMissingCapabilities(page: Page, pluginRow: Locator): Promise<void> {
|
||||
@@ -1094,8 +1085,7 @@ async function grantMissingCapabilities(page: Page, pluginRow: Locator): Promise
|
||||
}
|
||||
|
||||
await reviewButton.click();
|
||||
const reviewRow = reviewButton.locator("xpath=ancestor::li[1]");
|
||||
const reviewForm = reviewRow.locator('[data-ui-id="ui.plugins.capabilityReview.form"]').first();
|
||||
const reviewForm = page.locator('[data-ui-id="ui.plugins.capabilityReview.form"]').first();
|
||||
await expect(reviewForm).toBeVisible();
|
||||
const checkboxes = reviewForm.locator('[data-ui-id="ui.plugins.capabilityReview.checkbox"]:not([disabled])');
|
||||
const checkboxCount = await checkboxes.count();
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
|
||||
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
const credentials = getTenantCredentials();
|
||||
const portalManagementPaths = [
|
||||
{ name: "analytics", path: process.env.E2E_TENANT_PORTAL_ANALYTICS_PATH },
|
||||
{ name: "settings", path: process.env.E2E_TENANT_PORTAL_SETTINGS_PATH },
|
||||
].filter((target): target is { name: string; path: string } => Boolean(target.path));
|
||||
|
||||
test.describe("portal management mobile a11y", () => {
|
||||
test.use({ viewport: narrowMobileViewport, isMobile: true, hasTouch: true });
|
||||
|
||||
test("portal management pages have no mobile overflow or critical a11y violations", async ({ page }) => {
|
||||
if (!credentials) {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Skipping portal mobile a11y");
|
||||
}
|
||||
if (portalManagementPaths.length === 0) {
|
||||
skipOrFailWhenE2eFixtureMissing("E2E_TENANT_PORTAL_ANALYTICS_PATH or E2E_TENANT_PORTAL_SETTINGS_PATH is required for portal mobile a11y");
|
||||
}
|
||||
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
for (const target of portalManagementPaths) {
|
||||
await page.goto(target.path, { waitUntil: "domcontentloaded" });
|
||||
// The portals plugin module is gated out of the route config by default
|
||||
// (app.$tenant/__portals/** in defaultDisabledPluginRouteFilePatterns), so
|
||||
// the path redirects home when it isn't mounted. Treat that as an
|
||||
// unavailable optional feature here; the readiness lane
|
||||
// (REQUIRE_E2E_READINESS=1) still fails loudly so a deployment that ships
|
||||
// portals is verified there.
|
||||
const landedOnPortal = new RegExp(`${escapeRegExp(target.path)}(?:[?#].*)?$`, "u").test(page.url());
|
||||
if (!landedOnPortal) {
|
||||
skipOrFailWhenE2eFixtureMissing(`Portal route ${target.path} is not mounted (portals module disabled)`);
|
||||
}
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(target.path)}(?:[?#].*)?$`, "u"));
|
||||
await expect(page.locator("body")).toBeVisible();
|
||||
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function escapeRegExp(value: string): string {
|
||||
return value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
// AK-P21 — smoke for the privacy interim screens (AD-28): hub, export jobs,
|
||||
// tenant deletion, subprocessors, AVV. Non-mutating: dialogs are opened and
|
||||
// closed again, no export is started and no deletion is requested. Admin
|
||||
// sub-areas are permission-gated; the smoke only visits sections whose entry
|
||||
// cards the hub actually shows for the test user.
|
||||
|
||||
import { expect, test, type Page } from "./utils/test";
|
||||
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { compactMobileViewport, expectNoHorizontalOverflow } from "./utils/mobile";
|
||||
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
|
||||
const privacyPath = process.env.E2E_TENANT_PRIVACY_PATH ?? tenantPath("settings/profile/data");
|
||||
|
||||
const SECTION_PAGES = {
|
||||
export: "ui.settings.privacy.exportJobs.page",
|
||||
deletion: "ui.settings.privacy.deletion.page",
|
||||
subprocessors: "ui.settings.privacy.subprocessors.page",
|
||||
avv: "ui.settings.privacy.avv.page",
|
||||
} as const;
|
||||
|
||||
type SectionKey = keyof typeof SECTION_PAGES;
|
||||
|
||||
const SECTION_PATHS: Record<SectionKey, string> = {
|
||||
export: tenantPath("settings/compliance/data-export"),
|
||||
deletion: tenantPath("settings/compliance/tenant-deletion"),
|
||||
subprocessors: tenantPath("settings/compliance/subprocessors"),
|
||||
avv: tenantPath("settings/compliance/avv"),
|
||||
};
|
||||
|
||||
test.describe("AK-P21 privacy interim smoke", () => {
|
||||
test("renders the privacy hub with self-service controls", async ({ page }) => {
|
||||
requireTenantLoginInputs("Privacy hub smoke inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(privacyPath, { waitUntil: "domcontentloaded" });
|
||||
expect(response?.ok(), `Privacy hub returned ${response?.status() ?? "no response"}`).toBe(true);
|
||||
|
||||
await expect(page.locator('[data-ui-id="ui.settings.privacy.page"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.privacy.export.form"]').first()).toBeVisible();
|
||||
const deleteForm = page.locator('[data-ui-id="ui.settings.privacy.delete.form"]').first();
|
||||
const reactivateForm = page.locator('[data-ui-id="ui.settings.privacy.reactivate.form"]').first();
|
||||
await expect.poll(async () => (await deleteForm.count()) + (await reactivateForm.count())).toBeGreaterThan(0);
|
||||
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
});
|
||||
|
||||
test("opens the permission-gated admin sections from the hub", async ({ page }) => {
|
||||
requireTenantLoginInputs("Privacy sections smoke inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
for (const section of Object.keys(SECTION_PAGES) as SectionKey[]) {
|
||||
const visible = await visitSectionFromHub(page, section);
|
||||
if (!visible) continue;
|
||||
await expect(
|
||||
page.locator(`[data-ui-id="${SECTION_PAGES[section]}"], [data-ui-id="ui.settings.privacy.${sectionUiKey(section)}.empty"]`).first()
|
||||
).toBeVisible();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
}
|
||||
});
|
||||
|
||||
test("opens and closes the export start dialog without mutating data", async ({ page }) => {
|
||||
requireTenantLoginInputs("Privacy export smoke inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const visible = await visitSectionFromHub(page, "export");
|
||||
if (!visible) {
|
||||
skipOrFailWhenE2eFixtureMissing("Export section is not visible for the test user");
|
||||
}
|
||||
|
||||
const start = page.locator('[data-ui-id="ui.settings.privacy.exportJobs.startUser"], [data-ui-id="ui.settings.privacy.exportJobs.startEmpty"]').first();
|
||||
if ((await start.count()) > 0 && (await start.isEnabled())) {
|
||||
await start.click();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.privacy.exportJobs.startDialog"]')).toBeVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(page.locator('[data-ui-id="ui.settings.privacy.exportJobs.startDialog"]')).toBeHidden();
|
||||
}
|
||||
});
|
||||
|
||||
test("opens and closes the tenant deletion wizard without submitting", async ({ page }) => {
|
||||
requireTenantLoginInputs("Privacy deletion smoke inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const visible = await visitSectionFromHub(page, "deletion");
|
||||
if (!visible) {
|
||||
skipOrFailWhenE2eFixtureMissing("Deletion section is not visible for the test user");
|
||||
}
|
||||
|
||||
const open = page.locator('[data-ui-id="ui.settings.privacy.deletion.open"]');
|
||||
if ((await open.count()) > 0 && (await open.isVisible()) && (await open.isEnabled())) {
|
||||
await open.click();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.privacy.deletion.wizard"]')).toBeVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(page.locator('[data-ui-id="ui.settings.privacy.deletion.wizard"]')).toBeHidden();
|
||||
} else {
|
||||
// A pending request shows the grace banner with the cancel action instead.
|
||||
await expect(page.locator('[data-ui-id="ui.settings.privacy.deletion.grace"]')).toBeVisible();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test.describe("AK-P21 privacy compact mobile smoke", () => {
|
||||
test.use({ viewport: compactMobileViewport, isMobile: true, hasTouch: true });
|
||||
|
||||
test("keeps the privacy hub and visible sections readable at 320px", async ({ page }) => {
|
||||
requireTenantLoginInputs("Privacy compact mobile inputs not configured");
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(privacyPath, { waitUntil: "domcontentloaded" });
|
||||
expect(response?.ok(), `Privacy hub returned ${response?.status() ?? "no response"}`).toBe(true);
|
||||
await expect(page.locator('[data-ui-id="ui.settings.privacy.page"]').first()).toBeVisible();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
for (const section of Object.keys(SECTION_PAGES) as SectionKey[]) {
|
||||
const visible = await visitSectionFromHub(page, section);
|
||||
if (!visible) continue;
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function sectionUiKey(section: SectionKey): string {
|
||||
return section === "export" ? "exportJobs" : section;
|
||||
}
|
||||
|
||||
async function visitSectionFromHub(page: Page, section: SectionKey): Promise<boolean> {
|
||||
const response = await page.goto(privacyPath, { waitUntil: "domcontentloaded" });
|
||||
expect(response?.ok(), `Privacy hub returned ${response?.status() ?? "no response"}`).toBe(true);
|
||||
const openButton = page.locator(`[data-ui-id="ui.settings.privacy.sections.${section}.open"]`);
|
||||
if ((await openButton.count()) === 0) return false;
|
||||
await Promise.all([page.waitForURL((url) => url.pathname === SECTION_PATHS[section]), openButton.click()]);
|
||||
const pageUiId = SECTION_PAGES[section];
|
||||
const emptyUiId = pageUiId.replace(/\.page$/u, ".empty");
|
||||
await expect(page.locator(`[data-ui-id="${pageUiId}"], [data-ui-id="${emptyUiId}"]`).first()).toBeVisible();
|
||||
return true;
|
||||
}
|
||||
|
||||
function requireTenantLoginInputs(reason: string): void {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_DASHBOARD_PATH"], reason);
|
||||
}
|
||||
|
||||
function tenantPath(path: string): string {
|
||||
const normalizedDashboard = dashboardPath.startsWith("/") ? dashboardPath : `/${dashboardPath}`;
|
||||
const marker = "/dashboard";
|
||||
const tenantBase = normalizedDashboard.endsWith(marker) ? normalizedDashboard.slice(0, -marker.length) : "/app";
|
||||
return `${tenantBase}/${path}`;
|
||||
}
|
||||
@@ -96,5 +96,5 @@ test.describe("privacy self-service mobile a11y", () => {
|
||||
function derivePrivacyPath(path: string | undefined): string | undefined {
|
||||
if (!path) return undefined;
|
||||
const normalized = path.startsWith("/") ? path : `/${path}`;
|
||||
return normalized.endsWith("/dashboard") ? normalized.replace(/\/dashboard$/u, "/settings/privacy") : undefined;
|
||||
return normalized.endsWith("/dashboard") ? normalized.replace(/\/dashboard$/u, "/settings/profile/data") : undefined;
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH;
|
||||
const profilePath = process.env.E2E_TENANT_SETTINGS_PROFILE_PATH ?? (dashboardPath ? tenantSettingsProfilePath(dashboardPath) : undefined);
|
||||
const securityPath = profilePath ? `${profilePath}/security` : undefined;
|
||||
|
||||
test.describe("profile security mobile a11y", () => {
|
||||
test.use({ viewport: narrowMobileViewport, isMobile: true, hasTouch: true });
|
||||
@@ -22,7 +23,7 @@ test.describe("profile security mobile a11y", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("renders security, MFA, session, and danger controls without mobile overflow or critical a11y violations", async ({ page }) => {
|
||||
test("renders profile security dialogs and the dedicated session page on mobile", async ({ page }) => {
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(profilePath!, { waitUntil: "domcontentloaded" });
|
||||
@@ -31,13 +32,20 @@ test.describe("profile security mobile a11y", () => {
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(profilePath!)}(?:[?#].*)?$`, "u"));
|
||||
await expect(page.locator('[data-ui-id="ui.settings.profile.page"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.profile.form"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.profile.mfa.panel"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.profile.mfa.status"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.profile.mfa.toggle.form"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.profile.password.form"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.profile.session.panel"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.profile.danger.delete"]').first()).toBeVisible();
|
||||
const passwordOpen = page.locator('[data-ui-id="ui.settings.profile.password.open"]').first();
|
||||
const mfaManage = page.locator('[data-ui-id="ui.settings.profile.mfa.manage"]').first();
|
||||
await expect(passwordOpen).toBeVisible();
|
||||
await expect(mfaManage).toBeVisible();
|
||||
await passwordOpen.click();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.profile.password.modal"]').first()).toBeVisible();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
await page.locator('[data-ui-id="ui.settings.profile.password.close"]').first().click();
|
||||
|
||||
const securityResponse = await page.goto(securityPath!, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, securityResponse, `Tenant security path ${securityPath}`);
|
||||
await expect(page.locator('[data-ui-id="ui.settings.security.page"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.security.sessions"]').first()).toBeVisible();
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
});
|
||||
@@ -48,7 +56,8 @@ test.describe("profile security mobile a11y", () => {
|
||||
const response = await page.goto(profilePath!, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, `Tenant profile path ${profilePath}`);
|
||||
|
||||
const form = page.locator('[data-ui-id="ui.settings.profile.password.form"]').first();
|
||||
await page.locator('[data-ui-id="ui.settings.profile.password.open"]').first().click();
|
||||
const form = page.locator('[data-ui-id="ui.settings.profile.password.modal"] form').first();
|
||||
await expect(form).toBeVisible();
|
||||
await form.locator('[data-ui-id="ui.settings.profile.password.current"]').fill("current-password-for-contract");
|
||||
await form.locator('[data-ui-id="ui.settings.profile.password.new"]').fill("NewPassword123!");
|
||||
@@ -71,18 +80,19 @@ test.describe("profile security mobile a11y", () => {
|
||||
const response = await page.goto(profilePath!, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, `Tenant profile path ${profilePath}`);
|
||||
|
||||
const form = page.locator('[data-ui-id="ui.settings.profile.mfa.toggle.form"]').first();
|
||||
if ((await form.count()) === 0) {
|
||||
skipOrFailWhenE2eFixtureMissing("Profile MFA toggle form is not visible for this fixture");
|
||||
await page.locator('[data-ui-id="ui.settings.profile.mfa.manage"]').first().click();
|
||||
const form = page.locator('[data-ui-id="ui.settings.profile.mfa.gate"] form').first();
|
||||
if ((await form.count()) === 0 || !(await form.isVisible())) {
|
||||
skipOrFailWhenE2eFixtureMissing("Profile MFA password gate is not visible for this fixture");
|
||||
}
|
||||
await expect(form).toBeVisible();
|
||||
await form.locator('[data-ui-id="ui.settings.profile.mfa.passwordCurrent"]').fill("current-password-for-contract");
|
||||
await form.locator('[data-ui-id="ui.settings.profile.mfa.gatePassword"]').fill("current-password-for-contract");
|
||||
|
||||
const submitted = await interceptCurrentRoutePost(page, { status: 204 });
|
||||
await form.locator('[data-ui-id="ui.settings.profile.mfa.toggle.submit"]').click();
|
||||
await form.locator('[data-ui-id="ui.settings.profile.mfa.gateSubmit"]').click();
|
||||
|
||||
await expect.poll(() => submitted.value).not.toBeNull();
|
||||
expect(postDataIncludesField(submitted.value, "action", /^(startTotpEnrollment|disableTotpEnrollment)$/u)).toBe(true);
|
||||
expect(postDataIncludesField(submitted.value, "action", /^startTotpEnrollment$/u)).toBe(true);
|
||||
expect(postDataIncludesField(submitted.value, "csrf", /.+/u)).toBe(true);
|
||||
expect(postDataIncludesField(submitted.value, "passwordCurrent", /^current-password-for-contract$/u)).toBe(true);
|
||||
});
|
||||
|
||||