playwright 1.57.0-alpha-2025-10-12 → 1.57.0-alpha-2025-10-14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,7 +31,7 @@ class Response {
31
31
  this._result = [];
32
32
  this._code = [];
33
33
  this._images = [];
34
- this._includeSnapshot = false;
34
+ this._includeSnapshot = "none";
35
35
  this._includeTabs = false;
36
36
  this._context = context;
37
37
  this.toolName = toolName;
@@ -62,15 +62,15 @@ class Response {
62
62
  images() {
63
63
  return this._images;
64
64
  }
65
- setIncludeSnapshot() {
66
- this._includeSnapshot = true;
65
+ setIncludeSnapshot(full) {
66
+ this._includeSnapshot = full ?? "incremental";
67
67
  }
68
68
  setIncludeTabs() {
69
69
  this._includeTabs = true;
70
70
  }
71
71
  async finish() {
72
- if (this._includeSnapshot && this._context.currentTab())
73
- this._tabSnapshot = await this._context.currentTabOrDie().captureSnapshot();
72
+ if (this._includeSnapshot !== "none" && this._context.currentTab())
73
+ this._tabSnapshot = await this._context.currentTabOrDie().captureSnapshot(this._includeSnapshot);
74
74
  for (const tab of this._context.tabs())
75
75
  await tab.updateTitle();
76
76
  }
@@ -99,7 +99,7 @@ ${this._code.join("\n")}
99
99
  \`\`\``);
100
100
  response.push("");
101
101
  }
102
- if (this._includeSnapshot || this._includeTabs)
102
+ if (this._includeSnapshot !== "none" || this._includeTabs)
103
103
  response.push(...renderTabsMarkdown(this._context.tabs(), this._includeTabs));
104
104
  if (this._tabSnapshot?.modalStates.length) {
105
105
  response.push(...(0, import_tab.renderModalStates)(this._context, this._tabSnapshot.modalStates));
@@ -172,10 +172,10 @@ class Tab extends import_events.EventEmitter {
172
172
  await this._initializedPromise;
173
173
  return this._requests;
174
174
  }
175
- async captureSnapshot() {
175
+ async captureSnapshot(mode) {
176
176
  let tabSnapshot;
177
177
  const modalStates = await this._raceAgainstModalStates(async () => {
178
- const snapshot = await this.page._snapshotForAI();
178
+ const snapshot = await this.page._snapshotForAI({ mode, track: "response" });
179
179
  tabSnapshot = {
180
180
  url: this.page.url(),
181
181
  title: await this.page.title(),
@@ -46,7 +46,7 @@ const snapshot = (0, import_tool.defineTool)({
46
46
  },
47
47
  handle: async (context, params, response) => {
48
48
  await context.ensureTab();
49
- response.setIncludeSnapshot();
49
+ response.setIncludeSnapshot("full");
50
50
  }
51
51
  });
52
52
  const elementSchema = import_bundle.z.object({
@@ -49,14 +49,14 @@ const browserTabs = (0, import_tool.defineTool)({
49
49
  }
50
50
  case "close": {
51
51
  await context.closeTab(params.index);
52
- response.setIncludeSnapshot();
52
+ response.setIncludeSnapshot("full");
53
53
  return;
54
54
  }
55
55
  case "select": {
56
56
  if (params.index === void 0)
57
57
  throw new Error("Tab index is required");
58
58
  await context.selectTab(params.index);
59
- response.setIncludeSnapshot();
59
+ response.setIncludeSnapshot("full");
60
60
  return;
61
61
  }
62
62
  }
@@ -107,11 +107,17 @@ class TestInfoImpl {
107
107
  return import_path.default.join(this.project.snapshotDir, relativeTestFilePath + "-snapshots");
108
108
  })();
109
109
  this._attachmentsPush = this.attachments.push.bind(this.attachments);
110
- this.attachments.push = (...attachments) => {
110
+ const attachmentsPush = (...attachments) => {
111
111
  for (const a of attachments)
112
112
  this._attach(a, this._parentStep()?.stepId);
113
113
  return this.attachments.length;
114
114
  };
115
+ Object.defineProperty(this.attachments, "push", {
116
+ value: attachmentsPush,
117
+ writable: true,
118
+ enumerable: false,
119
+ configurable: true
120
+ });
115
121
  this._tracing = new import_testTracing.TestTracing(this, workerParams.artifactsDir);
116
122
  this.skip = (0, import_transform.wrapFunctionWithLocation)((location, ...args) => this._modifier("skip", location, args));
117
123
  this.fixme = (0, import_transform.wrapFunctionWithLocation)((location, ...args) => this._modifier("fixme", location, args));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright",
3
- "version": "1.57.0-alpha-2025-10-12",
3
+ "version": "1.57.0-alpha-2025-10-14",
4
4
  "description": "A high-level API to automate web browsers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "license": "Apache-2.0",
66
66
  "dependencies": {
67
- "playwright-core": "1.57.0-alpha-2025-10-12"
67
+ "playwright-core": "1.57.0-alpha-2025-10-14"
68
68
  },
69
69
  "optionalDependencies": {
70
70
  "fsevents": "2.3.2"