Skip to content

Add smoke test for anonymous chat access#291953

Merged
bpasero merged 10 commits intomainfrom
copilot/explore-smoke-test-chat-anonymous
Jan 31, 2026
Merged

Add smoke test for anonymous chat access#291953
bpasero merged 10 commits intomainfrom
copilot/explore-smoke-test-chat-anonymous

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

Adds a smoke test to validate anonymous chat functionality by enabling chat.allowAnonymousAccess, sending a message, and verifying a response is received.

Changes

  • test/automation/src/chat.ts: Added waitForResponse() method with selectors for response elements (.interactive-response) and completion state (:not(.chat-response-loading))
  • test/smoke/src/areas/chat/chatAnonymous.test.ts: New test that:
    • Enables chat.allowAnonymousAccess setting
    • Opens chat view and sends a message
    • Waits for response completion
  • test/smoke/src/main.ts: Registered new test (Electron-only, matching existing chat tests)

Example usage

// In automation tests
await app.workbench.chat.sendMessage('Hello');
await app.workbench.chat.waitForResponse();
Original prompt

This section details on the original issue you should resolve

<issue_title>Explore smoke test to test Chat anonymous</issue_title>
<issue_description>

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version:
  • OS Version:

Steps to Reproduce:

</issue_description>

<agent_instructions>add a new smoke test similar to the test/smoke/src/areas/chat/chat.test.ts one where:

  • chat.allowAnonymousAccess is set to true
  • a chat message is sent from the chat view
  • a response is validated</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Copilot AI changed the title [WIP] Explore smoke test for testing Chat anonymous Add smoke test for anonymous chat access Jan 30, 2026
Copilot AI requested a review from bpasero January 30, 2026 18:45
@bpasero bpasero marked this pull request as ready for review January 31, 2026 12:47
Copilot AI review requested due to automatic review settings January 31, 2026 12:47
@bpasero bpasero enabled auto-merge (squash) January 31, 2026 12:47
@bpasero bpasero added this to the February 2026 milestone Jan 31, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a smoke test to validate anonymous chat functionality and makes several supporting changes to enable reliable test execution.

Changes:

  • Adds new smoke test for anonymous chat access that enables the chat.allowAnonymousAccess setting, sends a message, and verifies response completion
  • Adds waitForResponse() and waitForModelInFooter() methods to the Chat automation class for verifying chat behavior
  • Removes the Notification class from automation infrastructure and instead disables toast notifications during smoke tests at the source
  • Disables chat session shutdown veto dialogs during smoke tests to prevent interference with test execution

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/smoke/src/areas/chat/chatAnonymous.test.ts New smoke test that enables anonymous access, sends a chat message, and validates response
test/automation/src/chat.ts Adds waitForResponse() and waitForModelInFooter() methods; removes Notification dependency
test/smoke/src/main.ts Registers the new anonymous chat test (Insiders-only, Electron-only)
test/automation/src/workbench.ts Removes Notification class from Chat constructor
test/automation/src/notification.ts Deletes the Notification class entirely
test/automation/src/index.ts Removes Notification export
src/vs/workbench/contrib/chat/electron-browser/chat.contribution.ts Bypasses shutdown veto for smoke tests
src/vs/workbench/browser/parts/notifications/notificationsToasts.ts Disables toast notifications during smoke tests
Comments suppressed due to low confidence (1)

test/automation/src/chat.ts:54

  • The waitForResponse method passes the retryCount parameter to waitForElement, but this parameter could be undefined. While waitForElement has a default value of 200 for retryCount, it's better to be explicit about the default behavior or document that undefined will use the default. Consider adding a comment explaining this parameter or providing a default value in the method signature.
	async waitForResponse(retryCount?: number): Promise<void> {

		// First wait for a response element to appear
		await this.code.waitForElement(CHAT_RESPONSE, undefined, retryCount);

		// Then wait for it to complete (not loading)
		await this.code.waitForElement(CHAT_RESPONSE_COMPLETE, undefined, retryCount);
	}

@bpasero bpasero merged commit b31c729 into main Jan 31, 2026
27 of 28 checks passed
@bpasero bpasero deleted the copilot/explore-smoke-test-chat-anonymous branch January 31, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explore smoke test to test Chat anonymous

4 participants