Skip to content

Commit 4dbd153

Browse files
committed
make onboarding errors pop up on e2e tests
1 parent 5d35c79 commit 4dbd153

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

frontend/app/onboarding/_components/onboarding-card.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,10 @@ const OnboardingCard = ({
510510
>
511511
<div className="pb-6 flex items-center gap-4">
512512
<X className="w-4 h-4 text-destructive shrink-0" />
513-
<span className="text-mmd text-muted-foreground">
513+
<span
514+
data-testid="onboarding-error"
515+
className="text-mmd text-muted-foreground"
516+
>
514517
{error}
515518
</span>
516519
</div>

frontend/tests/utils/onboarding.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,18 @@ export async function completeOnboarding(
141141
await page.getByTestId("onboarding-complete-button").click();
142142

143143
await expect(page.getByText("Thinking")).toBeVisible();
144-
await expect(page.getByText("Done")).toBeVisible({
144+
145+
const doneLocator = page.getByText("Done");
146+
const errorLocator = page.getByTestId("onboarding-error");
147+
148+
await expect(doneLocator.or(errorLocator)).toBeVisible({
145149
timeout: isEmbedding ? 120000 : 60000,
146150
});
151+
152+
if (await errorLocator.isVisible()) {
153+
const errorText = await errorLocator.innerText();
154+
throw new Error(`Onboarding step failed: ${errorText}`);
155+
}
147156
};
148157

149158
// 1. LLM configuration

0 commit comments

Comments
 (0)