@tontoko/fast-playwright-mcp 0.1.2 → 0.1.3
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.
- package/lib/tab.js +3 -3
- package/lib/tools/shared-element-utils.js +2 -1
- package/package.json +4 -4
package/lib/tab.js
CHANGED
|
@@ -227,12 +227,12 @@ class Tab extends EventEmitter {
|
|
|
227
227
|
async _captureSnapshotInternal(selector, maxLength) {
|
|
228
228
|
let tabSnapshot;
|
|
229
229
|
const modalStates = await this._raceAgainstModalStates(async () => {
|
|
230
|
+
const result = await this.page._snapshotForAI();
|
|
230
231
|
let snapshot;
|
|
231
232
|
if (selector) {
|
|
232
|
-
|
|
233
|
-
snapshot = this._extractPartialSnapshot(fullSnapshot, selector);
|
|
233
|
+
snapshot = this._extractPartialSnapshot(result.full, selector);
|
|
234
234
|
} else {
|
|
235
|
-
snapshot =
|
|
235
|
+
snapshot = result.full;
|
|
236
236
|
}
|
|
237
237
|
if (maxLength && snapshot.length > maxLength) {
|
|
238
238
|
snapshot = this._truncateAtWordBoundary(snapshot, maxLength);
|
|
@@ -29,7 +29,8 @@ async function resolveFirstElement(tab, selectors, errorMessage = "Failed to res
|
|
|
29
29
|
}
|
|
30
30
|
async function handleSnapshotExpectation(tab, expectation, response) {
|
|
31
31
|
if (expectation?.includeSnapshot) {
|
|
32
|
-
const
|
|
32
|
+
const { selector, maxLength } = expectation.snapshotOptions ?? {};
|
|
33
|
+
const newSnapshot = selector || maxLength ? await tab.capturePartialSnapshot(selector, maxLength) : await tab.captureSnapshot();
|
|
33
34
|
response.setTabSnapshot(newSnapshot);
|
|
34
35
|
}
|
|
35
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tontoko/fast-playwright-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"dotenv": "^17.2.0",
|
|
52
52
|
"fast-diff": "^1.3.0",
|
|
53
53
|
"mime": "^4.0.7",
|
|
54
|
-
"playwright": "1.
|
|
55
|
-
"playwright-core": "1.
|
|
54
|
+
"playwright": "1.58.0-alpha-1766189059000",
|
|
55
|
+
"playwright-core": "1.58.0-alpha-1766189059000",
|
|
56
56
|
"sharp": "^0.34.3",
|
|
57
57
|
"ws": "^8.18.1",
|
|
58
58
|
"zod": "^3.24.1",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@anthropic-ai/sdk": "^0.57.0",
|
|
63
63
|
"@biomejs/biome": "2.1.2",
|
|
64
|
-
"@playwright/test": "1.
|
|
64
|
+
"@playwright/test": "1.58.0-alpha-1766189059000",
|
|
65
65
|
"@types/debug": "^4.1.12",
|
|
66
66
|
"@types/node": "^22.13.10",
|
|
67
67
|
"@types/ws": "^8.18.1",
|