diff --git a/test/automation/src/chat.ts b/test/automation/src/chat.ts index c9773cbb7690f3..3f009062360960 100644 --- a/test/automation/src/chat.ts +++ b/test/automation/src/chat.ts @@ -72,17 +72,6 @@ export class Chat { return element?.attributes['data-bound-chat-resource']; } - /** - * Waits until the chat view is bound to a chat session other than - * `previousSessionResource`. Commands that start a new chat in the view - * keep running after the command palette closes, so a message sent before - * the new session is bound lands in the outgoing session and its response - * is never shown. - */ - async waitForChatViewSessionChange(previousSessionResource: string | undefined, retryCount?: number): Promise { - await this.code.waitForElement(CHAT_VIEW_BOUND_SESSION, element => !!element && element.attributes['data-bound-chat-resource'] !== previousSessionResource, retryCount); - } - /** * Waits until the chat view is bound to a local chat session other than * `previousSessionResource`, such as the one `smoketest.openLocalChat` diff --git a/test/smoke/src/areas/chat/chatSessions.test.ts b/test/smoke/src/areas/chat/chatSessions.test.ts index 2478c4401f965d..d892b51e855676 100644 --- a/test/smoke/src/areas/chat/chatSessions.test.ts +++ b/test/smoke/src/areas/chat/chatSessions.test.ts @@ -192,13 +192,15 @@ async function openSession(app: Application, session: { readonly command: string await app.workbench.quickaccess.runCommand(session.command); await app.workbench.chat.waitForChatEditor(600); } else { - // The chat view may already be open, so wait for the command to bind a - // new session to it rather than just for the view to exist. Otherwise - // the prompt can be sent into the outgoing session, which the view then - // replaces with an empty one. + // Wait for the command to bind a new local session to the view, not + // just any session. The view can open first with its default Agent Host + // Copilot session while the command still waits for the local chat + // command to register, as when this test is the first of the suite in + // a cold window. A prompt sent then goes to that session and never gets + // the local reply. const previousSessionResource = await app.workbench.chat.getChatViewSessionResource(); await app.workbench.quickaccess.runCommand(session.command); - await app.workbench.chat.waitForChatViewSessionChange(previousSessionResource, 600); + await app.workbench.chat.waitForNewLocalChatViewSession(previousSessionResource, 600); } }