From 0b8814e5a9d9eb03276719b2910b9d57698e444a Mon Sep 17 00:00:00 2001 From: ran Date: Wed, 13 Aug 2025 18:03:04 +0200 Subject: [PATCH 01/10] chore: use latest agui fastapi langgraph integration --- .../integrations/langgraph/examples/python/poetry.lock | 8 ++++---- .../integrations/langgraph/examples/python/pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/typescript-sdk/integrations/langgraph/examples/python/poetry.lock b/typescript-sdk/integrations/langgraph/examples/python/poetry.lock index b3c6e426e..478fd5122 100644 --- a/typescript-sdk/integrations/langgraph/examples/python/poetry.lock +++ b/typescript-sdk/integrations/langgraph/examples/python/poetry.lock @@ -2,14 +2,14 @@ [[package]] name = "ag-ui-langgraph" -version = "0.0.5" +version = "0.0.7" description = "Implementation of the AG-UI protocol for LangGraph." optional = false python-versions = "<3.14,>=3.10" groups = ["main"] files = [ - {file = "ag_ui_langgraph-0.0.5-py3-none-any.whl", hash = "sha256:77ef1a3121818a95907f797972acd7290ec730ada57efeee7bdb6bc6ab24baed"}, - {file = "ag_ui_langgraph-0.0.5.tar.gz", hash = "sha256:63bd4934bab95042d9095940321d3ee1930b662141e704617d942006943d2a07"}, + {file = "ag_ui_langgraph-0.0.7-py3-none-any.whl", hash = "sha256:35b43bf74b3dc568943bb0808141ae6e583b3c08596892b21a647072434d2f34"}, + {file = "ag_ui_langgraph-0.0.7.tar.gz", hash = "sha256:5ca32d6f04f40073493227fb272d3493e84cd0e0f5a269d74d0ac1a4234cfe04"}, ] [package.dependencies] @@ -2970,4 +2970,4 @@ cffi = ["cffi (>=1.11)"] [metadata] lock-version = "2.1" python-versions = ">=3.12,<3.14" -content-hash = "d8bfe3601f3fc50ba1f596c05f61c98c24455bb6751c5d491a2b923bbf617a26" +content-hash = "8e613797f8505b4f0067cb5a413b992cd63ce1ccaa4b4bda9b65a019c723d45b" diff --git a/typescript-sdk/integrations/langgraph/examples/python/pyproject.toml b/typescript-sdk/integrations/langgraph/examples/python/pyproject.toml index 36ebdeb6d..e17abfa59 100644 --- a/typescript-sdk/integrations/langgraph/examples/python/pyproject.toml +++ b/typescript-sdk/integrations/langgraph/examples/python/pyproject.toml @@ -21,7 +21,7 @@ langchain-experimental = ">=0.0.11" langchain-google-genai = ">=2.1.9" langchain-openai = ">=0.0.1" langgraph = "^0.6.1" -ag-ui-langgraph = { version = "0.0.5", extras = ["fastapi"] } +ag-ui-langgraph = { version = "0.0.7", extras = ["fastapi"] } python-dotenv = "^1.0.0" fastapi = "^0.115.12" From 38eefb19edceb2bccfa89eecc183bc6c3cdf0503 Mon Sep 17 00:00:00 2001 From: ran Date: Wed, 13 Aug 2025 18:04:33 +0200 Subject: [PATCH 02/10] chore: enable all predictive state updates tests --- .../e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts | 4 ++-- .../langgraphFastAPITests/predictvieStateUpdatePage.spec.ts | 4 ++-- .../tests/langgraphTests/predictvieStateUpdatePage.spec.ts | 4 ++-- .../tests/pydanticAITests/predictvieStateUpdatePage.spec.ts | 4 ++-- .../predictvieStateUpdatePage.spec.ts | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/typescript-sdk/apps/dojo/e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts index e676e5043..8bafd1833 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts @@ -7,7 +7,7 @@ import { import { PredictiveStateUpdatesPage } from "../../pages/crewAIPages/PredictiveStateUpdatesPage"; test.describe("Predictive Status Updates Feature", () => { - test.fixme("[CrewAI] should interact with agent and approve asked changes", async ({ + test("[CrewAI] should interact with agent and approve asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { @@ -44,7 +44,7 @@ test.describe("Predictive Status Updates Feature", () => { }); }); - test.fixme("[CrewAI] should interact with agent and reject asked changes", async ({ + test("[CrewAI] should interact with agent and reject asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { diff --git a/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/predictvieStateUpdatePage.spec.ts index 3ca0f0e37..5c486d7a9 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/predictvieStateUpdatePage.spec.ts @@ -7,7 +7,7 @@ import { import { PredictiveStateUpdatesPage } from "../../pages/langGraphFastAPIPages/PredictiveStateUpdatesPage"; test.describe("Predictive Status Updates Feature", () => { - test.fixme("[LangGraph FastAPI] should interact with agent and approve asked changes", async ({ + test("[LangGraph FastAPI] should interact with agent and approve asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { @@ -50,7 +50,7 @@ test.describe("Predictive Status Updates Feature", () => { }); }); - test.fixme("[LangGraph FastAPI] should interact with agent and reject asked changes", async ({ + test("[LangGraph FastAPI] should interact with agent and reject asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { diff --git a/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/predictvieStateUpdatePage.spec.ts index ac3833ad2..236449552 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/predictvieStateUpdatePage.spec.ts @@ -7,7 +7,7 @@ import { import { PredictiveStateUpdatesPage } from "../../pages/langGraphPages/PredictiveStateUpdatesPage"; test.describe("Predictive Status Updates Feature", () => { - test.fixme("[LangGraph] should interact with agent and approve asked changes", async ({ + test("[LangGraph] should interact with agent and approve asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { @@ -50,7 +50,7 @@ test.describe("Predictive Status Updates Feature", () => { }); }); - test.fixme("[LangGraph] should interact with agent and reject asked changes", async ({ + test("[LangGraph] should interact with agent and reject asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { diff --git a/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts index 0221871aa..72b93dfd0 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts @@ -7,7 +7,7 @@ import { import { PredictiveStateUpdatesPage } from "../../pages/pydanticAIPages/PredictiveStateUpdatesPage"; test.describe("Predictive Status Updates Feature", () => { - test.fixme("[PydanticAI] should interact with agent and approve asked changes", async ({ + test("[PydanticAI] should interact with agent and approve asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { @@ -44,7 +44,7 @@ test.describe("Predictive Status Updates Feature", () => { }); }); - test.fixme("[PydanticAI] should interact with agent and reject asked changes", async ({ + test("[PydanticAI] should interact with agent and reject asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { diff --git a/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/predictvieStateUpdatePage.spec.ts index a5584c22a..6f12b8d26 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/predictvieStateUpdatePage.spec.ts @@ -2,7 +2,7 @@ import { test, expect, waitForAIResponse, retryOnAIFailure, } from "../../test-i import { PredictiveStateUpdatesPage } from "../../pages/serverStarterAllFeaturesPages/PredictiveStateUpdatesPage"; test.describe("Predictive Status Updates Feature", () => { - test.fixme("[Server Starter all features] should interact with agent and approve asked changes", async ({ page, }) => { + test("[Server Starter all features] should interact with agent and approve asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { const predictiveStateUpdates = new PredictiveStateUpdatesPage(page); @@ -41,7 +41,7 @@ test.describe("Predictive Status Updates Feature", () => { }); }); - test.fixme("[Server Starter all features] should interact with agent and reject asked changes", async ({ page, }) => { + test("[Server Starter all features] should interact with agent and reject asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { const predictiveStateUpdates = new PredictiveStateUpdatesPage(page); From a76003b06490617e430e38c865f62ff980436a2b Mon Sep 17 00:00:00 2001 From: ran Date: Mon, 18 Aug 2025 09:57:40 +0200 Subject: [PATCH 03/10] chore: disable pydantic test which requires fix --- .../tests/pydanticAITests/predictvieStateUpdatePage.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts index 72b93dfd0..0221871aa 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts @@ -7,7 +7,7 @@ import { import { PredictiveStateUpdatesPage } from "../../pages/pydanticAIPages/PredictiveStateUpdatesPage"; test.describe("Predictive Status Updates Feature", () => { - test("[PydanticAI] should interact with agent and approve asked changes", async ({ + test.fixme("[PydanticAI] should interact with agent and approve asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { @@ -44,7 +44,7 @@ test.describe("Predictive Status Updates Feature", () => { }); }); - test("[PydanticAI] should interact with agent and reject asked changes", async ({ + test.fixme("[PydanticAI] should interact with agent and reject asked changes", async ({ page, }) => { await retryOnAIFailure(async () => { From d0a1d30ec8b1d8ec4ba4b2268a39efe2e8549091 Mon Sep 17 00:00:00 2001 From: ran Date: Mon, 18 Aug 2025 14:54:33 +0200 Subject: [PATCH 04/10] fix: reset active run values to an actual dictionary --- .../integrations/langgraph/python/ag_ui_langgraph/agent.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/agent.py b/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/agent.py index 493fbbf4b..03ff8fe5a 100644 --- a/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/agent.py +++ b/typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/agent.py @@ -100,11 +100,13 @@ async def run(self, input: RunAgentInput) -> AsyncGenerator[str, None]: async def _handle_stream_events(self, input: RunAgentInput) -> AsyncGenerator[str, None]: thread_id = input.thread_id or str(uuid.uuid4()) - self.active_run = { + INITIAL_ACTIVE_RUN = { "id": input.run_id, "thread_id": thread_id, "thinking_process": None, + "node_name": None, } + self.active_run = INITIAL_ACTIVE_RUN forwarded_props = input.forwarded_props node_name_input = forwarded_props.get('node_name', None) if forwarded_props else None @@ -256,7 +258,8 @@ async def _handle_stream_events(self, input: RunAgentInput) -> AsyncGenerator[st yield self._dispatch_event( RunFinishedEvent(type=EventType.RUN_FINISHED, thread_id=thread_id, run_id=self.active_run["id"]) ) - self.active_run = None + # Reset active run to how it was before the stream started + self.active_run = INITIAL_ACTIVE_RUN async def prepare_stream(self, input: RunAgentInput, agent_state: State, config: RunnableConfig): From 7f6df35ae661fe91b68ce3b4fe462e9e87a9a840 Mon Sep 17 00:00:00 2001 From: ran Date: Mon, 18 Aug 2025 15:14:05 +0200 Subject: [PATCH 05/10] chore: consider the activity dots of cpk as a loader in tests --- typescript-sdk/apps/dojo/e2e/test-isolation-helper.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/typescript-sdk/apps/dojo/e2e/test-isolation-helper.ts b/typescript-sdk/apps/dojo/e2e/test-isolation-helper.ts index 20d5c2df2..de780bf67 100644 --- a/typescript-sdk/apps/dojo/e2e/test-isolation-helper.ts +++ b/typescript-sdk/apps/dojo/e2e/test-isolation-helper.ts @@ -23,9 +23,12 @@ export async function waitForAIResponse(page: Page, timeout: number = 90000) { await page.waitForFunction( () => { // Look for common AI loading indicators - const loadingIndicators = document.querySelectorAll( + const loadingIndicators = [ + ...document.querySelectorAll( '[data-testid*="loading"], .loading, .spinner' - ); + ), + ...document.querySelectorAll('.copilotKitActivityDot') + ]; return loadingIndicators.length === 0; }, { timeout } From 76317aa5941beab7cba4f7203432c9823fba9d48 Mon Sep 17 00:00:00 2001 From: ran Date: Mon, 18 Aug 2025 15:14:32 +0200 Subject: [PATCH 06/10] chore: refrain from attempting to open an always open chat --- .../pages/langGraphFastAPIPages/AgenticChatPage.ts | 12 ------------ .../dojo/e2e/tests/agnoTests/agenticChatPage.spec.ts | 4 ---- .../e2e/tests/crewAITests/agenticChatPage.spec.ts | 3 --- .../langgraphFastAPITests/agenticChatPage.spec.ts | 4 +--- .../e2e/tests/langgraphTests/agenticChatPage.spec.ts | 3 --- .../tests/llamaIndexTests/agenticChatPage.spec.ts | 3 --- .../mastraAgentLocalTests/agenticChatPage.spec.ts | 3 --- .../e2e/tests/mastraTests/agenticChatPage.spec.ts | 4 ---- .../middlewareStarterTests/agenticChatPage.spec.ts | 1 - .../tests/pydanticAITests/agenticChatPage.spec.ts | 3 --- .../agenticChatPage.spec.ts | 1 - .../tests/serverStarterTests/agenticChatPage.spec.ts | 1 - .../tests/vercelAISdkTests/agenticChatPage.spec.ts | 3 --- 13 files changed, 1 insertion(+), 44 deletions(-) diff --git a/typescript-sdk/apps/dojo/e2e/pages/langGraphFastAPIPages/AgenticChatPage.ts b/typescript-sdk/apps/dojo/e2e/pages/langGraphFastAPIPages/AgenticChatPage.ts index 85be9da44..7b39fad73 100644 --- a/typescript-sdk/apps/dojo/e2e/pages/langGraphFastAPIPages/AgenticChatPage.ts +++ b/typescript-sdk/apps/dojo/e2e/pages/langGraphFastAPIPages/AgenticChatPage.ts @@ -2,7 +2,6 @@ import { Page, Locator, expect } from "@playwright/test"; export class AgenticChatPage { readonly page: Page; - readonly openChatButton: Locator; readonly agentGreeting: Locator; readonly chatInput: Locator; readonly sendButton: Locator; @@ -12,9 +11,6 @@ export class AgenticChatPage { constructor(page: Page) { this.page = page; - this.openChatButton = page.getByRole("button", { - name: /chat/i, - }); this.agentGreeting = page .getByText("Hi, I'm an agent. Want to chat?"); this.chatInput = page @@ -36,14 +32,6 @@ export class AgenticChatPage { .locator(".copilotKitUserMessage"); } - async openChat() { - try { - await this.openChatButton.click({ timeout: 3000 }); - } catch (error) { - // Chat might already be open - } - } - async sendMessage(message: string) { await this.chatInput.click(); await this.chatInput.fill(message); diff --git a/typescript-sdk/apps/dojo/e2e/tests/agnoTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/agnoTests/agenticChatPage.spec.ts index bd84be4b3..383bc8133 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/agnoTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/agnoTests/agenticChatPage.spec.ts @@ -16,7 +16,6 @@ test("[Agno] Agentic Chat sends and receives a greeting message", async ({ const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi"); @@ -36,7 +35,6 @@ test("[Agno] Agentic Chat provides stock price information", async ({ const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Ask for AAPL stock price @@ -58,7 +56,6 @@ test("[Agno] Agentic Chat retains memory of previous questions", async ({ ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // First question @@ -87,7 +84,6 @@ test("[Agno] Agentic Chat retains memory of user messages during a conversation" ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/crewAITests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/crewAITests/agenticChatPage.spec.ts index fedc8075a..95ba28ccc 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/crewAITests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/crewAITests/agenticChatPage.spec.ts @@ -16,7 +16,6 @@ test("[CrewAI] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -36,7 +35,6 @@ test.fixme("[CrewAI] Agentic Chat changes background on message and reset", asyn const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -83,7 +81,6 @@ test("[CrewAI] Agentic Chat retains memory of user messages during a conversatio ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/agenticChatPage.spec.ts index 7806f9544..f0788000b 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/agenticChatPage.spec.ts @@ -16,7 +16,6 @@ test("[LangGraph FastAPI] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -36,7 +35,6 @@ test("[LangGraph FastAPI] Agentic Chat changes background on message and reset", const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -48,6 +46,7 @@ test("[LangGraph FastAPI] Agentic Chat changes background on message and reset", await chat.assertUserMessageVisible( "Hi change the background color to blue" ); + await waitForAIResponse(page); const backgroundBlue = await chat.getBackground(); @@ -83,7 +82,6 @@ test("[LangGraph FastAPI] Agentic Chat retains memory of user messages during a ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/agenticChatPage.spec.ts index 0a8b225f4..5ca98e1f6 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/agenticChatPage.spec.ts @@ -16,7 +16,6 @@ test("[LangGraph] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -36,7 +35,6 @@ test("[LangGraph] Agentic Chat changes background on message and reset", async ( const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -78,7 +76,6 @@ test("[LangGraph] Agentic Chat retains memory of user messages during a conversa ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/llamaIndexTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/llamaIndexTests/agenticChatPage.spec.ts index 75a730c8d..064254968 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/llamaIndexTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/llamaIndexTests/agenticChatPage.spec.ts @@ -16,7 +16,6 @@ test("[LlamaIndex] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -36,7 +35,6 @@ test("[LlamaIndex] Agentic Chat changes background on message and reset", async const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -83,7 +81,6 @@ test("[LlamaIndex] Agentic Chat retains memory of user messages during a convers ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/mastraAgentLocalTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/mastraAgentLocalTests/agenticChatPage.spec.ts index 8826a05f1..c4f5c6b28 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/mastraAgentLocalTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/mastraAgentLocalTests/agenticChatPage.spec.ts @@ -16,7 +16,6 @@ test("[MastraAgentLocal] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -36,7 +35,6 @@ test("[MastraAgentLocal] Agentic Chat changes background on message and reset", const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -83,7 +81,6 @@ test("[MastraAgentLocal] Agentic Chat retains memory of user messages during a c ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/mastraTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/mastraTests/agenticChatPage.spec.ts index f22220243..ce74ffe65 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/mastraTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/mastraTests/agenticChatPage.spec.ts @@ -16,7 +16,6 @@ test("[Mastra] Agentic Chat sends and receives a greeting message", async ({ const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi"); @@ -36,7 +35,6 @@ test("[Mastra] Agentic Chat provides weather information", async ({ const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Ask for Islamabad weather @@ -58,7 +56,6 @@ test("[Mastra] Agentic Chat retains memory of previous questions", async ({ ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // First question about weather @@ -86,7 +83,6 @@ test("[Mastra] Agentic Chat retains memory of user messages during a conversatio ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/middlewareStarterTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/middlewareStarterTests/agenticChatPage.spec.ts index 6e598d8ad..19ad59c31 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/middlewareStarterTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/middlewareStarterTests/agenticChatPage.spec.ts @@ -15,7 +15,6 @@ test("[Middleware Starter] Testing Agentic Chat", async ({ ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); await chat.sendMessage("Hey there"); await chat.assertUserMessageVisible("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/agenticChatPage.spec.ts index 8c5b9d4c3..7e423e4dc 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/agenticChatPage.spec.ts @@ -16,7 +16,6 @@ test("[PydanticAI] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -36,7 +35,6 @@ test("[PydanticAI] Agentic Chat changes background on message and reset", async const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -83,7 +81,6 @@ test("[PydanticAI] Agentic Chat retains memory of user messages during a convers ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/agenticChatPage.spec.ts index 30d6ca45c..3068dfcf6 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/agenticChatPage.spec.ts @@ -15,7 +15,6 @@ test("[Server Starter all features] Agentic Chat displays countdown from 10 to 1 ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); await chat.sendMessage("Hey there"); await chat.assertUserMessageVisible("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/serverStarterTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/serverStarterTests/agenticChatPage.spec.ts index 9d4e0f9c7..7888b7f6b 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/serverStarterTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/serverStarterTests/agenticChatPage.spec.ts @@ -15,7 +15,6 @@ test("[Server Starter] Testing Agentic Chat", async ({ ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); await chat.sendMessage("Hey there"); await chat.assertUserMessageVisible("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/vercelAISdkTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/vercelAISdkTests/agenticChatPage.spec.ts index 265d3deb1..23ea702ce 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/vercelAISdkTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/vercelAISdkTests/agenticChatPage.spec.ts @@ -16,7 +16,6 @@ test("[verceAISdkPages] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -36,7 +35,6 @@ test("[Vercel AI SDK] Agentic Chat changes background on message and reset", asy const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -83,7 +81,6 @@ test("[Vercel AI SDK] Agentic Chat retains memory of user messages during a conv ); const chat = new AgenticChatPage(page); - await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); From ac4d63d82e740bac557e44c962b4bf6abea28ede Mon Sep 17 00:00:00 2001 From: ran Date: Fri, 22 Aug 2025 11:12:06 +0200 Subject: [PATCH 07/10] chore: fix predictive state update tests for langgraph --- .../langgraphFastAPITests/predictvieStateUpdatePage.spec.ts | 5 ----- .../tests/langgraphTests/predictvieStateUpdatePage.spec.ts | 5 ----- 2 files changed, 10 deletions(-) diff --git a/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/predictvieStateUpdatePage.spec.ts index 5c486d7a9..fc11ba9fd 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/predictvieStateUpdatePage.spec.ts @@ -1,7 +1,6 @@ import { test, expect, - waitForAIResponse, retryOnAIFailure, } from "../../test-isolation-helper"; import { PredictiveStateUpdatesPage } from "../../pages/langGraphFastAPIPages/PredictiveStateUpdatesPage"; @@ -23,7 +22,6 @@ test.describe("Predictive Status Updates Feature", () => { await predictiveStateUpdates.sendMessage( "Give me a story for a dragon called Atlantis in document" ); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); @@ -37,7 +35,6 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(3000); await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); @@ -66,7 +63,6 @@ test.describe("Predictive Status Updates Feature", () => { await predictiveStateUpdates.sendMessage( "Give me a story for a dragon called Atlantis in document" ); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); @@ -80,7 +76,6 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(3000); await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); diff --git a/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/predictvieStateUpdatePage.spec.ts index 236449552..22ae72f33 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/predictvieStateUpdatePage.spec.ts @@ -1,7 +1,6 @@ import { test, expect, - waitForAIResponse, retryOnAIFailure, } from "../../test-isolation-helper"; import { PredictiveStateUpdatesPage } from "../../pages/langGraphPages/PredictiveStateUpdatesPage"; @@ -23,7 +22,6 @@ test.describe("Predictive Status Updates Feature", () => { await predictiveStateUpdates.sendMessage( "Give me a story for a dragon called Atlantis in document" ); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); @@ -37,7 +35,6 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(3000); await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); @@ -66,7 +63,6 @@ test.describe("Predictive Status Updates Feature", () => { await predictiveStateUpdates.sendMessage( "Give me a story for a dragon called Atlantis in document" ); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); @@ -80,7 +76,6 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(3000); await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); From a01024deb5e16b91b0fb9b1491a6586451baba6d Mon Sep 17 00:00:00 2001 From: ran Date: Fri, 22 Aug 2025 11:13:14 +0200 Subject: [PATCH 08/10] chore: fix predictive state update tests for several integrations --- .../crewAITests/predictvieStateUpdatePage.spec.ts | 7 +++---- .../pydanticAITests/predictvieStateUpdatePage.spec.ts | 7 +++---- .../predictvieStateUpdatePage.spec.ts | 10 +++++----- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/typescript-sdk/apps/dojo/e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts index 8bafd1833..aea45d2fc 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/crewAITests/predictvieStateUpdatePage.spec.ts @@ -1,7 +1,6 @@ import { test, expect, - waitForAIResponse, retryOnAIFailure, } from "../../test-isolation-helper"; import { PredictiveStateUpdatesPage } from "../../pages/crewAIPages/PredictiveStateUpdatesPage"; @@ -22,7 +21,7 @@ test.describe("Predictive Status Updates Feature", () => { await predictiveStateUpdates.sendMessage( "Give me a story for a dragon called Atlantis in document" ); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); await predictiveStateUpdates.getUserApproval(); await predictiveStateUpdates.confirmedChangesResponse.isVisible(); @@ -33,7 +32,7 @@ test.describe("Predictive Status Updates Feature", () => { // Send update to change the dragon name await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); await predictiveStateUpdates.getUserApproval(); await predictiveStateUpdates.confirmedChangesResponse.nth(1).isVisible(); @@ -70,7 +69,7 @@ test.describe("Predictive Status Updates Feature", () => { // Send update to change the dragon name await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); await predictiveStateUpdates.getUserRejection(); await predictiveStateUpdates.rejectedChangesResponse.isVisible(); diff --git a/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts index 0221871aa..3f386a236 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/predictvieStateUpdatePage.spec.ts @@ -1,7 +1,6 @@ import { test, expect, - waitForAIResponse, retryOnAIFailure, } from "../../test-isolation-helper"; import { PredictiveStateUpdatesPage } from "../../pages/pydanticAIPages/PredictiveStateUpdatesPage"; @@ -22,7 +21,7 @@ test.describe("Predictive Status Updates Feature", () => { await predictiveStateUpdates.sendMessage( "Give me a story for a dragon called Atlantis in document" ); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); await predictiveStateUpdates.getUserApproval(); await predictiveStateUpdates.confirmedChangesResponse.isVisible(); @@ -33,7 +32,7 @@ test.describe("Predictive Status Updates Feature", () => { // Send update to change the dragon name await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); await predictiveStateUpdates.getUserApproval(); await predictiveStateUpdates.confirmedChangesResponse.nth(1).isVisible(); @@ -70,7 +69,7 @@ test.describe("Predictive Status Updates Feature", () => { // Send update to change the dragon name await predictiveStateUpdates.sendMessage("Change dragon name to Lola"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); await predictiveStateUpdates.getUserRejection(); await predictiveStateUpdates.rejectedChangesResponse.isVisible(); diff --git a/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/predictvieStateUpdatePage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/predictvieStateUpdatePage.spec.ts index 6f12b8d26..d697e94cf 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/predictvieStateUpdatePage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/predictvieStateUpdatePage.spec.ts @@ -1,4 +1,4 @@ -import { test, expect, waitForAIResponse, retryOnAIFailure, } from "../../test-isolation-helper"; +import { test, expect, retryOnAIFailure, } from "../../test-isolation-helper"; import { PredictiveStateUpdatesPage } from "../../pages/serverStarterAllFeaturesPages/PredictiveStateUpdatesPage"; test.describe("Predictive Status Updates Feature", () => { @@ -14,7 +14,7 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(2000); await predictiveStateUpdates.sendMessage("Hi"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); @@ -27,7 +27,7 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(3000); await predictiveStateUpdates.sendMessage("Change the dog name"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); @@ -53,7 +53,7 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(2000); await predictiveStateUpdates.sendMessage("Hi"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await page.waitForTimeout(2000); await predictiveStateUpdates.getPredictiveResponse(); @@ -66,7 +66,7 @@ test.describe("Predictive Status Updates Feature", () => { await page.waitForTimeout(3000); await predictiveStateUpdates.sendMessage("Change the dog name"); - await waitForAIResponse(page); + await page.waitForTimeout(2000); await page.waitForTimeout(2000); await predictiveStateUpdates.verifyHighlightedText(); From 72b45605a83abe8fb03af9f1b7e441914f25272f Mon Sep 17 00:00:00 2001 From: ran Date: Fri, 22 Aug 2025 11:21:55 +0200 Subject: [PATCH 09/10] chore: revert several test changes --- .../pages/langGraphFastAPIPages/AgenticChatPage.ts | 12 ++++++++++++ .../dojo/e2e/tests/agnoTests/agenticChatPage.spec.ts | 4 ++++ .../e2e/tests/crewAITests/agenticChatPage.spec.ts | 3 +++ .../langgraphFastAPITests/agenticChatPage.spec.ts | 4 +++- .../e2e/tests/langgraphTests/agenticChatPage.spec.ts | 3 +++ .../tests/llamaIndexTests/agenticChatPage.spec.ts | 3 +++ .../mastraAgentLocalTests/agenticChatPage.spec.ts | 3 +++ .../e2e/tests/mastraTests/agenticChatPage.spec.ts | 4 ++++ .../middlewareStarterTests/agenticChatPage.spec.ts | 1 + .../tests/pydanticAITests/agenticChatPage.spec.ts | 3 +++ .../agenticChatPage.spec.ts | 1 + .../tests/serverStarterTests/agenticChatPage.spec.ts | 1 + .../tests/vercelAISdkTests/agenticChatPage.spec.ts | 3 +++ 13 files changed, 44 insertions(+), 1 deletion(-) diff --git a/typescript-sdk/apps/dojo/e2e/pages/langGraphFastAPIPages/AgenticChatPage.ts b/typescript-sdk/apps/dojo/e2e/pages/langGraphFastAPIPages/AgenticChatPage.ts index 7b39fad73..85be9da44 100644 --- a/typescript-sdk/apps/dojo/e2e/pages/langGraphFastAPIPages/AgenticChatPage.ts +++ b/typescript-sdk/apps/dojo/e2e/pages/langGraphFastAPIPages/AgenticChatPage.ts @@ -2,6 +2,7 @@ import { Page, Locator, expect } from "@playwright/test"; export class AgenticChatPage { readonly page: Page; + readonly openChatButton: Locator; readonly agentGreeting: Locator; readonly chatInput: Locator; readonly sendButton: Locator; @@ -11,6 +12,9 @@ export class AgenticChatPage { constructor(page: Page) { this.page = page; + this.openChatButton = page.getByRole("button", { + name: /chat/i, + }); this.agentGreeting = page .getByText("Hi, I'm an agent. Want to chat?"); this.chatInput = page @@ -32,6 +36,14 @@ export class AgenticChatPage { .locator(".copilotKitUserMessage"); } + async openChat() { + try { + await this.openChatButton.click({ timeout: 3000 }); + } catch (error) { + // Chat might already be open + } + } + async sendMessage(message: string) { await this.chatInput.click(); await this.chatInput.fill(message); diff --git a/typescript-sdk/apps/dojo/e2e/tests/agnoTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/agnoTests/agenticChatPage.spec.ts index 383bc8133..bd84be4b3 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/agnoTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/agnoTests/agenticChatPage.spec.ts @@ -16,6 +16,7 @@ test("[Agno] Agentic Chat sends and receives a greeting message", async ({ const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi"); @@ -35,6 +36,7 @@ test("[Agno] Agentic Chat provides stock price information", async ({ const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Ask for AAPL stock price @@ -56,6 +58,7 @@ test("[Agno] Agentic Chat retains memory of previous questions", async ({ ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // First question @@ -84,6 +87,7 @@ test("[Agno] Agentic Chat retains memory of user messages during a conversation" ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/crewAITests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/crewAITests/agenticChatPage.spec.ts index 95ba28ccc..fedc8075a 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/crewAITests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/crewAITests/agenticChatPage.spec.ts @@ -16,6 +16,7 @@ test("[CrewAI] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -35,6 +36,7 @@ test.fixme("[CrewAI] Agentic Chat changes background on message and reset", asyn const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -81,6 +83,7 @@ test("[CrewAI] Agentic Chat retains memory of user messages during a conversatio ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/agenticChatPage.spec.ts index f0788000b..7806f9544 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/langgraphFastAPITests/agenticChatPage.spec.ts @@ -16,6 +16,7 @@ test("[LangGraph FastAPI] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -35,6 +36,7 @@ test("[LangGraph FastAPI] Agentic Chat changes background on message and reset", const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -46,7 +48,6 @@ test("[LangGraph FastAPI] Agentic Chat changes background on message and reset", await chat.assertUserMessageVisible( "Hi change the background color to blue" ); - await waitForAIResponse(page); const backgroundBlue = await chat.getBackground(); @@ -82,6 +83,7 @@ test("[LangGraph FastAPI] Agentic Chat retains memory of user messages during a ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/agenticChatPage.spec.ts index 5ca98e1f6..0a8b225f4 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/langgraphTests/agenticChatPage.spec.ts @@ -16,6 +16,7 @@ test("[LangGraph] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -35,6 +36,7 @@ test("[LangGraph] Agentic Chat changes background on message and reset", async ( const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -76,6 +78,7 @@ test("[LangGraph] Agentic Chat retains memory of user messages during a conversa ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/llamaIndexTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/llamaIndexTests/agenticChatPage.spec.ts index 064254968..75a730c8d 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/llamaIndexTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/llamaIndexTests/agenticChatPage.spec.ts @@ -16,6 +16,7 @@ test("[LlamaIndex] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -35,6 +36,7 @@ test("[LlamaIndex] Agentic Chat changes background on message and reset", async const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -81,6 +83,7 @@ test("[LlamaIndex] Agentic Chat retains memory of user messages during a convers ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/mastraAgentLocalTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/mastraAgentLocalTests/agenticChatPage.spec.ts index c4f5c6b28..8826a05f1 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/mastraAgentLocalTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/mastraAgentLocalTests/agenticChatPage.spec.ts @@ -16,6 +16,7 @@ test("[MastraAgentLocal] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -35,6 +36,7 @@ test("[MastraAgentLocal] Agentic Chat changes background on message and reset", const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -81,6 +83,7 @@ test("[MastraAgentLocal] Agentic Chat retains memory of user messages during a c ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/mastraTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/mastraTests/agenticChatPage.spec.ts index ce74ffe65..f22220243 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/mastraTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/mastraTests/agenticChatPage.spec.ts @@ -16,6 +16,7 @@ test("[Mastra] Agentic Chat sends and receives a greeting message", async ({ const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi"); @@ -35,6 +36,7 @@ test("[Mastra] Agentic Chat provides weather information", async ({ const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Ask for Islamabad weather @@ -56,6 +58,7 @@ test("[Mastra] Agentic Chat retains memory of previous questions", async ({ ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // First question about weather @@ -83,6 +86,7 @@ test("[Mastra] Agentic Chat retains memory of user messages during a conversatio ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/middlewareStarterTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/middlewareStarterTests/agenticChatPage.spec.ts index 19ad59c31..6e598d8ad 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/middlewareStarterTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/middlewareStarterTests/agenticChatPage.spec.ts @@ -15,6 +15,7 @@ test("[Middleware Starter] Testing Agentic Chat", async ({ ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); await chat.sendMessage("Hey there"); await chat.assertUserMessageVisible("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/agenticChatPage.spec.ts index 7e423e4dc..8c5b9d4c3 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/pydanticAITests/agenticChatPage.spec.ts @@ -16,6 +16,7 @@ test("[PydanticAI] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -35,6 +36,7 @@ test("[PydanticAI] Agentic Chat changes background on message and reset", async const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -81,6 +83,7 @@ test("[PydanticAI] Agentic Chat retains memory of user messages during a convers ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/agenticChatPage.spec.ts index 3068dfcf6..30d6ca45c 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/serverStarterAllFeaturesTests/agenticChatPage.spec.ts @@ -15,6 +15,7 @@ test("[Server Starter all features] Agentic Chat displays countdown from 10 to 1 ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); await chat.sendMessage("Hey there"); await chat.assertUserMessageVisible("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/serverStarterTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/serverStarterTests/agenticChatPage.spec.ts index 7888b7f6b..9d4e0f9c7 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/serverStarterTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/serverStarterTests/agenticChatPage.spec.ts @@ -15,6 +15,7 @@ test("[Server Starter] Testing Agentic Chat", async ({ ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); await chat.sendMessage("Hey there"); await chat.assertUserMessageVisible("Hey there"); diff --git a/typescript-sdk/apps/dojo/e2e/tests/vercelAISdkTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/vercelAISdkTests/agenticChatPage.spec.ts index 23ea702ce..265d3deb1 100644 --- a/typescript-sdk/apps/dojo/e2e/tests/vercelAISdkTests/agenticChatPage.spec.ts +++ b/typescript-sdk/apps/dojo/e2e/tests/vercelAISdkTests/agenticChatPage.spec.ts @@ -16,6 +16,7 @@ test("[verceAISdkPages] Agentic Chat sends and receives a message", async ({ const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.isVisible; await chat.sendMessage("Hi, I am duaa"); @@ -35,6 +36,7 @@ test("[Vercel AI SDK] Agentic Chat changes background on message and reset", asy const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.waitFor({ state: "visible" }); // Store initial background color @@ -81,6 +83,7 @@ test("[Vercel AI SDK] Agentic Chat retains memory of user messages during a conv ); const chat = new AgenticChatPage(page); + await chat.openChat(); await chat.agentGreeting.click(); await chat.sendMessage("Hey there"); From eec55bd3ee0f69fb2b95b80b07d66dd7ededf580 Mon Sep 17 00:00:00 2001 From: ran Date: Fri, 22 Aug 2025 11:33:11 +0200 Subject: [PATCH 10/10] chore: revert several test changes --- typescript-sdk/apps/dojo/e2e/test-isolation-helper.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/typescript-sdk/apps/dojo/e2e/test-isolation-helper.ts b/typescript-sdk/apps/dojo/e2e/test-isolation-helper.ts index de780bf67..20d5c2df2 100644 --- a/typescript-sdk/apps/dojo/e2e/test-isolation-helper.ts +++ b/typescript-sdk/apps/dojo/e2e/test-isolation-helper.ts @@ -23,12 +23,9 @@ export async function waitForAIResponse(page: Page, timeout: number = 90000) { await page.waitForFunction( () => { // Look for common AI loading indicators - const loadingIndicators = [ - ...document.querySelectorAll( + const loadingIndicators = document.querySelectorAll( '[data-testid*="loading"], .loading, .spinner' - ), - ...document.querySelectorAll('.copilotKitActivityDot') - ]; + ); return loadingIndicators.length === 0; }, { timeout }