Authenticate the self-hosted billing and upgrade-return flows

Specs 54 and 55 never authenticated; they only ever passed against an
already-authenticated dev session, so on the e2e stack every test landed
on the login screen before reaching the billing panel. Entry helpers now
establish a session first. Both specs still carry assertions against the
pre-redesign billing copy (upgrade arrival, capacity review wording);
that rework is tracked separately - this lands the auth prerequisite that
any version of those assertions needs.
This commit is contained in:
rcourtman 2026-07-08 15:08:56 +01:00
parent 1c38d79937
commit c9c48495ba
2 changed files with 11 additions and 0 deletions

View file

@ -1,5 +1,6 @@
import { test, expect, type Page } from "@playwright/test";
import { preferredPlaywrightRouteBaseURL } from "./runtime-defaults";
import { ensureAuthenticated } from "./helpers";
const DEV_SERVER_URL = preferredPlaywrightRouteBaseURL();
@ -246,6 +247,7 @@ async function configureMonitoredSystemBillingFixtures(
}
async function openSelfHostedGeneralSettings(page: Page) {
await ensureAuthenticated(page);
await page.goto(`${DEV_SERVER_URL}/settings/system-general`, {
waitUntil: "domcontentloaded",
});
@ -272,6 +274,7 @@ test.describe("Monitored-system billing focus", () => {
page.getByRole("link", { name: "Upgrade to add more" }),
).toHaveCount(0);
await ensureAuthenticated(page);
await page.goto(`${DEV_SERVER_URL}/settings/system/billing/plan`, {
waitUntil: "domcontentloaded",
});

View file

@ -6,6 +6,7 @@ import {
type Route,
} from "@playwright/test";
import { preferredPlaywrightRouteBaseURL } from "./runtime-defaults";
import { ensureAuthenticated } from "./helpers";
const DEV_SERVER_URL = preferredPlaywrightRouteBaseURL();
const PURCHASE_START_PATH = "/auth/license-purchase-start";
@ -451,6 +452,7 @@ async function configureBillingFixtures(
}
async function openMonitoredSystemUpgradeArrival(page: Page) {
await ensureAuthenticated(page);
await page.goto(`${DEV_SERVER_URL}/settings/system/billing/plan?intent=self_hosted_plan`, {
waitUntil: "domcontentloaded",
});
@ -511,6 +513,7 @@ test.describe("Self-hosted upgrade return flow", () => {
.poll(() => purchaseStartURL)
.toBe(`${PURCHASE_START_URL}?feature=self_hosted_plan`);
await ensureAuthenticated(page);
await page.goto(buildPortalHandoffUrl(), { waitUntil: "domcontentloaded" });
await expect(
page.getByRole("heading", { name: "Pulse Account" }),
@ -565,6 +568,7 @@ test.describe("Self-hosted upgrade return flow", () => {
await openMonitoredSystemUpgradeArrival(page);
await page.getByRole("link", { name: "Compare plans" }).click();
await ensureAuthenticated(page);
await page.goto(buildPortalHandoffUrl(), { waitUntil: "domcontentloaded" });
await expect(page).toHaveURL(FINAL_BILLING_URL);
@ -601,6 +605,7 @@ test.describe("Self-hosted upgrade return flow", () => {
const comparePlansLink = page.getByRole("link", { name: "Compare plans" });
await comparePlansLink.click();
await ensureAuthenticated(page);
await page.goto(buildPortalHandoffUrl(), { waitUntil: "domcontentloaded" });
await expect(page).toHaveURL(FINAL_RESTARTABLE_BILLING_URL);
@ -639,6 +644,7 @@ test.describe("Self-hosted upgrade return flow", () => {
await openMonitoredSystemUpgradeArrival(page);
await page.getByRole("link", { name: "Compare plans" }).click();
await ensureAuthenticated(page);
await page.goto(buildPortalHandoffUrl(), { waitUntil: "domcontentloaded" });
await expect(page).toHaveURL(FINAL_BILLING_URL);
@ -685,6 +691,7 @@ test.describe("Self-hosted upgrade return flow", () => {
await openMonitoredSystemUpgradeArrival(page);
await page.getByRole("link", { name: "Compare plans" }).click();
await ensureAuthenticated(page);
await page.goto(buildPortalHandoffUrl(), { waitUntil: "domcontentloaded" });
await expect(page).toHaveURL(EXPIRED_BILLING_URL);
@ -723,6 +730,7 @@ test.describe("Self-hosted upgrade return flow", () => {
await openMonitoredSystemUpgradeArrival(page);
await page.getByRole("link", { name: "Compare plans" }).click();
await ensureAuthenticated(page);
await page.goto(buildPortalHandoffUrl(), { waitUntil: "domcontentloaded" });
await expect(page).toHaveURL(FAILED_BILLING_URL);