ff-automationv2 2.2.29 → 2.2.30
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/ai/llmcalls/llmAction.js +49 -13
- package/dist/ai/llmcalls/parseLlmOputput.js +5 -5
- package/dist/ai/llmprompts/promptRegistry.js +4 -0
- package/dist/ai/llmprompts/systemPrompts/actionExtractorPrompt.js +39 -11
- package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtactors.js +6 -6
- package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtractor_Mob.js +32 -0
- package/dist/ai/llmprompts/systemPrompts/mobileKeywordExtractor.js +17 -8
- package/dist/ai/llmprompts/systemPrompts/otpExtractorPrompt.d.ts +1 -0
- package/dist/ai/llmprompts/systemPrompts/otpExtractorPrompt.js +22 -0
- package/dist/ai/llmprompts/systemPrompts/verifyActionExtractorPrompt.js +3 -1
- package/dist/ai/llmprompts/systemPrompts/visionPrompt.js +14 -6
- package/dist/ai/llmprompts/systemPrompts/visionPromptMobile.js +3 -0
- package/dist/ai/llmprompts/userPrompts/userPrompt.js +1 -0
- package/dist/automation/actions/executor.d.ts +4 -0
- package/dist/automation/actions/executor.js +20 -0
- package/dist/automation/actions/interaction/clear/clear.js +1 -1
- package/dist/automation/actions/interaction/clear/clearAndEnter.js +1 -1
- package/dist/automation/actions/interaction/click/click.js +10 -3
- package/dist/automation/actions/interaction/click/clickNtimes.js +1 -1
- package/dist/automation/actions/interaction/click/doubleClick.js +1 -1
- package/dist/automation/actions/interaction/click/rightClick.js +1 -1
- package/dist/automation/actions/interaction/elementlessActions/getOtp.d.ts +2 -0
- package/dist/automation/actions/interaction/elementlessActions/getOtp.js +101 -0
- package/dist/automation/actions/interaction/enterActions/enterInput.js +11 -6
- package/dist/automation/actions/interaction/enterActions/enterInputAndPress.js +2 -2
- package/dist/automation/actions/interaction/enterActions/enterusingJs.js +2 -2
- package/dist/automation/actions/interaction/enterActions/waitAndEnter.js +1 -1
- package/dist/automation/actions/interaction/upload/uploadfile.js +1 -1
- package/dist/automation/actions/interaction/verify/VerifyNavigateURL.js +38 -11
- package/dist/automation/actions/interface/FireFlinkResponseSchema.d.ts +12 -0
- package/dist/automation/actions/interface/FireFlinkResponseSchema.js +19 -3
- package/dist/automation/actions/interface/getOtpInterface.d.ts +15 -0
- package/dist/automation/actions/interface/getOtpInterface.js +2 -0
- package/dist/automation/browserSession/initiateBrowserSession.d.ts +1 -1
- package/dist/automation/browserSession/initiateBrowserSession.js +15 -7
- package/dist/automation/driverState.d.ts +2 -0
- package/dist/automation/driverState.js +4 -0
- package/dist/automation/mobileSession/initiateMobileSession.d.ts +4 -5
- package/dist/automation/mobileSession/initiateMobileSession.js +83 -19
- package/dist/core/constants/allAction.js +5 -1
- package/dist/core/constants/supportedActions.js +5 -2
- package/dist/core/interfaces/actionInterface.d.ts +4 -0
- package/dist/core/interfaces/browserConfigurationInterface.d.ts +0 -4
- package/dist/core/interfaces/browserConfigurationInterface.js +0 -1
- package/dist/core/interfaces/executionDetails.d.ts +6 -3
- package/dist/core/interfaces/fireflinkScriptPayloadInterface.d.ts +22 -16
- package/dist/core/interfaces/llmResponseInterface.d.ts +1 -0
- package/dist/core/interfaces/promptInterface.d.ts +1 -0
- package/dist/core/main/SessionManager.d.ts +9 -0
- package/dist/core/main/SessionManager.js +23 -0
- package/dist/core/main/actionHandlerFactory.js +261 -64
- package/dist/core/main/executionContext.d.ts +7 -1
- package/dist/core/main/executionContext.js +93 -3
- package/dist/core/main/runAutomationScript.d.ts +1 -0
- package/dist/core/main/runAutomationScript.js +912 -304
- package/dist/core/main/stepProcessor.js +7 -2
- package/dist/core/types/browserType.d.ts +3 -3
- package/dist/core/types/browserType.js +2 -2
- package/dist/core/types/messageType.d.ts +13 -0
- package/dist/core/types/messageType.js +15 -0
- package/dist/core/types/promptType.d.ts +2 -1
- package/dist/core/types/promptType.js +1 -0
- package/dist/domAnalysis/searchBest.js +15 -16
- package/dist/domAnalysis/simplifyAndFlatten.js +6 -4
- package/dist/fireflinkData/fireflinkLocators/getListOfLocators.d.ts +3 -0
- package/dist/fireflinkData/fireflinkLocators/getListOfLocators.js +23 -15
- package/dist/fireflinkData/fireflinkLocators/parser/getElementsFromHTML.d.ts +3 -3
- package/dist/fireflinkData/fireflinkLocators/parser/getElementsFromHTML.js +134 -118
- package/dist/fireflinkData/fireflinkLocators/types/locator.d.ts +11 -1
- package/dist/fireflinkData/fireflinkLocators/utils/androidSelector.d.ts +1 -1
- package/dist/fireflinkData/fireflinkLocators/utils/androidSelector.js +35 -9
- package/dist/fireflinkData/fireflinkLocators/utils/cssSelector.d.ts +10 -10
- package/dist/fireflinkData/fireflinkLocators/utils/cssSelector.js +56 -59
- package/dist/fireflinkData/fireflinkLocators/utils/iosSelector.d.ts +1 -1
- package/dist/fireflinkData/fireflinkLocators/utils/iosSelector.js +53 -29
- package/dist/fireflinkData/fireflinkLocators/utils/referenceXpath.d.ts +8 -8
- package/dist/fireflinkData/fireflinkLocators/utils/referenceXpath.js +113 -190
- package/dist/fireflinkData/fireflinkLocators/utils/xpath.d.ts +17 -26
- package/dist/fireflinkData/fireflinkLocators/utils/xpath.js +314 -786
- package/dist/fireflinkData/fireflinkLocators/utils/xpathHelpers.d.ts +68 -70
- package/dist/fireflinkData/fireflinkLocators/utils/xpathHelpers.js +498 -517
- package/dist/fireflinkData/fireflinkScript/appendScriptData.d.ts +1 -1
- package/dist/fireflinkData/fireflinkScript/appendScriptData.js +5 -8
- package/dist/fireflinkData/fireflinkScript/scriptGenrationData.d.ts +2 -2
- package/dist/fireflinkData/fireflinkScript/scriptGenrationData.js +17 -27
- package/dist/llmConfig/llmConfiguration.js +13 -6
- package/dist/service/api/fireflinkApi.service.d.ts +1 -1
- package/dist/service/api/fireflinkApi.service.js +1 -2
- package/dist/service/fireflink.service.d.ts +3 -3
- package/dist/service/fireflink.service.js +23 -21
- package/dist/service/kafka/fireflinkKafka.service.d.ts +1 -2
- package/dist/service/kafka/fireflinkKafka.service.js +6 -4
- package/dist/tests/test12.d.ts +0 -1
- package/dist/tests/test12.js +65 -78
- package/dist/tests/testkaf.d.ts +0 -1
- package/dist/tests/testkaf.js +51 -55
- package/dist/utils/InstancesDetails/getInstancesInfo.js +1 -1
- package/dist/utils/browserCap/capability.d.ts +5 -1
- package/dist/utils/browserCap/capability.js +91 -15
- package/dist/utils/helpers/domSanitizer.d.ts +1 -0
- package/dist/utils/helpers/domSanitizer.js +9 -0
- package/dist/utils/helpers/enterActionHelper.js +23 -4
- package/dist/utils/helpers/xpathcreation.js +2 -2
- package/dist/utils/javascript/jsFindElement.d.ts +1 -1
- package/dist/utils/javascript/jsFindElement.js +2 -2
- package/dist/utils/newTab/newTabTracker.js +18 -6
- package/dist/utils/workers/LocatorWorkerInterface.d.ts +22 -0
- package/dist/utils/workers/LocatorWorkerInterface.js +2 -0
- package/dist/utils/workers/LocatorWorkerPool.d.ts +13 -0
- package/dist/utils/workers/LocatorWorkerPool.js +89 -0
- package/dist/utils/workers/locatorWorker.d.ts +1 -0
- package/dist/utils/workers/locatorWorker.js +44 -0
- package/package.json +3 -1
|
@@ -44,11 +44,18 @@ class llmAction {
|
|
|
44
44
|
const MAX_RETRIES = 5;
|
|
45
45
|
const startTime = new Date().getTime();
|
|
46
46
|
const schemaToUse = (0, FireFlinkResponseSchema_js_1.getSchemaForPrompt)(type, platform, args);
|
|
47
|
+
let modelInstance;
|
|
48
|
+
if (this.serviceProvider === "Groq" || this.serviceProvider === "DefaultFireFlink") {
|
|
49
|
+
modelInstance = this.provider.responses(this.model);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
modelInstance = this.provider(this.model);
|
|
53
|
+
}
|
|
47
54
|
while (attempt < MAX_RETRIES) {
|
|
48
55
|
attempt++;
|
|
49
56
|
try {
|
|
50
57
|
const response = await (0, ai_1.generateText)({
|
|
51
|
-
model:
|
|
58
|
+
model: modelInstance,
|
|
52
59
|
messages: [
|
|
53
60
|
{ role: "system", content: system },
|
|
54
61
|
{ role: "user", content: user },
|
|
@@ -58,8 +65,7 @@ class llmAction {
|
|
|
58
65
|
}),
|
|
59
66
|
providerOptions: this.getProviderOptions()
|
|
60
67
|
});
|
|
61
|
-
const
|
|
62
|
-
const parsedContent = rawText;
|
|
68
|
+
const parsedContent = response.output;
|
|
63
69
|
logData_js_1.logger.info(`LLM Attempt ${attempt} - Raw Response:`, parsedContent);
|
|
64
70
|
if (this.isInvalidLLMOutput(parsedContent)) {
|
|
65
71
|
logData_js_1.logger.error(`Invalid LLM output. Retrying (${attempt})`);
|
|
@@ -73,6 +79,9 @@ class llmAction {
|
|
|
73
79
|
}
|
|
74
80
|
catch (error) {
|
|
75
81
|
logData_js_1.logger.error(`LLM Error Attempt ${attempt}:`, error);
|
|
82
|
+
if (attempt < MAX_RETRIES) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
76
85
|
logData_js_1.logger.error(`Cause is ${error.cause}`, error.cause);
|
|
77
86
|
if (ai_1.NoObjectGeneratedError.isInstance(error) && error.text) {
|
|
78
87
|
try {
|
|
@@ -201,27 +210,42 @@ class llmAction {
|
|
|
201
210
|
return false;
|
|
202
211
|
}
|
|
203
212
|
handleKnownErrors(error) {
|
|
204
|
-
if (error?.
|
|
213
|
+
if (error?.lastError?.statusCode === 429) {
|
|
205
214
|
return {
|
|
206
215
|
error: "Rate Limit Exceeded (429)",
|
|
207
|
-
errorDescription: "
|
|
216
|
+
errorDescription: "Service has exceeded the API quota or rate limit for the selected AI model. \n This is common with free or low-tier API plans \n Please wait a moment before retrying or check your API usage limits.",
|
|
208
217
|
rawError: "Rate limit reached for model. HTTP 429 returned by model"
|
|
209
218
|
};
|
|
210
219
|
}
|
|
211
|
-
if (error?.
|
|
220
|
+
else if (error?.statusCode === 400 &&
|
|
212
221
|
error?.error?.message?.toLowerCase().includes("context")) {
|
|
213
222
|
return {
|
|
214
223
|
error: "Context Length Exceeded (400)",
|
|
215
|
-
errorDescription: "
|
|
224
|
+
errorDescription: "Service could not process the request because the input exceeds the maximum context length supported by the selected AI model.\nThis typically happens when the input is very long",
|
|
216
225
|
rawError: "This model's maximum context length has been exceeded. HTTP 400 returned by model"
|
|
217
226
|
};
|
|
218
227
|
}
|
|
228
|
+
else if (error?.statusCode === 401 &&
|
|
229
|
+
error?.error?.message?.toLowerCase().includes("Incorrect api key")) {
|
|
230
|
+
return {
|
|
231
|
+
error: "Invalid API key",
|
|
232
|
+
errorDescription: "Service could not process the request because the API key is invalid. Please check your API key and try again.",
|
|
233
|
+
rawError: "Invalid API key"
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
else if (error?.statusCode !== 200) {
|
|
237
|
+
return {
|
|
238
|
+
error: error.message,
|
|
239
|
+
errorDescription: "Service has can't process the request. Because of service Provider internal error",
|
|
240
|
+
rawError: error,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
219
243
|
return null;
|
|
220
244
|
}
|
|
221
245
|
buildRetryFailure() {
|
|
222
246
|
return {
|
|
223
247
|
error: "LLM Empty Response After Retry",
|
|
224
|
-
errorDescription: "
|
|
248
|
+
errorDescription: "Service attempted multiple times but received empty or invalid responses.",
|
|
225
249
|
rawError: "Max retry limit reached",
|
|
226
250
|
};
|
|
227
251
|
}
|
|
@@ -243,11 +267,23 @@ class llmAction {
|
|
|
243
267
|
},
|
|
244
268
|
};
|
|
245
269
|
case "Anthropic":
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
270
|
+
if (this.model.startsWith("claude-haiku")) {
|
|
271
|
+
return {
|
|
272
|
+
anthropic: {
|
|
273
|
+
thinking: {
|
|
274
|
+
type: "enabled",
|
|
275
|
+
budgetTokens: 1024
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
return {
|
|
282
|
+
anthropic: {
|
|
283
|
+
effort: "low",
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
}
|
|
251
287
|
case "Gemini":
|
|
252
288
|
if (this.model.startsWith("gemini-2")) {
|
|
253
289
|
return {
|
|
@@ -15,7 +15,7 @@ class LLMResultParser {
|
|
|
15
15
|
return JSON.parse(match[0]);
|
|
16
16
|
}
|
|
17
17
|
async fetchResult(llmOutput) {
|
|
18
|
-
if (
|
|
18
|
+
if (llmOutput?.error) {
|
|
19
19
|
throw llmOutput;
|
|
20
20
|
}
|
|
21
21
|
try {
|
|
@@ -45,10 +45,10 @@ class LLMResultParser {
|
|
|
45
45
|
}
|
|
46
46
|
parsedContent = content;
|
|
47
47
|
}
|
|
48
|
-
const usage = llmOutput?.
|
|
49
|
-
this.inputTokens += Number(usage.
|
|
50
|
-
this.outputTokens += Number(usage.
|
|
51
|
-
this.totalTokens += Number(usage.
|
|
48
|
+
const usage = llmOutput?.totalUsage ?? {};
|
|
49
|
+
this.inputTokens += Number(usage.inputTokens ?? 0);
|
|
50
|
+
this.outputTokens += Number(usage.outputTokens ?? 0);
|
|
51
|
+
this.totalTokens += Number(usage.totalTokens ?? 0);
|
|
52
52
|
// logger.info(`tokens : ${usage.output_tokens} + ${usage.input_tokens} = ${usage.total_tokens}`);
|
|
53
53
|
// logger.info(`Total tokens for this call is : ${usage.total_tokens}`);
|
|
54
54
|
return { response: parsedContent };
|
|
@@ -17,6 +17,7 @@ const combinedActionExtractorPromptMob_js_1 = require("./systemPrompts/combinedA
|
|
|
17
17
|
const waitActionExtractorPromptMob_js_1 = require("./systemPrompts/waitActionExtractorPromptMob.js");
|
|
18
18
|
const waitActionExtractorPrompt_js_1 = require("./systemPrompts/waitActionExtractorPrompt.js");
|
|
19
19
|
const combinedActionExtractorPrompt_js_1 = require("./systemPrompts/combinedActionExtractorPrompt.js");
|
|
20
|
+
const otpExtractorPrompt_js_1 = require("./systemPrompts/otpExtractorPrompt.js");
|
|
20
21
|
exports.prompts = {
|
|
21
22
|
web: {
|
|
22
23
|
userStoryToList: userStoryToListPrompt_js_1.buildStepExtractionPrompt,
|
|
@@ -28,6 +29,7 @@ exports.prompts = {
|
|
|
28
29
|
getActionExtractorPrompt: getActionExtractorPrompt_js_1.getActionExtractorPrompt,
|
|
29
30
|
combinedActionExtractorPrompt: combinedActionExtractorPrompt_js_1.combinedActionExtractorPrompt,
|
|
30
31
|
waitActionExtractorPrompt: waitActionExtractorPrompt_js_1.waitActionExtractorPrompt,
|
|
32
|
+
otpExtractorPrompt: otpExtractorPrompt_js_1.otpExtractorPrompt,
|
|
31
33
|
},
|
|
32
34
|
android: {
|
|
33
35
|
userStoryToList: userStoryToListPrompt_js_1.androidbuildStepExtractionPrompt,
|
|
@@ -39,6 +41,7 @@ exports.prompts = {
|
|
|
39
41
|
getActionExtractorPrompt: getActionExtractorPromptMob_js_1.getActionExtractorPromptMob,
|
|
40
42
|
combinedActionExtractorPrompt: combinedActionExtractorPromptMob_js_1.combinedActionExtractorPromptMob,
|
|
41
43
|
waitActionExtractorPrompt: waitActionExtractorPromptMob_js_1.waitActionExtractorPromptMob,
|
|
44
|
+
otpExtractorPrompt: otpExtractorPrompt_js_1.otpExtractorPrompt,
|
|
42
45
|
},
|
|
43
46
|
ios: {
|
|
44
47
|
userStoryToList: userStoryToListPrompt_js_1.androidbuildStepExtractionPrompt,
|
|
@@ -50,5 +53,6 @@ exports.prompts = {
|
|
|
50
53
|
getActionExtractorPrompt: getActionExtractorPromptMob_js_1.getActionExtractorPromptMob,
|
|
51
54
|
combinedActionExtractorPrompt: combinedActionExtractorPromptMob_js_1.combinedActionExtractorPromptMob,
|
|
52
55
|
waitActionExtractorPrompt: waitActionExtractorPromptMob_js_1.waitActionExtractorPromptMob,
|
|
56
|
+
otpExtractorPrompt: otpExtractorPrompt_js_1.otpExtractorPrompt,
|
|
53
57
|
}
|
|
54
58
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.keywordExtractor = keywordExtractor;
|
|
4
4
|
async function keywordExtractor({ priorAndNextSteps }) {
|
|
5
|
-
const allowedActions = ["enter", "wait", "verify", "scroll", "navigate", "navigateBack", "click", "maximize", "minimize", "get", "upload", "close", "open", "drag_and_drop", "switch", "cleartext", "notwebopenaction", "mouseAction"];
|
|
5
|
+
const allowedActions = ["enter", "refresh", "wait", "verify", "scroll", "navigate", "navigateBack", "click", "maximize", "minimize", "get", "upload", "close", "open", "drag_and_drop", "switch", "cleartext", "notwebopenaction", "mouseAction", "switchToAndroid", "getOtp", "enterOtp"];
|
|
6
6
|
const prompt = `
|
|
7
7
|
You are an expert in Web application testing.
|
|
8
8
|
From the step, extract ONLY the meaningful keywords so that i can search for the element in the dom.
|
|
@@ -10,18 +10,44 @@ You are an expert in Web application testing.
|
|
|
10
10
|
- Only give response for the current step.
|
|
11
11
|
- understand the step and context from the ${JSON.stringify(priorAndNextSteps)}.and keywords should be from step. it should not be related to other steps.
|
|
12
12
|
- Keywords must represent ONLY the element label or visible text, never add action or instruction words in keywords.
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
- Element name + type keywords: strip action words, leaving the core element name and any
|
|
14
|
+
type word(s) attached to it (icon, button, dropdown, filter, tab, field, etc., in the order
|
|
15
|
+
they appear in the step). Build keywords as a growing chain starting from the core name and
|
|
16
|
+
adding one more type word each time: [name], [name+type1], [name+type1+type2], ...
|
|
17
|
+
The core name alone is ALWAYS keyword 1 — never drop it, no matter how many type words follow.
|
|
18
|
+
Treat "input field", "text field", "search box", "check box", "drop down" as ONE type word,
|
|
19
|
+
not two.
|
|
20
|
+
No type word in the step → only [name] as the keyword.
|
|
21
|
+
Example: "click X filter dropdown" → ["X", "X filter", "X filter dropdown"]
|
|
22
|
+
- When a step contains two elements connected by a positional or relational phrase, keywords MUST contain at least one keyword from each element — TARGET element first, then the reference element. Never omit the reference element. Example: "Click on x above y" → x is the target, y is the reference → ["x", "y"].
|
|
18
23
|
- 3 to 5 keywords maximum. dont give more than 5 keywords. and no need for casesensitive.
|
|
24
|
+
- General ordering rule: whenever a step involves both a target element and a reference/context element, the TARGET element's keyword(s) must always come FIRST, followed by the reference/context element's keyword(s). This applies to positional/relational steps, selection steps, and any other multi-element step.
|
|
25
|
+
- For the open action if they are not provided anything like profile, capablities in the step in that case don't add them check whether the profile and the capablities are present in the step if not please don't add them.
|
|
19
26
|
- For the Open action, if a browser path and profile are provided, return keywords as ["path:<path_value>", "profile:<profile_value>"]. Should not remove backslach from path.
|
|
20
27
|
example: step open browser,x:\\x\\x\\x,default -> ["path:c:\\x\\x\\x","profile:default"]
|
|
21
|
-
-
|
|
28
|
+
- For the Open action, if the user requests specific browser capabilities/arguments, extract them into the keywords array using the "caps:" prefix followed by one of these exact allowed values:
|
|
29
|
+
- "headless" (for running in headless / no-gui mode)
|
|
30
|
+
- "incognito" (for private / incognito mode)
|
|
31
|
+
- "ignoreCertificates" (for ignoring SSL/certificate errors)
|
|
32
|
+
- "startMaximized" (for starting maximized)
|
|
33
|
+
- "disableGpu" (for disabling hardware/GPU acceleration)
|
|
34
|
+
- "disableNotifications" (for blocking push notifications)
|
|
35
|
+
- "disableExtensions" (for disabling browser extensions)
|
|
36
|
+
- "disablePopups" (for disabling popup blocking)
|
|
37
|
+
- "muteAudio" (for muting browser audio)
|
|
38
|
+
- "noSandbox" (for disabling sandbox)
|
|
39
|
+
- "disableWebSecurity" (for disabling web security, CORS, or same-origin policy checks)
|
|
40
|
+
- "disableLocalNetwork" (for disabling WebRTC local IP discovery or local network access constraints)
|
|
41
|
+
- "geolocation" (for blocking or allowing geolocation access)
|
|
42
|
+
- "camera" (for blocking or allowing camera access)
|
|
43
|
+
- "microphone" (for blocking or allowing microphone access)
|
|
44
|
+
- "passwordManager" (for disabling credentials and password manager prompts)
|
|
45
|
+
Do NOT extract or generate any capability strings outside of this list.
|
|
46
|
+
- Do NOT split the keyword into individual words or generate variations such as ["sign", "in"] or ["add", "to", "cart"] for ["Sign In","Add to Cart"]. Only include the original phrase should not add type for first keyword.
|
|
22
47
|
- If icon is metioned in step than 'svg' should add in keywords and for Upload action first keyword should be 'file'.
|
|
23
|
-
- If step is about selecting, include keywords for both the
|
|
48
|
+
- If the step is about selecting, include keywords for both the target value and the source/reference, with the TARGET value FIRST and the source/reference SECOND (example: select 'x' in 'y' → "x", "y"), ensuring both are meaningful and action should set to 'click'.
|
|
24
49
|
- If the step is about entering text or Uploading file, Should NOT include input value from the step into keywords.
|
|
50
|
+
- If the step is about entering the OTP then give the action as the enterOtp, just only for the entering OTP only.
|
|
25
51
|
- If the step has words like tag name audio, video, image,svg, checkbox etc, include them in the keywords.
|
|
26
52
|
- **If icon is metioned in step than 'svg' should add in keywords ex: click on x icon -> [x, x icon,svg] and for Upload action first keyword should be 'file'. ex: upload file in x -> [file,x].**
|
|
27
53
|
- Do NOT split single-word keywords and do NOT include relation terms (above, below, next to, etc.) in keywords.
|
|
@@ -30,9 +56,10 @@ You are an expert in Web application testing.
|
|
|
30
56
|
- Do Not include any other unrelated keywords for step.
|
|
31
57
|
- Do NOT include generic UI words (button, field, etc) and action words (tap, click, press, etc).
|
|
32
58
|
- Do NOT include status/technical words (displayed, enabled, authenticate, visible).
|
|
59
|
+
- If the step is for the switching to android then provide the action as the switchToAndroid
|
|
33
60
|
- element_name: extract name of the element that mentioned in the the step.(eg:tap on x -> element_name:x) keep element_name as short as possible and make the first letter of first word of the element_name as capital. beacuse element_name is also used to find element in the dom. and if element_name is not mentioned in step than return action of the step as element_name.
|
|
34
|
-
- Set action to notwebopenaction only when the instruction is related to a
|
|
35
|
-
- action: click for taping, clicking or selecting, enter for entering input, wait for waiting or sleeping,scroll for scrolling and swiping, navigate for navigating to page using url, navigateBack for navigateing back to previous page, get for getting,fetching element,maximize for maximizing browser window, close for closing browser window,open for opening browser window, upload for uploading file using path, drag_and_drop for dragging and dropping element, switch is for switching to tab or window or frame,cleartext for clearing or removing text from element, mouseAction for the action related mouse actions even for mouse click.
|
|
61
|
+
- Set action to notwebopenaction only when the instruction is related to a mobile application, app, application, installed package, or bundle .
|
|
62
|
+
- action: click for taping, clicking or selecting, enter for entering input, wait for waiting or sleeping,scroll for scrolling and swiping, navigate for navigating to page using url, navigateBack for navigateing back to previous page, get for getting,fetching element,maximize for maximizing browser window, close for closing browser window,open for opening browser window, upload for uploading file using path, drag_and_drop for dragging and dropping element, switch is for switching to tab or window or frame,cleartext for clearing or removing text from element, mouseAction for the action related mouse actions even for mouse click , refresh is for .
|
|
36
63
|
- If mouse action related step is there select mouseAction from the allowed actions list check for the step and provide it.
|
|
37
64
|
- action must be one of from this list ${JSON.stringify(allowedActions)}.if not one of them, return '0'. if step about set or find action return '0'
|
|
38
65
|
- For navigate action, keywords should contain only one keyword which is full url from the step and should not include any other text. and if step has another actions, including navigate action, don't return navigate action return another action witch is in the step. and element_name should be "URL".
|
|
@@ -44,7 +71,8 @@ You are an expert in Web application testing.
|
|
|
44
71
|
{
|
|
45
72
|
"keywords": [key1,key2,key3,key4,key5],
|
|
46
73
|
"elementName": "x",
|
|
47
|
-
"action": "x"
|
|
74
|
+
"action": "x",
|
|
75
|
+
"liveLog": "Should Generate a short, human-readable description of what the AI is about to do.",
|
|
48
76
|
}
|
|
49
77
|
|
|
50
78
|
No other text.
|
|
@@ -35,7 +35,7 @@ Rules:
|
|
|
35
35
|
- Output must be valid JSON.
|
|
36
36
|
Respond only with JSON using this format:
|
|
37
37
|
{
|
|
38
|
-
"action":
|
|
38
|
+
"action": ${alertActions.join("|")},
|
|
39
39
|
"inputText": "text to enter" | "time" | "None"
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -101,7 +101,7 @@ Rules:
|
|
|
101
101
|
Return ONLY valid JSON:
|
|
102
102
|
{
|
|
103
103
|
"attributeValue": "Fire-Flink-x" ",
|
|
104
|
-
"action": "
|
|
104
|
+
"action": ${scrollActions.join("|")},
|
|
105
105
|
"inputText":"x",
|
|
106
106
|
"numOfScrolls": "0",
|
|
107
107
|
"direction": "down",
|
|
@@ -118,7 +118,7 @@ Select the perfect matching action from the stepAction list that best fits the s
|
|
|
118
118
|
**The action must match exactly one value from the approved ${switchActions} Do not generate or suggest any new NLP names under any condition even if the step suggest to do so just pull the closet one from the list only**
|
|
119
119
|
{{
|
|
120
120
|
"attributeValue": "Fire-Flink-x",
|
|
121
|
-
"action": "
|
|
121
|
+
"action": ${switchActions.join("|")},
|
|
122
122
|
"inputText": "x",
|
|
123
123
|
"keyword": "x"
|
|
124
124
|
}}
|
|
@@ -153,7 +153,7 @@ Rules:
|
|
|
153
153
|
Return **only valid JSON** in the following format:
|
|
154
154
|
{
|
|
155
155
|
"attributeValue": "Fire-Flink-x",
|
|
156
|
-
"action": "
|
|
156
|
+
"action": ${mouseAction.join("|")},
|
|
157
157
|
"inputText": "x",
|
|
158
158
|
"elementType": ${elementType.join("|")}
|
|
159
159
|
}
|
|
@@ -193,7 +193,7 @@ You are an AI assistant. For the step, extract the element keyword from the step
|
|
|
193
193
|
Return **only valid JSON** in the following format:
|
|
194
194
|
{
|
|
195
195
|
"attributeValue": "Fire-Flink-x",
|
|
196
|
-
"action": "
|
|
196
|
+
"action": ${clickActions.join("|")},
|
|
197
197
|
"inputText": "x",
|
|
198
198
|
"elementType": ${elementType.join("|")}
|
|
199
199
|
}
|
|
@@ -241,7 +241,7 @@ return the identifier of the best match.
|
|
|
241
241
|
Return **only valid JSON** in the following format:
|
|
242
242
|
{
|
|
243
243
|
"attributeValue": "Fire-Flink-x",
|
|
244
|
-
"action": "
|
|
244
|
+
"action": ${enterActions.join("|")},
|
|
245
245
|
"inputText": "x",
|
|
246
246
|
"elementType": ${elementType.join("|")}
|
|
247
247
|
}
|
|
@@ -7,6 +7,7 @@ async function ffInspectorNumExtractorMob({ stepAction, extractedDomJson, priorA
|
|
|
7
7
|
"MOB_Enter", "MOB_EnterDataAndPressKey", "MOB_EnterInputIntoElementFromClipBoard", "MOB_EnterUrl", "MOB_Clear", "MOB_ClearThenEnterInput",
|
|
8
8
|
"MOB_LongPress", "MOB_PressEnterKey", "MOB_PressSpaceKey", "MOB_PressBackSpaceKey", "MOB_PressAnyKey", "MOB_PressAnyKeyNTimes", "MOB_EnterDataAndPressKey", "MOB_PressHomeKey", "MOB_PressBackKey"];
|
|
9
9
|
const elementType = ["link", "textfield", "icon", "button", "radiobutton", "checkbox", "tab", "action overflow button", "hamburger menu", "toggle button", "steppers", "sliders"];
|
|
10
|
+
const OtpAction = ["getOtp"];
|
|
10
11
|
let prompt = "";
|
|
11
12
|
if (stepAction === "tap" || stepAction === "enter") {
|
|
12
13
|
prompt = `
|
|
@@ -49,6 +50,37 @@ You are an AI assistant. For the step, extract the element keyword from the step
|
|
|
49
50
|
|
|
50
51
|
filtered dom JSON: ${extractedDomJson}
|
|
51
52
|
`;
|
|
53
|
+
}
|
|
54
|
+
else if (stepAction === "getOtp") {
|
|
55
|
+
prompt = `
|
|
56
|
+
You are an intelligent assistant that extracts structured mobile getOTP action data.
|
|
57
|
+
Given the step: ${JSON.stringify(priorAndNextSteps)},and the list of NLP names: ${OtpAction}.
|
|
58
|
+
|
|
59
|
+
Select the perfect matching NLP name from the list that best fits the step's intent.
|
|
60
|
+
|
|
61
|
+
Return **only valid JSON** in the following format:
|
|
62
|
+
{{
|
|
63
|
+
"nlpName": "x",
|
|
64
|
+
"inputText": "x",
|
|
65
|
+
"timeFrom": "x",
|
|
66
|
+
"waitTime": "x",
|
|
67
|
+
"activity": "x"
|
|
68
|
+
}}
|
|
69
|
+
|
|
70
|
+
Rules:
|
|
71
|
+
- nlpName must be exactly one from the provided list.
|
|
72
|
+
- If the steps are provided with the message header and the messaging app provide the message header in the inputText and messaging app in the bundleID in the activity field.
|
|
73
|
+
- If the step does not provides the messaging app don't provide example provide "activity":"" empty.
|
|
74
|
+
- If the step does not provides the time range don't provide example provide "timeFrom":"" and "waitTime":"" empty.
|
|
75
|
+
|
|
76
|
+
- **Extraction**:
|
|
77
|
+
- inputText: The header of the message mentioned in the step.
|
|
78
|
+
- activity: The messaging app from which the OTP is to be extracted.
|
|
79
|
+
- timeFrom: The time range for which the OTP is to be extracted just give number like "60" for 60 seconds like that don't add any extra words with that.
|
|
80
|
+
- waitTime: The time to wait for the OTP to be extracted just give number like "60" for 60 seconds like that don't add any extra words with that.
|
|
81
|
+
- Return ONLY a valid JSON object; the response must start with '{' and end with '}', with no markdown, code fences, explanations, or extra text.
|
|
82
|
+
|
|
83
|
+
- response:valid json only.`;
|
|
52
84
|
}
|
|
53
85
|
else if (stepAction === "swipe" || stepAction === "scroll") {
|
|
54
86
|
prompt = `
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.keywordExtractorMobile = keywordExtractorMobile;
|
|
4
4
|
async function keywordExtractorMobile({ priorAndNextSteps }) {
|
|
5
|
-
const allowedActions = ["openApp", "tap", "enter", "wait", "verify", "scroll", "get", "closeApp", "combined"];
|
|
5
|
+
const allowedActions = ["openApp", "tap", "enter", "wait", "verify", "scroll", "get", "closeApp", "combined", "switchToWeb", "getOtp", "enterOtp"];
|
|
6
6
|
const prompt = `
|
|
7
7
|
You are an expert in mobile app testing.
|
|
8
8
|
From the step, extract ONLY the meaningful keywords so that i can search for the element in the dom.
|
|
@@ -10,28 +10,37 @@ Rules:
|
|
|
10
10
|
- understand the step and context from the ${priorAndNextSteps}.and only extract keywords from current step and dont extract from prior and next steps.
|
|
11
11
|
- 3 to 5 keywords maximum.
|
|
12
12
|
- If step is contains more than one keyword like tap on x button of y ,then include both in keywords like this [x,y].and include full keywords rather than insering part of it.
|
|
13
|
-
- If the step is about luanching an app or opening app, like (action, param1, param2) or(action,'param1,param2') then wrap them into array and give them as keywords like ['com.app.android', 'com.app.activity'],if it is (action,param1) like (launch app, 'com.app.android') then give it as one keyword ['com.app.android'].
|
|
14
|
-
and also give them in the format (launch app, 'com.app.android', 'com.app.activity') like first package name and second activity name. if any separator exists (- / | :), split on it.
|
|
15
|
-
If they mention package:com.app.android and activity:com.app.activity remove variable name and then convert them into ['com.app.android, 'com.app.activity']
|
|
16
13
|
- If the step is about entering text, Should NOT include entered input values from the step in keywords.
|
|
17
14
|
- First keywords should be from step next Keywords must be distinct and based on the element's label meaning only.
|
|
18
15
|
- **Keywords can be string or number if the step contains a number it can be any number,must include that number in keywords and give it in string format.**
|
|
16
|
+
- If the step is about launching an app or opening app and if it has capbilities add them in keywords like ["key1:value1","key2:value2"...] and if step has app package and app activity without capability names like this 'com.app.android', 'com.app.activity' in keywords add with capability names
|
|
17
|
+
- For the Open App / Launch App action, if the user mentions any Android app capability, extract it into the keywords array as a key-value pair using the exact format "<capability>:<value>".
|
|
18
|
+
- The only allowed Android capabilities are:
|
|
19
|
+
- "app" - APK/app path
|
|
20
|
+
- "appPackage" - Android application package name
|
|
21
|
+
- "appActivity" - Android activity name
|
|
22
|
+
- "noReset" - whether the app state should be reset
|
|
23
|
+
- "fullReset" - whether a complete reset should be performed
|
|
24
|
+
- "autoGrantPermissions" - whether applicable Android runtime permissions should be automatically granted
|
|
25
|
+
- Every capability mentioned by the user MUST be returned as a key-value pair and capability name must be in above capability names, Never return a capability without its value.
|
|
19
26
|
- if step has keyword with type give two keywords with type and without type. ex: tap on leaving from text field. keywords = ["leaving from",leaving from text field].
|
|
20
27
|
- Should NOT include any other unrelated keywords for step.
|
|
21
28
|
- Should NOT include generic UI words (button, field, etc) and action words (tap, click, press, etc).example:tap on x button -> ['x']
|
|
22
29
|
- Should NOT include status/technical words (displayed, enabled, authenticate, visible).
|
|
30
|
+
- If the step is for the switching to web then provide the action as the switchToWeb
|
|
23
31
|
- If an element label contains multiple words (e.g., "Sign In", "Add to Cart"), keep them together as ONE keyword and do not split them and also for keywords you generated, do not split them.
|
|
24
32
|
-** element_name: extract name of the element that mentioned in the step not from keywords or other steps.(eg:tap on x -> element_name:x). always try to retuen short and meaning full element name from step**
|
|
25
|
-
- action: openApp for opening or launching of app
|
|
33
|
+
- action: openApp for opening or launching of app and activate app is there in step give action as combined, tap for taping or selecting or clicking or pressing, enter for entering input, wait for waiting or sleeping, verify for verifying or checking,scroll for scrolling and swiping, get for getting and fetching element and gtting logs and getting driver or instance details, closeApp for closing the app but not for terminating app step.
|
|
26
34
|
- If step is press any key give action as tap.if step is clear or clearandenter give action as enter and if step is open chrome browser app por application and it doesnot have app package or bundle id give action as combined but if step has app package or bundle id give action as openApp.
|
|
27
35
|
- action must be one of from this list ${allowedActions}.if not one of them, return action as 'combined'. if step about set or setting or find, install apk or ipa, uninstall apk or ipa,activate app with app package or bundle id, pinch in or pinch out or related turn wifi or airplane mode return action as 'combined'
|
|
28
|
-
- if the step action is about finding or check app is installed or open chrome browser
|
|
36
|
+
- if the step action is about finding or check app is installed or open chrome browser or open notification bar or terminate app using app package or bumdle id or running app in the background for some seconds then provide action as combined.
|
|
29
37
|
- Return ONLY a valid JSON object; the response must start with '{' and end with '}', with no markdown, code fences, explanations, or extra text.
|
|
30
38
|
Respond only with JSON using this format:
|
|
31
39
|
{
|
|
32
|
-
"keywords": [key1,key2,key3,key4,key5] if step is opening app then keywords should be like [
|
|
40
|
+
"keywords": [key1,key2,key3,key4,key5] if step is opening app then keywords should be like ["key1:value1","key2:value2"...],
|
|
33
41
|
"elementName": "x",
|
|
34
|
-
"action": "x"
|
|
42
|
+
"action": "x",
|
|
43
|
+
"liveLog": "Should Generate a short, human-readable description of what the AI is about to do.for open app dont include whole step jsut give Opening app",
|
|
35
44
|
}
|
|
36
45
|
|
|
37
46
|
No other text.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function otpExtractorPrompt(): Promise<string>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.otpExtractorPrompt = otpExtractorPrompt;
|
|
4
|
+
async function otpExtractorPrompt() {
|
|
5
|
+
return `
|
|
6
|
+
You extract one-time passwords (OTPs) from SMS messages and also the provider of the regex to extract that OTP from the message.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Return only valid JSON in exactly this format:
|
|
10
|
+
{
|
|
11
|
+
"otp": ""
|
|
12
|
+
"regex":""
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
Rules:
|
|
16
|
+
- Extract only the OTP/code stated in the supplied SMS body.
|
|
17
|
+
- Do not infer, generate, or guess an OTP.
|
|
18
|
+
- If no single unambiguous OTP is present, return an empty string.
|
|
19
|
+
- Return the regex that can be used to extract that OTP number itself from that message body also don't include any text only give the expression.
|
|
20
|
+
- Return no text, Markdown, or keys other than "otp".
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
@@ -54,6 +54,8 @@ Return **only valid JSON** in the following format:
|
|
|
54
54
|
|
|
55
55
|
Rules:
|
|
56
56
|
- nlpName must be exactly one from the provided list.
|
|
57
|
+
- URL steps (check in order, stop at first match): "title" mentioned → VerifyLinkNavigatesToTitle | contains/includes → VerifyUrlContainsExpectedUrl (if step says "browser"/"window"/"tab" url → VerifyBrowserWindowUrlContainsExpectedUrl instead) | literal word "exactly" or "equals" present → VerifyUrlIsString (if step says "browser"/"window"/"tab" url → VerifyBrowserWindowUrlIsString instead) | everything else, including plain "is"/"navigated to" phrasing → VerifyNavigateURL.
|
|
58
|
+
example: "verify navigated url is x" → VerifyNavigateURL ("is" here is just a linking verb, not the keyword "exactly"/"equals")
|
|
57
59
|
-while matching nlpName with step (ignore spaces, case differences).If multiple NLPs are similar, choose the MOST SPECIFIC and EXACT match.
|
|
58
60
|
- Use context from the steps : ${priorAndNextSteps}, keyword and json to search for FF-inspecter.
|
|
59
61
|
- **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or any other attributes best match the step in the simplified DOM.**
|
|
@@ -64,7 +66,7 @@ Rules:
|
|
|
64
66
|
and also If a step requires comparing two values, provide the input in the format inputText: "value1,value2".
|
|
65
67
|
- if step is about tag name then inputText: "tag name". and if step is about verifying tag name and with count then inputText: "tag name,count". and if any step is about verifying number of elements with xpath then inputText should be "xpath,count"
|
|
66
68
|
- if step is about verifying location then inputText: "coordinates".
|
|
67
|
-
- If
|
|
69
|
+
- If the step requires verifying text from an element, only select elements capable of containing text. Do not select image or image-related elements (e.g., img, svg, picture, source).
|
|
68
70
|
- If no explicit option is mentioned in the step, map it to the most relevant non-option verification NLP based on the intent of the step.
|
|
69
71
|
- **Extract inputText from the step that is which is being verified in the step, if you can't find any input text in the step, return keyword as inputText.**
|
|
70
72
|
if step is verifying value of element then extract value which is being verified only not any other words in the step.
|
|
@@ -5,19 +5,27 @@ async function visionPrompt({ priorAndNextSteps }) {
|
|
|
5
5
|
const customPromptText = `
|
|
6
6
|
You are a precise automation assistant.
|
|
7
7
|
Context: ${priorAndNextSteps}
|
|
8
|
+
|
|
9
|
+
- **Do not provide any additional text or explanation. The output must be strictly in this formate only Fire-Flink-x.**
|
|
8
10
|
- Use the context to understand the step and select the closest semantic match to Step and return only its index, else Fire-Flink-0.
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
- Match the
|
|
11
|
+
- Using the provided annotated screenshot and Step, identify the correct target element from the image.
|
|
12
|
+
- First identify the target element that matches the Step using its text, action, role, or visual characteristics.
|
|
13
|
+
- Match the text or action described in Step to the correct target element as accurately as possible.
|
|
14
|
+
- Check the color and the arrow/connector in the screenshot to map the target element to its Fire-Flink index.
|
|
15
|
+
- **The annotation arrow/connector is the primary source of truth for mapping the target element to its Fire-Flink index. First identify the target element, then trace its annotation arrow/connector to the corresponding Fire-Flink number.**
|
|
16
|
+
- **Do not select an index based only on the physical position or proximity of the number to the target element.**
|
|
17
|
+
- **In crowded screenshots, Fire-Flink index numbers may overlap, appear inside other elements, or be close to unrelated elements. Ignore the number's physical position and follow the annotation arrow/connector to determine which index belongs to the target element.**
|
|
18
|
+
- Use color as a secondary confirmation when tracing the annotation arrow/connector.
|
|
12
19
|
- Allow partial and case-insensitive matching. If a clear match exists, return its index.
|
|
13
20
|
- If the Chosen element has more than one index has been provided for it, return the index that smaller in number.
|
|
21
|
+
- **If u can't find the element OR the target element's annotation cannot be reliably mapped to a numbered Fire-Flink index, return Fire-Flink-0. Do not return any other element's index.**
|
|
14
22
|
- Return only the Fire-Flink-x for the target element.
|
|
15
|
-
-
|
|
16
|
-
-
|
|
23
|
+
- if the element that is related to step is there in image but it does not have any bounding box around it, dont give random fire flink index number by asssuming the position, return only "Fire-Flink-0".
|
|
24
|
+
-**return only "Fire-Flink-0" If given image does not have color bounding boxes around elements or if image is not even loaded fully.**
|
|
17
25
|
- Return ONLY a valid JSON object; the response must start with '{' and end with '}', with no markdown, code fences, explanations, or extra text.
|
|
26
|
+
|
|
18
27
|
Respond only with JSON using this format:
|
|
19
28
|
{"fireflinkIndex": "Fire-Flink-x" | "Fire-Flink-0"}
|
|
20
|
-
|
|
21
29
|
`.trim();
|
|
22
30
|
return customPromptText;
|
|
23
31
|
}
|
|
@@ -4,6 +4,7 @@ exports.visionPromptMobile = visionPromptMobile;
|
|
|
4
4
|
async function visionPromptMobile({ priorAndNextSteps }) {
|
|
5
5
|
const customPromptText = `
|
|
6
6
|
You are a precise mobile automation assistant.
|
|
7
|
+
- **Do not provide any additional text or explanation. The output must be strictly in this formate only Fire-Flink-x.**
|
|
7
8
|
- You are given an image containing multiple elements outlined with bounding boxes.Each bounding box has a small black index number label drawn above it (like 1, 2, 3...).
|
|
8
9
|
- Do not treat numbers appearing in the step as index numbers.if any number appears in the step it is not an index number.
|
|
9
10
|
- Use the context from the all steps ${priorAndNextSteps}
|
|
@@ -14,6 +15,8 @@ You are a precise mobile automation assistant.
|
|
|
14
15
|
- Return the **index** number as shown in the image (1-based).
|
|
15
16
|
- if there are two elements that match step and one have box and other doesn't have box then prefer the one with box and return that index number.
|
|
16
17
|
- if no correct element found or if none of correct elements has no box,then return 0.
|
|
18
|
+
- **If u can't find the element and also If there is no element with number, return Fire-Flink-0. dont return any other elements index.**
|
|
19
|
+
- if the element that is related to step is there in image but it does not have any bounding box around it, dont give random fire flink index number by asssuming the position, return only "Fire-Flink-0".
|
|
17
20
|
- Return ONLY a valid JSON object; the response must start with '{' and end with '}', with no markdown, code fences, explanations, or extra text.
|
|
18
21
|
Respond only with JSON using this format:
|
|
19
22
|
{fireflinkIndex: Fire-Flink-x | Fire-Flink-0}
|
|
@@ -12,6 +12,7 @@ exports.userInputFormatters = {
|
|
|
12
12
|
[promptType_js_1.PromptType.GET_PROMPT]: (userInput) => `Inspect the DOM for the following get context:\n\n${JSON.stringify(userInput.currentStep, null, 2)}`,
|
|
13
13
|
[promptType_js_1.PromptType.COMBINED_ACTION_EXTRACTOR_PROMPT]: (userInput) => `Inspect the DOM for the following wait context:\n\n${JSON.stringify(userInput.currentStep, null, 2)}`,
|
|
14
14
|
[promptType_js_1.PromptType.WAIT_ACTION_EXTRACTOR_PROMPT]: (userInput) => `Inspect the DOM for the following wait context:\n\n${JSON.stringify(userInput.currentStep, null, 2)}`,
|
|
15
|
+
[promptType_js_1.PromptType.OTP_EXTRACTOR]: (userInput) => `Extract the OTP from this SMS body:\n\n${JSON.stringify(userInput.smsBody, null, 2)}`,
|
|
15
16
|
[promptType_js_1.PromptType.VISION_PROMPT]: (userInput) => {
|
|
16
17
|
let imageBase64 = null;
|
|
17
18
|
if (userInput.annotatedScreenshot) {
|
|
@@ -366,4 +366,8 @@ export declare class ActionExecutor implements IActionExecutor {
|
|
|
366
366
|
MouseDoubleClickAtCursorPoint(): Promise<void>;
|
|
367
367
|
ReleaseLeftMouseButton(pageDOM: string, selector: string, fireflinkIndex: string, elementName: string, elementType: string): Promise<void>;
|
|
368
368
|
MouseClickOnCurrentCursorPointNTimes(value: string): Promise<void>;
|
|
369
|
+
getOtp(selector: string, timeFrom: string, waitTime: string, activity: string, otpExtractor?: (smsBody: string) => Promise<{
|
|
370
|
+
otp: string;
|
|
371
|
+
regex: string;
|
|
372
|
+
} | null>): Promise<void>;
|
|
369
373
|
}
|
|
@@ -357,6 +357,7 @@ const mouseClickOnCurrentCursorPoint_js_1 = require("./interaction/mouse/mouseCl
|
|
|
357
357
|
const mouseDoubleClickAtCursorPoint_js_1 = require("./interaction/mouse/mouseDoubleClickAtCursorPoint.js");
|
|
358
358
|
const mouseReleaseLeftMouseButton_js_1 = require("./interaction/mouse/mouseReleaseLeftMouseButton.js");
|
|
359
359
|
const mouseClickOnCurrentCursorNTImes_js_1 = require("./interaction/mouse/mouseClickOnCurrentCursorNTImes.js");
|
|
360
|
+
const getOtp_js_1 = require("./interaction/elementlessActions/getOtp.js");
|
|
360
361
|
class ActionExecutor {
|
|
361
362
|
constructor(driver, scriptDataAppender, elementGetter, platform, adbPath) {
|
|
362
363
|
this.driver = driver;
|
|
@@ -5969,5 +5970,24 @@ class ActionExecutor {
|
|
|
5969
5970
|
throw error;
|
|
5970
5971
|
}
|
|
5971
5972
|
}
|
|
5973
|
+
async getOtp(selector, timeFrom, waitTime, activity, otpExtractor) {
|
|
5974
|
+
try {
|
|
5975
|
+
await (0, getOtp_js_1.GetOtpAction)({
|
|
5976
|
+
driver: this.driver,
|
|
5977
|
+
adbPath: this.adbPath,
|
|
5978
|
+
selector,
|
|
5979
|
+
timeFrom,
|
|
5980
|
+
waitTime,
|
|
5981
|
+
activity,
|
|
5982
|
+
scriptDataAppender: this.scriptDataAppender,
|
|
5983
|
+
platform: this.platform,
|
|
5984
|
+
otpExtractor
|
|
5985
|
+
});
|
|
5986
|
+
}
|
|
5987
|
+
catch (error) {
|
|
5988
|
+
logData_js_1.logger.error("Error in [ActionExecutor]", error);
|
|
5989
|
+
throw error;
|
|
5990
|
+
}
|
|
5991
|
+
}
|
|
5972
5992
|
}
|
|
5973
5993
|
exports.ActionExecutor = ActionExecutor;
|