Skip to content

Commit 90460f6

Browse files
Have playwright MCP always trace (microsoft#273145)
Have MCP always trace so that traces can be looked at easily.
1 parent 92c6899 commit 90460f6

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

test/mcp/src/application.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,13 @@ export async function getApplication({ recordVideo }: { recordVideo?: boolean }
254254
codePath: opts.build,
255255
workspacePath: rootPath,
256256
logger,
257-
logsPath: path.join(logsRootPath, 'suite_unknown'),
258-
crashesPath: path.join(crashesRootPath, 'suite_unknown'),
257+
logsPath: logsRootPath,
258+
crashesPath: crashesRootPath,
259259
videosPath: (recordVideo || opts.video) ? videoRootPath : undefined,
260260
verbose: opts.verbose,
261261
remote: opts.remote,
262262
web: opts.web,
263-
tracing: opts.tracing,
263+
tracing: true,
264264
headless: opts.headless,
265265
browser: opts.browser,
266266
extraArgs: (opts.electronArgs || '').split(' ').map(arg => arg.trim()).filter(arg => !!arg),

test/mcp/src/automationTools/core.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export function applyCoreTools(server: McpServer, appService: ApplicationService
3737
'Stop the VS Code application',
3838
async () => {
3939
const app = await appService.getOrCreateApplication();
40+
await app.stopTracing('mcp', true);
4041
await app.stop();
4142
return {
4243
content: [{

test/mcp/src/playwright.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export async function getServer(app?: Application): Promise<Server> {
1212
const application = app ?? await getApplication();
1313
const connection = await createConnection(
1414
{
15-
capabilities: ['core', 'pdf', 'vision']
15+
capabilities: ['core', 'pdf', 'vision'],
16+
saveTrace: true
1617
},
1718
// eslint-disable-next-line local/code-no-any-casts
1819
() => Promise.resolve(application.code.driver.browserContext as any)

0 commit comments

Comments
 (0)