mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-27 00:52:27 +08:00
Fix linting issues and finalize save-session implementation
Co-authored-by: pavelfeldman <883973+pavelfeldman@users.noreply.github.com>
This commit is contained in:
parent
f00f78491a
commit
9588845cc3
@ -164,6 +164,8 @@ Playwright MCP server supports following arguments. They can be provided in the
|
||||
"http://myproxy:3128" or "socks5://myproxy:8080"
|
||||
--save-trace Whether to save the Playwright Trace of the
|
||||
session into the output directory.
|
||||
--save-session Whether to save the session log with tool calls
|
||||
and snapshots into the output directory.
|
||||
--storage-state <path> path to the storage state file for isolated
|
||||
sessions.
|
||||
--user-agent <ua string> specify user agent string
|
||||
|
@ -52,9 +52,8 @@ export class Context {
|
||||
this.config = config;
|
||||
this._browserContextFactory = browserContextFactory;
|
||||
testDebug('create context');
|
||||
if (this.config.saveSession) {
|
||||
if (this.config.saveSession)
|
||||
void this._initializeSessionFile();
|
||||
}
|
||||
}
|
||||
|
||||
clientSupportsImages(): boolean {
|
||||
@ -163,9 +162,8 @@ export class Context {
|
||||
}
|
||||
|
||||
// Add snapshot reference if provided
|
||||
if (snapshotFile) {
|
||||
if (snapshotFile)
|
||||
entry.push(` snapshot: ${path.basename(snapshotFile)}`);
|
||||
}
|
||||
|
||||
entry.push(''); // Empty line for readability
|
||||
|
||||
@ -214,9 +212,8 @@ export class Context {
|
||||
});
|
||||
|
||||
// Log session entry if enabled
|
||||
if (this.config.saveSession) {
|
||||
if (this.config.saveSession)
|
||||
await this._logSessionEntry(tool.schema.name, params || {}, snapshotFile);
|
||||
}
|
||||
|
||||
const result: string[] = [];
|
||||
result.push(`### Ran Playwright code
|
||||
|
Loading…
x
Reference in New Issue
Block a user