From 898fe13477a3416a5a6ac9bad2f46705b383bbd6 Mon Sep 17 00:00:00 2001 From: YellowSnnowmann <167776381+YellowSnnowmann@users.noreply.github.com> Date: Fri, 3 Apr 2026 16:07:25 +0530 Subject: [PATCH] Feat: update complete onboarding helper (#299) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(e2e): make completeOnboardingIfVisible resilient by delegating to walkOnboarding The previous implementation did a single onboardingOverlayLikelyVisible() check before calling walkOnboarding. This created a timing race: if onboarding had not yet rendered at call time the helper returned early, leaving the overlay blocking subsequent steps. walkOnboarding already handles both cases correctly — it polls up to 8 × 400 ms for the overlay before giving up, then no-ops gracefully if not visible. completeOnboardingIfVisible now delegates to it unconditionally, eliminating the race without changing observable behaviour. Also updates the section comment to accurately describe the current 5-step onboarding sequence (Welcome → Local AI → Screen & Accessibility → Tools → Skills) following the removal of MnemonicStep in #279. Closes part of #201 Co-Authored-By: Claude Sonnet 4.6 * fix(e2e): use completeOnboardingIfVisible in conversations spec conversations-web-channel-flow.spec.ts was the only spec that called walkOnboarding directly instead of the shared completeOnboardingIfVisible helper. Align it with all other specs so the single resilient code path is used consistently. Closes #201 Co-Authored-By: Claude Sonnet 4.6 * fix(e2e): add clang and cmake to Dockerfile dependencies Updated the e2e Dockerfile to include clang and cmake as additional dependencies, enhancing the build environment for end-to-end testing. --------- Co-authored-by: Claude Sonnet 4.6 --- app/test/e2e/helpers/shared-flows.ts | 13 ++++++++----- .../specs/conversations-web-channel-flow.spec.ts | 8 ++++++-- e2e/Dockerfile | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/test/e2e/helpers/shared-flows.ts b/app/test/e2e/helpers/shared-flows.ts index 16d0348be..2b54b840b 100644 --- a/app/test/e2e/helpers/shared-flows.ts +++ b/app/test/e2e/helpers/shared-flows.ts @@ -248,7 +248,8 @@ export async function navigateToConversations() { } // --------------------------------------------------------------------------- -// Onboarding walkthrough (Onboarding.tsx — 5 steps, indices 0–4) +// Onboarding walkthrough +// Current flow: Welcome → Local AI → Screen & Accessibility → Tools → Skills (5 steps, indices 0–4). // --------------------------------------------------------------------------- /** Labels used to detect the onboarding overlay (same strings as Onboarding copy). */ @@ -319,12 +320,14 @@ export async function walkOnboarding(logPrefix = '[E2E]') { } /** - * If onboarding is showing, walk through it. Safe no-op when already on Home / no overlay. + * Walk through onboarding if it is visible, or no-op if already on Home. + * + * Delegates to walkOnboarding, which polls up to 8 × 400 ms for the overlay + * to appear before giving up — safe to call unconditionally after auth so + * timing races do not cause the helper to skip onboarding prematurely. */ export async function completeOnboardingIfVisible(logPrefix = '[E2E]') { - if (await onboardingOverlayLikelyVisible()) { - await walkOnboarding(logPrefix); - } + await walkOnboarding(logPrefix); } // --------------------------------------------------------------------------- diff --git a/app/test/e2e/specs/conversations-web-channel-flow.spec.ts b/app/test/e2e/specs/conversations-web-channel-flow.spec.ts index df336fa46..2768501a9 100644 --- a/app/test/e2e/specs/conversations-web-channel-flow.spec.ts +++ b/app/test/e2e/specs/conversations-web-channel-flow.spec.ts @@ -9,7 +9,11 @@ import { waitForWebView, waitForWindowVisible, } from '../helpers/element-helpers'; -import { navigateToConversations, navigateViaHash, walkOnboarding } from '../helpers/shared-flows'; +import { + completeOnboardingIfVisible, + navigateToConversations, + navigateViaHash, +} from '../helpers/shared-flows'; import { clearRequestLog, getRequestLog, startMockServer, stopMockServer } from '../mock-server'; function stepLog(message: string, context?: unknown) { @@ -70,7 +74,7 @@ suiteRunner('Conversations web channel flow', () => { } stepLog('complete onboarding'); - await walkOnboarding('[ConversationsE2E]'); + await completeOnboardingIfVisible('[ConversationsE2E]'); stepLog('open conversations'); // Navigate via hash — "Message OpenHuman" button may not reliably open conversations diff --git a/e2e/Dockerfile b/e2e/Dockerfile index d5128775c..74a0eb346 100644 --- a/e2e/Dockerfile +++ b/e2e/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get update && apt-get install -y \ libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev \ librsvg2-dev patchelf libssl-dev \ xvfb at-spi2-core dbus-x11 webkit2gtk-driver \ + clang libclang-dev cmake \ git ca-certificates \ && rm -rf /var/lib/apt/lists/*