@cutleryapp/agent 1.0.11 → 1.0.13
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/dist/mcp-executor.js +14 -18
- package/package.json +1 -1
package/dist/mcp-executor.js
CHANGED
|
@@ -92,26 +92,22 @@ class TestExecutor {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
else if (lower.includes("fill") || lower.includes("type") || lower.includes("enter")) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
// label can match placeholder/aria/data-test/label etc.
|
|
95
|
+
// Support both quoted and unquoted formats:
|
|
96
|
+
// Fill "standard_user" in "Username"
|
|
97
|
+
// Fill standard_user in Username field
|
|
98
|
+
// Split on first " in " / " into " to separate value from field
|
|
99
|
+
const match = raw.match(/(?:enter|fill|type)\s+"([^"]+)"\s+(?:in|into)\s+(?:the\s+)?"?([^"]+?)"?\s*(?:field|input|box|area)?\s*$/i) ||
|
|
100
|
+
raw.match(/(?:enter|fill|type)\s+(\S+)\s+(?:in|into)\s+(?:the\s+)?(.+?)\s*(?:field|input|box|area)?\s*$/i);
|
|
101
|
+
if (match) {
|
|
102
|
+
const value = match[1].trim();
|
|
103
|
+
const fieldLabel = match[2].trim();
|
|
105
104
|
const looksLikeCss = (s) => /[#.\[\]:>]/.test(s);
|
|
106
|
-
if (
|
|
107
|
-
await page.waitForSelector(
|
|
108
|
-
await page.fill(
|
|
105
|
+
if (looksLikeCss(fieldLabel)) {
|
|
106
|
+
await page.waitForSelector(fieldLabel, { state: "visible", timeout: 5000 });
|
|
107
|
+
await page.fill(fieldLabel, value);
|
|
109
108
|
}
|
|
110
|
-
else
|
|
111
|
-
await tryFill(page,
|
|
112
|
-
}
|
|
113
|
-
else if (bareLabel) {
|
|
114
|
-
await tryFill(page, bareLabel.trim(), value);
|
|
109
|
+
else {
|
|
110
|
+
await tryFill(page, fieldLabel, value);
|
|
115
111
|
}
|
|
116
112
|
}
|
|
117
113
|
}
|