Stabilize multi-tenant integration org reloads

This commit is contained in:
rcourtman 2026-07-04 12:38:15 +01:00
parent 27cd862df3
commit 1a160eca44
2 changed files with 6 additions and 5 deletions

View file

@ -7,6 +7,7 @@ import {
E2E_CREDENTIALS,
isMultiTenantEnabled,
switchOrg,
waitForAppShell,
} from './helpers';
type Organization = {
@ -84,8 +85,8 @@ test.describe('Multi-tenant E2E flows', () => {
const created = await createOrg(page, `E2E Visibility Org ${Date.now()}`);
tempOrgID = created.id;
await page.reload();
await page.waitForLoadState('domcontentloaded');
await page.reload({ waitUntil: 'domcontentloaded' });
await waitForAppShell(page);
await expect(page.getByLabel('Organization')).toBeVisible();
} else {

View file

@ -121,7 +121,7 @@ const persistRuntimePrimaryAPIToken = (token: string) => {
}
};
async function waitForAppShell(page: Page, timeoutMs = 20_000) {
export async function waitForAppShell(page: Page, timeoutMs = 20_000) {
await page.waitForLoadState("domcontentloaded");
// The raw HTML shell contains a noscript fallback. Wait for the SPA to
@ -1311,8 +1311,8 @@ export async function switchOrg(page: Page, orgId: string): Promise<void> {
window.localStorage.setItem("pulse_org_id", id);
document.cookie = `pulse_org_id=${encodeURIComponent(id)}; Path=/; SameSite=Lax`;
}, orgId);
await page.reload();
await page.waitForLoadState("networkidle");
await page.reload({ waitUntil: "domcontentloaded" });
await waitForAppShell(page);
}
/**