Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions apps/dojo/e2e/featurePages/ToolBaseGenUIPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
await mostRecentCard
.locator('[data-testid="haiku-japanese-line"]')
.first()
.waitFor({ state: "visible", timeout: 20000 });

Check failure on line 44 in apps/dojo/e2e/featurePages/ToolBaseGenUIPage.ts

View workflow job for this annotation

GitHub Actions / langgraph-python

[chromium] › tests/langgraphPythonTests/toolBasedGenUIPage.spec.ts:20:5 › [LangGraph] Haiku generation and UI consistency for two different prompts

1) [chromium] › tests/langgraphPythonTests/toolBasedGenUIPage.spec.ts:20:5 › [LangGraph] Haiku generation and UI consistency for two different prompts TimeoutError: locator.waitFor: Timeout 20000ms exceeded. Call log: - waiting for locator('[data-testid="haiku-card"]').last().locator('[data-testid="haiku-japanese-line"]').first() to be visible at ../featurePages/ToolBaseGenUIPage.ts:44 42 | .locator('[data-testid="haiku-japanese-line"]') 43 | .first() > 44 | .waitFor({ state: "visible", timeout: 20000 }); | ^ 45 | } 46 | 47 | async extractChatHaikuContent(page: Page): Promise<string> { at ToolBaseGenUIPage.checkGeneratedHaiku (/home/runner/work/ag-ui/ag-ui/apps/dojo/e2e/featurePages/ToolBaseGenUIPage.ts:44:8) at /home/runner/work/ag-ui/ag-ui/apps/dojo/e2e/tests/langgraphPythonTests/toolBasedGenUIPage.spec.ts:31:3

Check failure on line 44 in apps/dojo/e2e/featurePages/ToolBaseGenUIPage.ts

View workflow job for this annotation

GitHub Actions / langgraph-typescript

[chromium] › tests/langgraphTypescriptTests/toolBasedGenUIPage.spec.ts:20:5 › [LangGraph] Haiku generation and UI consistency for two different prompts

1) [chromium] › tests/langgraphTypescriptTests/toolBasedGenUIPage.spec.ts:20:5 › [LangGraph] Haiku generation and UI consistency for two different prompts TimeoutError: locator.waitFor: Timeout 20000ms exceeded. Call log: - waiting for locator('[data-testid="haiku-card"]').last().locator('[data-testid="haiku-japanese-line"]').first() to be visible at ../featurePages/ToolBaseGenUIPage.ts:44 42 | .locator('[data-testid="haiku-japanese-line"]') 43 | .first() > 44 | .waitFor({ state: "visible", timeout: 20000 }); | ^ 45 | } 46 | 47 | async extractChatHaikuContent(page: Page): Promise<string> { at ToolBaseGenUIPage.checkGeneratedHaiku (/home/runner/work/ag-ui/ag-ui/apps/dojo/e2e/featurePages/ToolBaseGenUIPage.ts:44:8) at /home/runner/work/ag-ui/ag-ui/apps/dojo/e2e/tests/langgraphTypescriptTests/toolBasedGenUIPage.spec.ts:31:3
}

async extractChatHaikuContent(page: Page): Promise<string> {
Expand Down Expand Up @@ -125,19 +125,19 @@
return mainHaikuContent;
}

async checkHaikuDisplay(page: Page): Promise<void> {
const chatHaikuContent = await this.extractChatHaikuContent(page);

await page.waitForTimeout(3000);

// Check that the haiku exists somewhere in the carousel
private async carouselIncludesHaiku(
page: Page,
chatHaikuContent: string,
): Promise<boolean> {
const carousel = page.locator('[data-testid="haiku-carousel"]');
await carousel.waitFor({ state: "visible", timeout: 10000 });

if (!(await carousel.isVisible())) {
return false;
}

const allCarouselCards = carousel.locator('[data-testid="haiku-card"]');
const cardCount = await allCarouselCards.count();

let foundMatch = false;
for (let i = 0; i < cardCount; i++) {
const card = allCarouselCards.nth(i);
const lines = card.locator('[data-testid="haiku-japanese-line"]');
Expand All @@ -151,11 +151,21 @@

const cardContent = cardLines.join("").replace(/\s/g, "");
if (cardContent === chatHaikuContent) {
foundMatch = true;
break;
return true;
}
}

expect(foundMatch).toBe(true);
return false;
}

async checkHaikuDisplay(page: Page): Promise<void> {
const chatHaikuContent = await this.extractChatHaikuContent(page);

await expect
.poll(
async () => this.carouselIncludesHaiku(page, chatHaikuContent),
{ timeout: 20000, intervals: [500, 1000, 2000] },
)
.toBe(true);
}
}
Loading