Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -1,9 +1,28 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { expect, test, type Page } from "./utils/test";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { expectAllPasswordRequirementsMet, expectPasswordRequirementsVisible, expectSomePasswordRequirementsMissing } from "./utils/auth";
|
||||
import { expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
|
||||
import { skipOrFailWhenE2eFixtureMissing } from "./utils/readiness";
|
||||
|
||||
async function openRegistrationPlanStep(page: Page): Promise<void> {
|
||||
const planStep = page.locator('[data-ui-id="ui.auth.register.planStep"]');
|
||||
if (await planStep.isVisible()) return;
|
||||
|
||||
const email = page.locator('[data-ui-id="ui.auth.register.email"]').first();
|
||||
if ((await email.inputValue()) === "") await email.fill(`registration-contract-${Date.now()}@example.test`);
|
||||
const password = page.locator('[data-ui-id="ui.auth.register.password"]').first();
|
||||
if ((await password.count()) > 0 && (await password.isVisible()) && (await password.inputValue()) === "") await password.fill("LongEnough1!");
|
||||
const firstName = page.locator('[data-ui-id="ui.auth.register.firstName"]').first();
|
||||
const lastName = page.locator('[data-ui-id="ui.auth.register.lastName"]').first();
|
||||
const company = page.locator('[data-ui-id="ui.auth.register.company"]').first();
|
||||
if ((await firstName.count()) > 0 && (await firstName.inputValue()) === "") await firstName.fill("E2E");
|
||||
if ((await lastName.count()) > 0 && (await lastName.inputValue()) === "") await lastName.fill("Registration");
|
||||
if ((await company.count()) > 0 && (await company.inputValue()) === "") await company.fill("E2E Registration");
|
||||
|
||||
await page.locator('[data-ui-id="ui.auth.register.toPlanStep"]').click();
|
||||
await expect(planStep).toBeVisible();
|
||||
}
|
||||
|
||||
test.describe("register page a11y", () => {
|
||||
test("/register has no critical or serious axe violations", async ({ page }) => {
|
||||
await page.goto("/register", { waitUntil: "domcontentloaded" });
|
||||
@@ -40,6 +59,26 @@ test.describe("register page a11y", () => {
|
||||
await expectAllPasswordRequirementsMet(requirements);
|
||||
});
|
||||
|
||||
test("/register shows the canonical paid plans and honors a deep-linked choice", async ({ page }) => {
|
||||
await page.goto("/register?plan=business", { waitUntil: "domcontentloaded" });
|
||||
|
||||
if (/\/login(?:[?#].*)?$/u.test(page.url())) {
|
||||
skipOrFailWhenE2eFixtureMissing("Registration redirects to login in this environment");
|
||||
}
|
||||
|
||||
await openRegistrationPlanStep(page);
|
||||
const planSelection = page.locator('[data-ui-id="ui.auth.register.planSelection"]');
|
||||
await expect(planSelection).toBeVisible();
|
||||
await expect(planSelection.getByText("Core", { exact: true })).toBeVisible();
|
||||
await expect(planSelection.getByText("Swarm", { exact: true })).toBeVisible();
|
||||
await expect(planSelection.getByText("Colony", { exact: true })).toBeVisible();
|
||||
await expect(planSelection.getByRole("radio")).toHaveCount(3);
|
||||
|
||||
const colony = planSelection.getByRole("radio", { name: /^Colony/iu });
|
||||
await expect(colony).toBeChecked();
|
||||
await expect(page.locator('input[name="selectedSubscriptionPriceId"]')).toHaveValue((await colony.getAttribute("value")) ?? "");
|
||||
});
|
||||
|
||||
test("/register submit contract posts expected fields without creating an account", async ({ page }) => {
|
||||
const redirectTo = "/app/dashboard";
|
||||
await page.goto(`/register?redirect=${encodeURIComponent(redirectTo)}`, { waitUntil: "domcontentloaded" });
|
||||
@@ -72,6 +111,9 @@ test.describe("register page a11y", () => {
|
||||
const hasLastNameInput = (await lastNameInput.count()) > 0;
|
||||
if (hasFirstNameInput) await firstNameInput.fill(firstName);
|
||||
if (hasLastNameInput) await lastNameInput.fill(lastName);
|
||||
await openRegistrationPlanStep(page);
|
||||
await page.locator('[data-ui-id="ui.auth.register.consentTerms"]').click();
|
||||
await page.locator('[data-ui-id="ui.auth.register.consentPrivacy"]').click();
|
||||
|
||||
const currentPathname = new URL(page.url()).pathname;
|
||||
let resolveSubmitted!: (formData: URLSearchParams) => void;
|
||||
@@ -98,6 +140,7 @@ test.describe("register page a11y", () => {
|
||||
});
|
||||
});
|
||||
|
||||
const selectedSubscriptionPriceId = await form.locator('input[name="selectedSubscriptionPriceId"]').inputValue();
|
||||
await form.locator('button[type="submit"]').first().click();
|
||||
const formData = await submitted;
|
||||
|
||||
@@ -105,6 +148,7 @@ test.describe("register page a11y", () => {
|
||||
expect(formData.get("email")).toBe(email);
|
||||
expect(formData.get("password")).toBe("LongEnough1!");
|
||||
expect(formData.get("redirectTo")).toBe(redirectTo);
|
||||
expect(formData.get("selectedSubscriptionPriceId")).toBe(selectedSubscriptionPriceId);
|
||||
if (hasCompanyInput) expect(formData.get("company")).toBe(company);
|
||||
if (hasFirstNameInput) expect(formData.get("first-name")).toBe(firstName);
|
||||
if (hasLastNameInput) expect(formData.get("last-name")).toBe(lastName);
|
||||
@@ -134,21 +178,22 @@ test.describe("register validation mobile a11y", () => {
|
||||
const lastNameInput = page.locator('input[name="last-name"]').first();
|
||||
if ((await lastNameInput.count()) > 0) await lastNameInput.fill("Validation");
|
||||
|
||||
await emailInput.fill("not-an-email");
|
||||
await passwordInput.fill("short");
|
||||
await emailInput.fill("registration-validation@example.test");
|
||||
await passwordInput.fill("LongEnough1!");
|
||||
await openRegistrationPlanStep(page);
|
||||
const officeSeats = page.locator('[data-ui-id="ui.auth.register.officeSeats"]');
|
||||
await officeSeats.fill("0");
|
||||
await page.locator('[data-ui-id="ui.auth.register.consentTerms"]').click();
|
||||
await page.locator('[data-ui-id="ui.auth.register.consentPrivacy"]').click();
|
||||
await page.locator('button[type="submit"]').first().click();
|
||||
|
||||
const formError = page.locator('#form-error-message [role="alert"]').first();
|
||||
const nativeEmailInvalid = await emailInput.evaluate((input) => (input as HTMLInputElement).validationMessage.length > 0);
|
||||
if ((await formError.count()) > 0 && (await formError.isVisible())) {
|
||||
await expect(formError).toBeVisible();
|
||||
} else {
|
||||
expect(nativeEmailInvalid).toBe(true);
|
||||
}
|
||||
const formError = page.getByRole("alert").first();
|
||||
await expect(formError).toBeVisible();
|
||||
await expect(officeSeats).toBeEnabled();
|
||||
|
||||
const requirements = page.locator('[aria-live="polite"]').first();
|
||||
if ((await requirements.count()) > 0) {
|
||||
await expectSomePasswordRequirementsMissing(requirements);
|
||||
await expectAllPasswordRequirementsMet(requirements);
|
||||
}
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
Reference in new issue
Block a user