Add browser tool smoke tests#311123
Merged
Merged
Conversation
Co-authored-by: Copilot <copilot@github.com>
Contributor
Screenshot ChangesBase: Changed (28) |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new VS Code API integration test suite to smoke-test the integrated browser “chat tools” (open page, type, click, read, run Playwright), and updates the test workspace HTML to provide simple DOM elements for interaction.
Changes:
- Add
browser.tools.test.tsintegration tests that enable browser chat tools + global auto-approve and invokevscode.lmbrowser tools. - Extend
testWorkspace/index.htmlwith an input + button + output area to support tool-driven typing/clicking verification.
Show a summary per file
| File | Description |
|---|---|
| extensions/vscode-api-tests/testWorkspace/index.html | Adds minimal UI elements and click handler for browser-tool interaction tests. |
| extensions/vscode-api-tests/src/singlefolder-tests/browser.tools.test.ts | New integration suite exercising browser LM tools (open/type/click/read/run Playwright) with auto-approve enabled. |
Copilot's findings
Comments suppressed due to low confidence (2)
extensions/vscode-api-tests/src/singlefolder-tests/browser.tools.test.ts:99
- This test depends on reaching
https://google.com/, which can be blocked in CI (no outbound internet), by enterprise policy, or by the agent network filter (when enabled, an empty allowlist blocks all domains). To keep the suite deterministic, prefer a local/file URL (already covered by the next test) or use a stable domain like example.com with explicit allowlisting when network filtering is active (and/or make the assertion tolerant of navigation failures).
test('Open a page from the web', async function () {
this.timeout(60000);
const output = await invokeTool('open_browser_page', { url: 'https://google.com/' });
assert.match(output, /Page ID:/, `Expected output to contain "Page ID:", got: ${output}`);
});
extensions/vscode-api-tests/src/singlefolder-tests/browser.tools.test.ts:109
fileUrlis built fromworkspaceFolders[0].uri.fsPath. In remote integration runs, the workspace folder URI is typically remote (e.g.vscode-remote:) and the file path will not exist on the local UI machine where the integrated browser/Playwright runs, causing the browser page open to fail. Consider skipping this test whenvscode.env.remoteNameis set, or avoid local file paths by using a data URL /about:blank+run_playwright_codetopage.setContent(...)to create the test DOM.
// Build a file:// URL to the test workspace's index.html
const workspaceFolders = vscode.workspace.workspaceFolders;
assert.ok(workspaceFolders && workspaceFolders.length > 0, 'Expected a workspace folder');
const indexHtmlPath = path.join(workspaceFolders[0].uri.fsPath, 'index.html');
const fileUrl = vscode.Uri.file(indexHtmlPath).toString();
- Files reviewed: 2/2 changed files
- Comments generated: 1
roblourens
approved these changes
Apr 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.