Skip to content

Commit fdbf95c

Browse files
Merge branch 'ag-ui-protocol:main' into kotlinsdk
2 parents eb8f47d + d8830b4 commit fdbf95c

File tree

80 files changed

+2523
-2669
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2523
-2669
lines changed

typescript-sdk/apps/dojo/e2e/pages/mastraPages/AgenticChatPage.ts renamed to typescript-sdk/apps/dojo/e2e/featurePages/AgenticChatPage.ts

Lines changed: 68 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export class AgenticChatPage {
66
readonly agentGreeting: Locator;
77
readonly chatInput: Locator;
88
readonly sendButton: Locator;
9+
readonly chatBackground: Locator;
910
readonly agentMessage: Locator;
1011
readonly userMessage: Locator;
1112

@@ -25,6 +26,10 @@ export class AgenticChatPage {
2526
.locator('[data-test-id="copilot-chat-ready"]')
2627
.or(page.getByRole("button", { name: /send/i }))
2728
.or(page.locator('button[type="submit"]'));
29+
this.chatBackground = page
30+
.locator('div[style*="background"]')
31+
.or(page.locator('.flex.justify-center.items-center.h-full.w-full'))
32+
.or(page.locator('body'));
2833
this.agentMessage = page
2934
.locator(".copilotKitAssistantMessage");
3035
this.userMessage = page
@@ -49,6 +54,59 @@ export class AgenticChatPage {
4954
}
5055
}
5156

57+
async getBackground(
58+
property: "backgroundColor" | "backgroundImage" = "backgroundColor"
59+
): Promise<string> {
60+
// Wait a bit for background to apply
61+
await this.page.waitForTimeout(500);
62+
63+
// Try multiple selectors for the background element
64+
const selectors = [
65+
'div[style*="background"]',
66+
'div[style*="background-color"]',
67+
'.flex.justify-center.items-center.h-full.w-full',
68+
'div.flex.justify-center.items-center.h-full.w-full',
69+
'[class*="bg-"]',
70+
'div[class*="background"]'
71+
];
72+
73+
for (const selector of selectors) {
74+
try {
75+
const element = this.page.locator(selector).first();
76+
if (await element.isVisible({ timeout: 1000 })) {
77+
const value = await element.evaluate(
78+
(el, prop) => {
79+
// Check inline style first
80+
if (el.style.background) return el.style.background;
81+
if (el.style.backgroundColor) return el.style.backgroundColor;
82+
// Then computed style
83+
return getComputedStyle(el)[prop as any];
84+
},
85+
property
86+
);
87+
if (value && value !== "rgba(0, 0, 0, 0)" && value !== "transparent") {
88+
console.log(`[${selector}] ${property}: ${value}`);
89+
return value;
90+
}
91+
}
92+
} catch (e) {
93+
continue;
94+
}
95+
}
96+
97+
// Fallback to original element
98+
const value = await this.chatBackground.first().evaluate(
99+
(el, prop) => getComputedStyle(el)[prop as any],
100+
property
101+
);
102+
console.log(`[Fallback] ${property}: ${value}`);
103+
return value;
104+
}
105+
106+
async getGradientButtonByName(name: string | RegExp) {
107+
return this.page.getByRole("button", { name });
108+
}
109+
52110
async assertUserMessageVisible(text: string | RegExp) {
53111
await expect(this.userMessage.getByText(text)).toBeVisible();
54112
}
@@ -60,20 +118,25 @@ export class AgenticChatPage {
60118
await expect(agentMessage.last()).toBeVisible({ timeout: 10000 });
61119
}
62120

121+
async assertAgentReplyContains(expectedText: string) {
122+
const agentMessage = this.page.locator(".copilotKitAssistantMessage").last();
123+
await expect(agentMessage).toContainText(expectedText, { timeout: 10000 });
124+
}
125+
63126
async assertWeatherResponseStructure() {
64127
const agentMessage = this.page.locator(".copilotKitAssistantMessage").last();
65-
128+
66129
// Check for main weather response structure
67130
await expect(agentMessage).toContainText("The current weather in Islamabad is as follows:", { timeout: 10000 });
68-
131+
69132
// Check for temperature information
70-
await expect(agentMessage).toContainText("Temperature:", { timeout: 5000 });
133+
await expect(agentMessage).toContainText("Temperature:", { timeout: 5000 });
71134
// Check for humidity
72135
await expect(agentMessage).toContainText("Humidity:", { timeout: 5000 });
73-
136+
74137
// Check for wind speed
75138
await expect(agentMessage).toContainText("Wind Speed:", { timeout: 5000 });
76139
// Check for conditions
77140
await expect(agentMessage).toContainText("Conditions:", { timeout: 5000 });
78141
}
79-
}
142+
}

typescript-sdk/apps/dojo/e2e/pages/llamaIndexPages/SharedStatePage.ts renamed to typescript-sdk/apps/dojo/e2e/featurePages/SharedStatePage.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export class SharedStatePage {
2323
this.addIngredient = page.getByRole('button', { name: '+ Add Ingredient' });
2424
this.agentMessage = page.locator('.copilotKitAssistantMessage');
2525
this.userMessage = page.locator('.copilotKitUserMessage');
26+
this.ingredientCards = page.locator('.ingredient-card');
2627
}
2728

2829
async openChat() {
@@ -46,24 +47,26 @@ export class SharedStatePage {
4647
]);
4748
}
4849

49-
async getIngredientCard(name) {
50-
return this.page.locator(`.ingredient-card:has(input.ingredient-name-input[value="${name}"])`);
50+
async awaitIngredientCard(name: string) {
51+
const selector = `.ingredient-card:has(input.ingredient-name-input[value="${name}"])`;
52+
const cardLocator = this.page.locator(selector);
53+
await expect(cardLocator).toBeVisible();
5154
}
5255

53-
async addNewIngredient(placeholderText) {
56+
async addNewIngredient(placeholderText: string) {
5457
this.addIngredient.click();
5558
this.page.locator(`input[placeholder="${placeholderText}"]`);
5659
}
5760

58-
async getInstructionItems(containerLocator) {
61+
async getInstructionItems(containerLocator: Locator ) {
5962
const count = await containerLocator.locator('.instruction-item').count();
6063
if (count <= 0) {
6164
throw new Error('No instruction items found in the container.');
6265
}
6366
console.log(`✅ Found ${count} instruction items.`);
6467
return count;
6568
}
66-
69+
6770
async assertAgentReplyVisible(expectedText: RegExp) {
6871
await expect(this.agentMessage.getByText(expectedText)).toBeVisible();
6972
}
File renamed without changes.

typescript-sdk/apps/dojo/e2e/pages/agnoPages/AgenticChatPage.ts

Lines changed: 0 additions & 67 deletions
This file was deleted.

typescript-sdk/apps/dojo/e2e/pages/crewAIPages/AgenticChatPage.ts

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)