Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 0 additions & 11 deletions test/automation/src/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
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`
Expand Down
12 changes: 7 additions & 5 deletions test/smoke/src/areas/chat/chatSessions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down