mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-19 10:33:29 +00:00
Stabilize multi-tenant integration org reloads
This commit is contained in:
parent
27cd862df3
commit
1a160eca44
2 changed files with 6 additions and 5 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue