Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test: stabilize web onboarding and connections flows

Steven Enamakel257a63ac3618
diff --git a/app/test/playwright/specs/connections-tab-deeplinks.spec.ts b/app/test/playwright/specs/connections-tab-deeplinks.spec.ts
index 4e905bceb3..5ba30c5e65 100644
--- a/app/test/playwright/specs/connections-tab-deeplinks.spec.ts
+++ b/app/test/playwright/specs/connections-tab-deeplinks.spec.ts
@@ -1,9 +1,7 @@
import { expect, test } from '@playwright/test';
import {
- bootRuntimeReadyExistingSessionPage,
bootRuntimeReadyGuestPage,
- callCoreRpc,
dismissWalkthroughIfPresent,
signInViaBypassUser,
waitForAppReady,
@@ -53,18 +51,13 @@ async function openRoute(
route: string,
settlesOn?: string
) {
- const snapshot = await callCoreRpc<{
- result?: { currentUser?: { _id?: string | null } | null };
- currentUser?: { _id?: string | null } | null;
- }>('openhuman.app_state_snapshot', {});
- const currentUser = (snapshot.result ?? snapshot).currentUser;
-
- if (currentUser?._id) {
- await bootRuntimeReadyExistingSessionPage(page);
- } else {
- await bootRuntimeReadyGuestPage(page);
- await signInViaBypassUser(page, userId);
- }
+ // This spec follows another Connections test in the serial web lane. Reusing
+ // its authenticated core session made the first attempt depend on whether
+ // the previous browser had finished propagating its session snapshot. Start
+ // from the same deterministic guest-to-user transition used by the alias
+ // coverage instead.
+ await bootRuntimeReadyGuestPage(page);
+ await signInViaBypassUser(page, userId);
await page.evaluate(
({ target }) => {
try {
diff --git a/app/test/playwright/specs/logout-relogin-onboarding.spec.ts b/app/test/playwright/specs/logout-relogin-onboarding.spec.ts
index 50d3feb43f..ebcb825f6d 100644
--- a/app/test/playwright/specs/logout-relogin-onboarding.spec.ts
+++ b/app/test/playwright/specs/logout-relogin-onboarding.spec.ts
@@ -63,6 +63,22 @@ async function completeCloudOnboarding(page: Page): Promise<void> {
async function logoutViaSettings(page: Page): Promise<void> {
await callCoreRpc('openhuman.auth_clear_session', {});
await page.goto('/#/');
+ // A core RPC response only confirms that persistence was updated. Wait for
+ // the browser's CoreStateProvider to observe that signed-out snapshot before
+ // asserting the public route, otherwise a preceding authenticated snapshot
+ // can win the reload race in a busy serial CI lane.
+ await expect
+ .poll(() =>
+ page.evaluate(() => {
+ const state = (
+ window as typeof window & {
+ __OPENHUMAN_CORE_STATE__?: () => { snapshot?: { sessionToken?: string | null } };
+ }
+ ).__OPENHUMAN_CORE_STATE__?.();
+ return Boolean(state?.snapshot?.sessionToken);
+ })
+ )
+ .toBe(false);
await expect(page.getByText('Welcome to OpenHuman')).toBeVisible();
}