ff-automationv2 2.1.3 → 2.2.0

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.
Files changed (362) hide show
  1. package/.env +1 -0
  2. package/.husky/pre-commit +5 -0
  3. package/ARCHITECTURE.md +6 -3
  4. package/Note.md +7 -0
  5. package/RELEASE_GUIDE.md +1 -1
  6. package/bitbucket-pipelines.yml +4 -25
  7. package/eslint.config.ts +4 -0
  8. package/package.json +21 -9
  9. package/src/ai/llmcalls/decodeApiKey.ts +1 -1
  10. package/src/ai/llmcalls/llmAction.ts +154 -47
  11. package/src/ai/llmprompts/llmPromptTypes/systemPromptTypes.ts +45 -0
  12. package/src/ai/llmprompts/promptRegistry.ts +34 -8
  13. package/src/ai/llmprompts/systemPrompts/actionExtractorPrompt.ts +4 -7
  14. package/src/ai/llmprompts/systemPrompts/combinedActionExtractorPrompt.ts +41 -0
  15. package/src/ai/llmprompts/systemPrompts/combinedActionExtractorPromptMob.ts +53 -0
  16. package/src/ai/llmprompts/systemPrompts/errorDescriptionPrompt.ts +43 -14
  17. package/src/ai/llmprompts/systemPrompts/fireflinkElementIndexExtactors.ts +111 -36
  18. package/src/ai/llmprompts/systemPrompts/fireflinkElementIndexExtractor_Mob.ts +53 -0
  19. package/src/ai/llmprompts/systemPrompts/getActionExtractorPrompt.ts +62 -0
  20. package/src/ai/llmprompts/systemPrompts/getActionExtractorPromptMob.ts +54 -0
  21. package/src/ai/llmprompts/systemPrompts/mobileKeywordExtractor.ts +39 -0
  22. package/src/ai/llmprompts/systemPrompts/userStoryToListPrompt.ts +48 -11
  23. package/src/ai/llmprompts/systemPrompts/verifyActionExtractorPrompt.ts +82 -0
  24. package/src/ai/llmprompts/systemPrompts/verifyActionExtractorPromptMob.ts +58 -0
  25. package/src/ai/llmprompts/systemPrompts/visionPrompt.ts +8 -14
  26. package/src/ai/llmprompts/systemPrompts/visionPromptMobile.ts +25 -0
  27. package/src/ai/llmprompts/systemPrompts/waitActionExtractorPrompt.ts +65 -0
  28. package/src/ai/llmprompts/systemPrompts/waitActionExtractorPromptMob.ts +45 -0
  29. package/src/ai/llmprompts/userPrompts/userPrompt.ts +28 -4
  30. package/src/automation/actions/executor.ts +4478 -48
  31. package/src/automation/actions/interaction/alert/clickCancelOnAlertPopup.ts +21 -0
  32. package/src/automation/actions/interaction/alert/clickOkOnAlertPopup.ts +20 -0
  33. package/src/automation/actions/interaction/alert/enterDataToAlert.ts +20 -0
  34. package/src/automation/actions/interaction/alert/getTextPresentOnAlertPopup.ts +19 -0
  35. package/src/automation/actions/interaction/alert/verifyAlertPopUpMessageContainsString.ts +32 -0
  36. package/src/automation/actions/interaction/alert/verifyAlertPopupIsDisplayed.ts +19 -0
  37. package/src/automation/actions/interaction/alert/verifyTextPresentOnAlertPopup.ts +33 -0
  38. package/src/automation/actions/interaction/alert/waitTillAlertIsPresent.ts +25 -0
  39. package/src/automation/actions/interaction/clear/clear.ts +61 -0
  40. package/src/automation/actions/interaction/clear/clearAndEnter.ts +58 -0
  41. package/src/automation/actions/interaction/click/click.ts +61 -0
  42. package/src/automation/actions/interaction/click/clickNtimes.ts +67 -0
  43. package/src/automation/actions/interaction/click/clickUsingJs.ts +33 -0
  44. package/src/automation/actions/interaction/click/doubleClick.ts +66 -0
  45. package/src/automation/actions/interaction/click/rightClick.ts +29 -0
  46. package/src/automation/actions/interaction/click/waitAndClick.ts +83 -0
  47. package/src/automation/actions/interaction/dragAndDrop/dragAndDrop.ts +46 -0
  48. package/src/automation/actions/interaction/enterActions/enterInput.ts +81 -0
  49. package/src/automation/actions/interaction/enterActions/enterInputAndPress.ts +134 -0
  50. package/src/automation/actions/interaction/enterActions/enterUrl.ts +52 -0
  51. package/src/automation/actions/interaction/enterActions/enterusingJs.ts +41 -0
  52. package/src/automation/actions/interaction/enterActions/waitAndEnter.ts +106 -0
  53. package/src/automation/actions/interaction/find/findElements.ts +57 -0
  54. package/src/automation/actions/interaction/get/browserWindowGetPosition.ts +15 -0
  55. package/src/automation/actions/interaction/get/getAllBrokenImages.ts +16 -0
  56. package/src/automation/actions/interaction/get/getAllBrokenLinkCount.ts +17 -0
  57. package/src/automation/actions/interaction/get/getAllBrokenLinks.ts +16 -0
  58. package/src/automation/actions/interaction/get/getAllConsoleErrors.ts +16 -0
  59. package/src/automation/actions/interaction/get/getAllConsoleInformation.ts +16 -0
  60. package/src/automation/actions/interaction/get/getAllConsoleLogs.ts +16 -0
  61. package/src/automation/actions/interaction/get/getAllConsoleWarnings.ts +18 -0
  62. package/src/automation/actions/interaction/get/getAllCookieNames.ts +16 -0
  63. package/src/automation/actions/interaction/get/getAllCookieValues.ts +16 -0
  64. package/src/automation/actions/interaction/get/getAllSelectedOptions.ts +43 -0
  65. package/src/automation/actions/interaction/get/getAllTheOptionsFromListBoxAsText.ts +46 -0
  66. package/src/automation/actions/interaction/get/getAllTheOptionsFromListBoxAsTextInSortedOrder.ts +54 -0
  67. package/src/automation/actions/interaction/get/getAllTheSelectedOptionsFromListBoxAsText.ts +43 -0
  68. package/src/automation/actions/interaction/get/getAllWindowHandles.ts +18 -0
  69. package/src/automation/actions/interaction/get/getAttribute.ts +83 -0
  70. package/src/automation/actions/interaction/get/getAudioCurrentPlaybackRate.ts +35 -0
  71. package/src/automation/actions/interaction/get/getAudioCurrentSeekTime.ts +36 -0
  72. package/src/automation/actions/interaction/get/getAudioCurrentVolume.ts +36 -0
  73. package/src/automation/actions/interaction/get/getAudioDecodedByte.ts +43 -0
  74. package/src/automation/actions/interaction/get/getAudioDefaultPlaybackRate.ts +36 -0
  75. package/src/automation/actions/interaction/get/getAudioDimension.ts +43 -0
  76. package/src/automation/actions/interaction/get/getAudioHeight.ts +38 -0
  77. package/src/automation/actions/interaction/get/getAudioMediaLength.ts +34 -0
  78. package/src/automation/actions/interaction/get/getAudioMediaSource.ts +44 -0
  79. package/src/automation/actions/interaction/get/getAudioWidth.ts +38 -0
  80. package/src/automation/actions/interaction/get/getBestPracticesScore.ts +20 -0
  81. package/src/automation/actions/interaction/get/getBrowserCount.ts +17 -0
  82. package/src/automation/actions/interaction/get/getBrowserVersion.ts +16 -0
  83. package/src/automation/actions/interaction/get/getCapabilityNames.ts +18 -0
  84. package/src/automation/actions/interaction/get/getClipBoardText.ts +16 -0
  85. package/src/automation/actions/interaction/get/getCollectiveApiResponseTime.ts +27 -0
  86. package/src/automation/actions/interaction/get/getCollectiveApiStatusCode.ts +29 -0
  87. package/src/automation/actions/interaction/get/getCssValue.ts +38 -0
  88. package/src/automation/actions/interaction/get/getCurrentDayOfTheWeek.ts +18 -0
  89. package/src/automation/actions/interaction/get/getCurrentSecondsFromCurrentSystemTime.ts +19 -0
  90. package/src/automation/actions/interaction/get/getCurrentSystemDate.ts +18 -0
  91. package/src/automation/actions/interaction/get/getCurrentSystemDay.ts +16 -0
  92. package/src/automation/actions/interaction/get/getCurrentSystemMonth.ts +16 -0
  93. package/src/automation/actions/interaction/get/getCurrentSystemTime.ts +18 -0
  94. package/src/automation/actions/interaction/get/getCurrentSystemYear.ts +18 -0
  95. package/src/automation/actions/interaction/get/getCurrentWindowHandle.ts +36 -0
  96. package/src/automation/actions/interaction/get/getDataFromApiRequestHeaderForJsonPath.ts +21 -0
  97. package/src/automation/actions/interaction/get/getDataFromApiResponseForJsonPath.ts +21 -0
  98. package/src/automation/actions/interaction/get/getDateWithGivenFormat.ts +35 -0
  99. package/src/automation/actions/interaction/get/getDriverInstance.ts +35 -0
  100. package/src/automation/actions/interaction/get/getFirstContentfulPaint.ts +16 -0
  101. package/src/automation/actions/interaction/get/getFirstSelectedOption.ts +44 -0
  102. package/src/automation/actions/interaction/get/getFullPaintTime.ts +16 -0
  103. package/src/automation/actions/interaction/get/getHTMLCodeOfPage.ts +18 -0
  104. package/src/automation/actions/interaction/get/getHeightOfBrowserWindow.ts +18 -0
  105. package/src/automation/actions/interaction/get/getHeightOfWebElement.ts +36 -0
  106. package/src/automation/actions/interaction/get/getHourFromCurrentSystemTime.ts +18 -0
  107. package/src/automation/actions/interaction/get/getImplicitTimeOut.ts +36 -0
  108. package/src/automation/actions/interaction/get/getLargestContentfulPaint.ts +16 -0
  109. package/src/automation/actions/interaction/get/getListBoxSize.ts +41 -0
  110. package/src/automation/actions/interaction/get/getListOfElementsFromLocatorTypeLocatorValue.ts +63 -0
  111. package/src/automation/actions/interaction/get/getLocation.ts +68 -0
  112. package/src/automation/actions/interaction/get/getMinuteFromCurrentSystemTime.ts +18 -0
  113. package/src/automation/actions/interaction/get/getNetworkRouteTime.ts +16 -0
  114. package/src/automation/actions/interaction/get/getNumberOfBrokenImages.ts +16 -0
  115. package/src/automation/actions/interaction/get/getNumberOfLinksPresentInCurrentPage.ts +18 -0
  116. package/src/automation/actions/interaction/get/getNumberOfWorkingLinksFromCurrentPage.ts +15 -0
  117. package/src/automation/actions/interaction/get/getOptions.ts +35 -0
  118. package/src/automation/actions/interaction/get/getPageTitle.ts +18 -0
  119. package/src/automation/actions/interaction/get/getPerformanceMetrics.ts +15 -0
  120. package/src/automation/actions/interaction/get/getPwaScore.ts +20 -0
  121. package/src/automation/actions/interaction/get/getRect.ts +87 -0
  122. package/src/automation/actions/interaction/get/getScreenshot.ts +41 -0
  123. package/src/automation/actions/interaction/get/getScreenshotAs.ts +64 -0
  124. package/src/automation/actions/interaction/get/getSeoScore.ts +20 -0
  125. package/src/automation/actions/interaction/get/getSingleApiRequestPayload.ts +22 -0
  126. package/src/automation/actions/interaction/get/getSingleApiResponse.ts +30 -0
  127. package/src/automation/actions/interaction/get/getSingleApiResponseTime.ts +28 -0
  128. package/src/automation/actions/interaction/get/getSingleApiStatusCode.ts +32 -0
  129. package/src/automation/actions/interaction/get/getSize.ts +68 -0
  130. package/src/automation/actions/interaction/get/getSizeOfBrowserWindow.ts +17 -0
  131. package/src/automation/actions/interaction/get/getStringDataFromLocalFile.ts +25 -0
  132. package/src/automation/actions/interaction/get/getSystemProperty.ts +46 -0
  133. package/src/automation/actions/interaction/get/getTagName.ts +67 -0
  134. package/src/automation/actions/interaction/get/getText.ts +68 -0
  135. package/src/automation/actions/interaction/get/getTheFirstSelectedOptionFromListBoxAsText.ts +44 -0
  136. package/src/automation/actions/interaction/get/getTotalNumberOfCookies.ts +16 -0
  137. package/src/automation/actions/interaction/get/getTunnelIdentifier.ts +25 -0
  138. package/src/automation/actions/interaction/get/getURLPresentInAddressBar.ts +18 -0
  139. package/src/automation/actions/interaction/get/getUserHomeDirectory.ts +16 -0
  140. package/src/automation/actions/interaction/get/getValueByCookieName.ts +27 -0
  141. package/src/automation/actions/interaction/get/getValueFromLocalStorage.ts +26 -0
  142. package/src/automation/actions/interaction/get/getValueOfSystemVariable.ts +20 -0
  143. package/src/automation/actions/interaction/get/getVideoCurrentPlaybackRate.ts +36 -0
  144. package/src/automation/actions/interaction/get/getVideoCurrentSeekTime.ts +36 -0
  145. package/src/automation/actions/interaction/get/getVideoCurrentVolume.ts +36 -0
  146. package/src/automation/actions/interaction/get/getVideoDecodedByte.ts +52 -0
  147. package/src/automation/actions/interaction/get/getVideoDefaultPlaybackRate.ts +36 -0
  148. package/src/automation/actions/interaction/get/getVideoDimension.ts +40 -0
  149. package/src/automation/actions/interaction/get/getVideoHeight.ts +36 -0
  150. package/src/automation/actions/interaction/get/getVideoMediaLength.ts +36 -0
  151. package/src/automation/actions/interaction/get/getVideoMediaSource.ts +46 -0
  152. package/src/automation/actions/interaction/get/getVideoWidth.ts +36 -0
  153. package/src/automation/actions/interaction/get/getWidthOfBrowser.ts +18 -0
  154. package/src/automation/actions/interaction/get/getWidthOfWebElement.ts +36 -0
  155. package/src/automation/actions/interaction/get/getWorkingLinksFromCurrentPage.ts +16 -0
  156. package/src/automation/actions/interaction/get/getWrappedElement.ts +36 -0
  157. package/src/automation/actions/interaction/get/getWrappedOptionFromListBoxAsText.ts +47 -0
  158. package/src/automation/actions/interaction/get/getXLocationOfBrowserWindow.ts +18 -0
  159. package/src/automation/actions/interaction/get/getXLocationOfWebElement.ts +71 -0
  160. package/src/automation/actions/interaction/get/getYLocationOfBrowserWindow.ts +18 -0
  161. package/src/automation/actions/interaction/get/getYLocationOfWebElement.ts +70 -0
  162. package/src/automation/actions/interaction/iframe/switchToDefaultContent.ts +15 -0
  163. package/src/automation/actions/interaction/maximize/maximize.ts +15 -0
  164. package/src/automation/actions/interaction/maximize/minimize.ts +17 -0
  165. package/src/automation/actions/interaction/navigation/goBack.ts +14 -0
  166. package/src/automation/actions/interaction/navigation/navigate.ts +16 -0
  167. package/src/automation/actions/interaction/navigation/refresh.ts +14 -0
  168. package/src/automation/actions/interaction/press/mobPressBackKey.ts +19 -0
  169. package/src/automation/actions/interaction/press/pressAnyKey.ts +89 -0
  170. package/src/automation/actions/interaction/press/pressAnyKeyNTimes.ts +100 -0
  171. package/src/automation/actions/interaction/press/pressEnterKey.ts +45 -0
  172. package/src/automation/actions/interaction/scroll/scrollHorizontallyTillElementIsVisible.ts +29 -0
  173. package/src/automation/actions/interaction/scroll/scrollPageToSpecificLocation.ts +37 -0
  174. package/src/automation/actions/interaction/scroll/scrollToElement.ts +28 -0
  175. package/src/automation/actions/interaction/scroll/scrollVerticallyTillElementIsVisible.ts +29 -0
  176. package/src/automation/actions/interaction/set/setClipBoardText.ts +46 -0
  177. package/src/automation/actions/interaction/shadowDom/shadowDomClick.ts +25 -0
  178. package/src/automation/actions/interaction/shadowDom/shadowDomEnter.ts +27 -0
  179. package/src/automation/actions/interaction/shadowDom/shadowDomGetText.ts +28 -0
  180. package/src/automation/actions/interaction/shadowDom/shadowDomUpload.ts +37 -0
  181. package/src/automation/actions/interaction/shadowDom/shadowDomVerifyPartialText.ts +29 -0
  182. package/src/automation/actions/interaction/shadowDom/shadowDomVerifyText.ts +22 -0
  183. package/src/automation/actions/interaction/switch/switchToNewTabBasedOnTitle.ts +16 -0
  184. package/src/automation/actions/interaction/switch/switchToNewWindowBasedOnTitle.ts +16 -0
  185. package/src/automation/actions/interaction/switch/switchToParentWindow.ts +19 -0
  186. package/src/automation/actions/interaction/switch/switchToTabBasedOnUrl.ts +16 -0
  187. package/src/automation/actions/interaction/switch/switchToWindowBasedOnURL.ts +16 -0
  188. package/src/automation/actions/interaction/switch/switchToWindowIfTitleContainsString.ts +18 -0
  189. package/src/automation/actions/interaction/switch/switchToWindowIfUrlContainsString.ts +18 -0
  190. package/src/automation/actions/interaction/upload/uploadfile.ts +41 -0
  191. package/src/automation/actions/interaction/verify/VerifyAccessibilityScore.ts +90 -0
  192. package/src/automation/actions/interaction/verify/VerifyAllBrokenImages.ts +54 -0
  193. package/src/automation/actions/interaction/verify/VerifyAllBrowserWindowsClosed.ts +27 -0
  194. package/src/automation/actions/interaction/verify/VerifyAllOptionsAreDeSelected.ts +55 -0
  195. package/src/automation/actions/interaction/verify/VerifyAllOptionsAreSelected.ts +66 -0
  196. package/src/automation/actions/interaction/verify/VerifyAttributeValue.ts +96 -0
  197. package/src/automation/actions/interaction/verify/VerifyBestPracticesScore.ts +87 -0
  198. package/src/automation/actions/interaction/verify/VerifyBrowserHtmlCodeContainsString.ts +35 -0
  199. package/src/automation/actions/interaction/verify/VerifyBrowserWindowHeight.ts +35 -0
  200. package/src/automation/actions/interaction/verify/VerifyBrowserWindowTitleContainsString.ts +31 -0
  201. package/src/automation/actions/interaction/verify/VerifyBrowserWindowTitleIsString.ts +30 -0
  202. package/src/automation/actions/interaction/verify/VerifyBrowserWindowUrlContainsExpectedUrl.ts +30 -0
  203. package/src/automation/actions/interaction/verify/VerifyBrowserWindowUrlIsString.ts +30 -0
  204. package/src/automation/actions/interaction/verify/VerifyBrowserWindowWidth.ts +35 -0
  205. package/src/automation/actions/interaction/verify/VerifyBrowserWindowXLocation.ts +36 -0
  206. package/src/automation/actions/interaction/verify/VerifyBrowserWindowYLocation.ts +35 -0
  207. package/src/automation/actions/interaction/verify/VerifyCheckBoxIsNotSelected.ts +46 -0
  208. package/src/automation/actions/interaction/verify/VerifyCheckBoxIsSelected.ts +43 -0
  209. package/src/automation/actions/interaction/verify/VerifyCssAttributeValue.ts +62 -0
  210. package/src/automation/actions/interaction/verify/VerifyElementIsClickable.ts +86 -0
  211. package/src/automation/actions/interaction/verify/VerifyElementIsDisabled.ts +91 -0
  212. package/src/automation/actions/interaction/verify/VerifyElementIsDisplayed.ts +87 -0
  213. package/src/automation/actions/interaction/verify/VerifyElementIsEnabled.ts +87 -0
  214. package/src/automation/actions/interaction/verify/VerifyElementIsNotDisplayed.ts +45 -0
  215. package/src/automation/actions/interaction/verify/VerifyElementIsSelected.ts +83 -0
  216. package/src/automation/actions/interaction/verify/VerifyElementNotContainsText.ts +129 -0
  217. package/src/automation/actions/interaction/verify/VerifyHeightOfWebElement.ts +101 -0
  218. package/src/automation/actions/interaction/verify/VerifyHexCodeForGivenXYCoordinates.ts +51 -0
  219. package/src/automation/actions/interaction/verify/VerifyIfAllCookiesAreDeleted.ts +27 -0
  220. package/src/automation/actions/interaction/verify/VerifyIfAudioEnded.ts +48 -0
  221. package/src/automation/actions/interaction/verify/VerifyIfAudioIsMuted.ts +48 -0
  222. package/src/automation/actions/interaction/verify/VerifyIfAudioIsPaused.ts +48 -0
  223. package/src/automation/actions/interaction/verify/VerifyIfAudioIsPlaying.ts +57 -0
  224. package/src/automation/actions/interaction/verify/VerifyIfBrowserWindowIsClosed.ts +27 -0
  225. package/src/automation/actions/interaction/verify/VerifyIfCookieNameIsAdded.ts +38 -0
  226. package/src/automation/actions/interaction/verify/VerifyIfCookieNameIsDeleted.ts +33 -0
  227. package/src/automation/actions/interaction/verify/VerifyIfCookieObjectIsPresent.ts +49 -0
  228. package/src/automation/actions/interaction/verify/VerifyIfGivenOptionIsDuplicate.ts +60 -0
  229. package/src/automation/actions/interaction/verify/VerifyIfImageIsBroken.ts +40 -0
  230. package/src/automation/actions/interaction/verify/VerifyIfLinkIsBroken.ts +38 -0
  231. package/src/automation/actions/interaction/verify/VerifyIfLinkIsWorking.ts +37 -0
  232. package/src/automation/actions/interaction/verify/VerifyIfLinksAreBroken.ts +46 -0
  233. package/src/automation/actions/interaction/verify/VerifyIfLinksAreWorking.ts +45 -0
  234. package/src/automation/actions/interaction/verify/VerifyIfOptionWithIndexIsDeselectedInElement.ts +75 -0
  235. package/src/automation/actions/interaction/verify/VerifyIfOptionWithIndexIsSelectedInListBox.ts +77 -0
  236. package/src/automation/actions/interaction/verify/VerifyIfOptionWithTextIsDeselected.ts +40 -0
  237. package/src/automation/actions/interaction/verify/VerifyIfOptionWithValueIsDeselected.ts +61 -0
  238. package/src/automation/actions/interaction/verify/VerifyIfOptionWithValueIsSelected.ts +58 -0
  239. package/src/automation/actions/interaction/verify/VerifyIfOptionWithVisibleTextIsSelected.ts +40 -0
  240. package/src/automation/actions/interaction/verify/VerifyIfSpecifiedOptionIsSelected.ts +78 -0
  241. package/src/automation/actions/interaction/verify/VerifyIfStatusCodeOfALinkIsStatusCode.ts +37 -0
  242. package/src/automation/actions/interaction/verify/VerifyIfStatusCodesOfLinks.ts +46 -0
  243. package/src/automation/actions/interaction/verify/VerifyIfVideoEnded.ts +49 -0
  244. package/src/automation/actions/interaction/verify/VerifyIfVideoIsMuted.ts +49 -0
  245. package/src/automation/actions/interaction/verify/VerifyIfVideoIsPaused.ts +49 -0
  246. package/src/automation/actions/interaction/verify/VerifyIfVideoIsPlaying.ts +50 -0
  247. package/src/automation/actions/interaction/verify/VerifyIfVideoPlayingInMute.ts +58 -0
  248. package/src/automation/actions/interaction/verify/VerifyIfVideoPlayingInUnmute.ts +58 -0
  249. package/src/automation/actions/interaction/verify/VerifyIfXAndYCoordinateOfElement.ts +101 -0
  250. package/src/automation/actions/interaction/verify/VerifyLinkNavigatesToTitle.ts +41 -0
  251. package/src/automation/actions/interaction/verify/VerifyListBoxOptionsAreSorted.ts +72 -0
  252. package/src/automation/actions/interaction/verify/VerifyNavigateURL.ts +34 -0
  253. package/src/automation/actions/interaction/verify/VerifyNumberOfElementsByTagName.ts +35 -0
  254. package/src/automation/actions/interaction/verify/VerifyNumberOfElementsByXpath.ts +52 -0
  255. package/src/automation/actions/interaction/verify/VerifyPartialAttributeValue.ts +94 -0
  256. package/src/automation/actions/interaction/verify/VerifyPartialTitleOfCurrentPage.ts +29 -0
  257. package/src/automation/actions/interaction/verify/VerifyPerformanceScore.ts +84 -0
  258. package/src/automation/actions/interaction/verify/VerifyPwaScore.ts +66 -0
  259. package/src/automation/actions/interaction/verify/VerifyRadioButtonIsNotSelected.ts +42 -0
  260. package/src/automation/actions/interaction/verify/VerifyRadioButtonIsSelected.ts +42 -0
  261. package/src/automation/actions/interaction/verify/VerifySeoScore.ts +79 -0
  262. package/src/automation/actions/interaction/verify/VerifyTagName.ts +44 -0
  263. package/src/automation/actions/interaction/verify/VerifyThatSpecifiedOptionIsNotSelected.ts +73 -0
  264. package/src/automation/actions/interaction/verify/VerifyTitleInAllPage.ts +51 -0
  265. package/src/automation/actions/interaction/verify/VerifyTitleOfCurrentPage.ts +30 -0
  266. package/src/automation/actions/interaction/verify/VerifyValueOfElementContainsString.ts +51 -0
  267. package/src/automation/actions/interaction/verify/VerifyValueOfElementIsCleared.ts +45 -0
  268. package/src/automation/actions/interaction/verify/VerifyValueOfElementIsString.ts +54 -0
  269. package/src/automation/actions/interaction/verify/VerifyWidthOfElement.ts +90 -0
  270. package/src/automation/actions/interaction/verify/VerifyXLocationOfElement.ts +89 -0
  271. package/src/automation/actions/interaction/verify/VerifyYLocationOfElement.ts +90 -0
  272. package/src/automation/actions/interaction/verify/checkIfElementIsDisplayed.ts +83 -0
  273. package/src/automation/actions/interaction/verify/verifypartialtext.ts +131 -0
  274. package/src/automation/actions/interaction/verify/verifytext.ts +143 -0
  275. package/src/automation/actions/interaction/wait/wait.ts +16 -0
  276. package/src/automation/actions/interaction/wait/waitTillAttributeOfElementIsString.ts +88 -0
  277. package/src/automation/actions/interaction/wait/waitTillElementContainsText.ts +79 -0
  278. package/src/automation/actions/interaction/wait/waitTillElementHasText.ts +71 -0
  279. package/src/automation/actions/interaction/wait/waitTillElementIsClickable.ts +72 -0
  280. package/src/automation/actions/interaction/wait/waitTillPresenceOfAllElements.ts +72 -0
  281. package/src/automation/actions/interaction/wait/waitTillPresenceOfElement.ts +67 -0
  282. package/src/automation/actions/interface/IframeInterface.ts +6 -0
  283. package/src/automation/actions/interface/alertActionInterface.ts +39 -0
  284. package/src/automation/actions/interface/clearActionInterface.ts +27 -0
  285. package/src/automation/actions/interface/clickActionInterface.ts +87 -0
  286. package/src/automation/actions/interface/dragAndDropToElementInterface.ts +18 -0
  287. package/src/automation/actions/interface/findActionInterface.ts +15 -0
  288. package/src/automation/actions/interface/getActionInterface.ts +873 -0
  289. package/src/automation/actions/interface/interactionActionInterface.ts +51 -3
  290. package/src/automation/actions/interface/maximizeAndMinimizeInterface.ts +12 -0
  291. package/src/automation/actions/interface/navigationActionInterface.ts +1 -1
  292. package/src/automation/actions/interface/pressActionInterface.ts +25 -0
  293. package/src/automation/actions/interface/scrollActionInterface.ts +45 -0
  294. package/src/automation/actions/interface/setActionInterface.ts +10 -0
  295. package/src/automation/actions/interface/shadowDomInterface.ts +78 -0
  296. package/src/automation/actions/interface/switchingActionInterface.ts +93 -0
  297. package/src/automation/actions/interface/uploadFile.ts +14 -0
  298. package/src/automation/actions/interface/verifyActionInterface.ts +743 -0
  299. package/src/automation/actions/interface/waitActionInterface.ts +75 -0
  300. package/src/automation/browserSession/initiateBrowserSession.ts +12 -40
  301. package/src/automation/mobileSession/initiateMobileSession.ts +81 -0
  302. package/src/core/constants/allAction.ts +21 -0
  303. package/src/core/constants/defaultValues.ts +1 -0
  304. package/src/core/constants/supportedActions.ts +27 -2
  305. package/src/core/interfaces/actionInterface.ts +238 -3
  306. package/src/core/interfaces/automationRunnerInterface.ts +2 -1
  307. package/src/core/interfaces/browserCapabilitiesInterface.ts +1 -3
  308. package/src/core/interfaces/errorInfoInterface.ts +7 -0
  309. package/src/core/interfaces/executionDetails.ts +10 -6
  310. package/src/core/interfaces/fireflinkScriptPayloadInterface.ts +17 -5
  311. package/src/core/interfaces/llmResponseInterface.ts +28 -4
  312. package/src/core/interfaces/promptInterface.ts +20 -0
  313. package/src/core/interfaces/scriptGenrationDataInterface.ts +2 -2
  314. package/src/core/interfaces/simplifyAndFlattenInterface.ts +13 -0
  315. package/src/core/main/actionHandlerFactory.ts +1528 -53
  316. package/src/core/main/executionContext.ts +5 -1
  317. package/src/core/main/runAutomationScript.ts +528 -123
  318. package/src/core/main/stepProcessor.ts +4 -2
  319. package/src/core/types/llmResponseType.ts +7 -3
  320. package/src/core/types/promptMap.ts +7 -4
  321. package/src/core/types/promptType.ts +6 -0
  322. package/src/core/types/scriptTypesType.ts +1 -0
  323. package/src/domAnalysis/getRelaventElements.ts +10 -1
  324. package/src/domAnalysis/relativeElementsFromDom.ts +205 -0
  325. package/src/domAnalysis/searchBest.ts +130 -17
  326. package/src/domAnalysis/simplifyAndFlatten.ts +139 -10
  327. package/src/fireflinkData/fireflinkLocators/getListOfLocators.ts +1 -2
  328. package/src/fireflinkData/fireflinkScript/scriptGenrationData.ts +70 -21
  329. package/src/imageAnalysisMobile/annotatedScreenshotMobile.ts +137 -0
  330. package/src/imageAnalysisMobile/annotatedScreenshotMobileInterface.ts +6 -0
  331. package/src/imageAnalysisWeb/annotateScreenshot.ts +196 -0
  332. package/src/imageAnalysisWeb/generateAnnotatedScreenshots.ts +43 -0
  333. package/src/imageAnalysisWeb/screenshotInterface.ts +18 -0
  334. package/src/index.ts +2 -2
  335. package/src/service/{fireflinkApi.service.ts → api/fireflinkApi.service.ts} +5 -7
  336. package/src/service/kafka/fireflinkKafka.service.ts +25 -0
  337. package/src/service/scriptRunner.service.ts +23 -42
  338. package/src/utils/DomExtraction/jsForAttributeInjection.ts +68 -12
  339. package/src/utils/InstancesDetails/getInstancesInfo.ts +12 -0
  340. package/src/utils/alertPopup/isAlertPresent.ts +20 -0
  341. package/src/utils/alertPopup/isAlertPresentInterface.ts +6 -0
  342. package/src/utils/helpers/enterActionHelper.ts +88 -2
  343. package/src/utils/helpers/imageUtils.ts +10 -0
  344. package/src/utils/helpers/sameActionsHelper.ts +52 -0
  345. package/src/utils/helpers/xpathcreation.ts +59 -0
  346. package/src/utils/iframesExtraction/findElementUsingFF.ts +45 -0
  347. package/src/utils/iframesExtraction/iframeInterface.ts +22 -0
  348. package/src/utils/iframesExtraction/switchToIframeByMeta.ts +23 -0
  349. package/src/utils/javascript/jsFindElement.ts +39 -31
  350. package/src/utils/javascript/jsForShadowRoot.ts +9 -9
  351. package/src/utils/javascript/jsForVision.ts +151 -0
  352. package/src/utils/logger/logData.ts +126 -47
  353. package/src/utils/mobileXpath/findXpathFromIndex.ts +87 -0
  354. package/src/utils/mobileXpath/findXpathFromIndexInterface.ts +4 -0
  355. package/src/utils/newTab/newTabTracker.ts +62 -0
  356. package/src/automation/actions/interaction/click.ts +0 -25
  357. package/src/automation/actions/interaction/enterInput.ts +0 -36
  358. package/src/automation/actions/navigation/getTitle.ts +0 -9
  359. package/src/automation/actions/navigation/goBack.ts +0 -9
  360. package/src/automation/actions/navigation/navigate.ts +0 -10
  361. package/src/automation/actions/navigation/refresh.ts +0 -9
  362. package/src/automation/actions/wait/wait.ts +0 -10
@@ -0,0 +1,53 @@
1
+ import { combinedActionArgs } from "../llmPromptTypes/systemPromptTypes"
2
+
3
+ export async function combinedActionExtractorPromptMob({
4
+ extractedDomJson,
5
+ priorAndNextSteps,
6
+
7
+ }: combinedActionArgs
8
+ ): Promise<string> {
9
+ const nlpList = `"MOB_SetCapability","MOB_EnterUrl","MOB_OpenMobileApplication",
10
+ "MOB_IsAppInstalled","MOB_SetEmulatorPowerPercentage","MOB_ReceiveMessageOnEmulator","MOB_UninstallAPK",
11
+ "MOB_InstallAPK","MOB_SetClipBoardText","MOB_PressAnyKeyNTimes",
12
+ "MOB_SetContext","MOB_TerminateAppUsingAppPackage","MOB_OpenAppWithApkFilePath","MOB_ActivateAppUsingAppPackage",
13
+ "MOB_ExecuteJavaScript","MOB_LongPress","MOB_Clear","MOB_EnterInputIntoElementFromClipBoard",
14
+ "MOB_FindElement","MOB_FindElements","MOB_OpenNotification","MOB_PressEnterKey","MOB_ResetApp","MOB_HideKeyboard",
15
+ "MOB_SetEmulatorPowerStateOff","MOB_OpenChromeBrowser","MOB_SetDeviceOrientationAsPortrait","MOB_SetDeviceOrientationAsLandscape",
16
+ "MOB_SetEmulatorPowerStateOn","MOB_AirplaneModeSwitchOn","MOB_LockDevice","MOB_WifiSwitchOff",
17
+ "Continue","MOB_GpsSwitchOn","MOB_GpsSwitchOff","MOB_RestartCurrentDevice","MOB_AirplaneModeSwitchOff","Break","MOB_WifiSwitchOn",
18
+ "MOB_PinchInByPercent","MOB_PinchOutByPercent","MOB_Click",
19
+ "MOB_CreateCapabilitiesInstance","MOB_PressAnyKey","MOB_PressBackSpaceKey","MOB_PressSpaceKey","MOB_RunAppInBackground",
20
+ "MOB_SetAppiumDriverSettings","MOB_SetDriverInstance","MOB_SetImplicitTimeOut",
21
+ "MOB_TakeScreenShotAndCompareWithImage","MOB_TakeScreenshotAndCompareSectionWithImage","MOB_TakeScreenshotAndCompareWithImageIgnoringSpecifiedSection"`;
22
+
23
+
24
+ const elementType = ["link", "textfield", "icon", "button", "radiobutton", "checkbox", "tab", "action overflow button", "hamburger menu", "toggle button", "steppers", "sliders"]
25
+ const prompt = `
26
+ You are an intelligent assistant that extracts structured UI action data.
27
+ Given the step, the simplified DOM: ${extractedDomJson}, and the list of NLP names: ${nlpList}.
28
+
29
+ Select the perfect matching NLP name from the list that best fits the step's intent.
30
+
31
+ Return **only valid JSON** in the following format:
32
+ {
33
+ "attribute_value": "Fire-Flink-x",
34
+ "nlpName": "x",
35
+ "input_text":"x",
36
+ "keyword": "x",
37
+ "element_type": "x",
38
+ "keycode": "x"
39
+ }
40
+ Rules:
41
+ - nlpName must be exactly one from the provided list.
42
+ - Use context from the steps : ${priorAndNextSteps}, keyword and json to search for FF-inspecter.
43
+ - **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or attributes best match the step.**
44
+ - If step has mutipul inputs add all in input_text and all matched attribute_value also.
45
+ - Extract input_text from the step, if you can't find any input text in the step, return keyword as input_text.input can be number, app package, apk file path.dont include extra words.
46
+ - Extract keyword from the step, if the step contains any keyword.
47
+ - Extract keycode of keys if the step contains any key name like ENTER,SPACE,BACKSPACE etc and give keycode of the given key.
48
+ - Use the closest semantic match for the step; return attribute_value as Fire-Flink-0, only if nothing is found.
49
+ - Based on step give most relevant type of element. use this list to choose element_type: ${elementType} and Never change syntax of element_type, follow the syntax of element_type in list.if element_type is not there in list return 'link'.
50
+ - Respond with valid JSON only.
51
+ `;
52
+ return prompt;
53
+ }
@@ -1,23 +1,52 @@
1
1
  export async function buildErrorDescriptionPrompt(): Promise<string> {
2
2
  const description_prompt = `
3
+ Analyze the automation failure and execution history and generate a structured diagnostic response.
3
4
 
4
- Analyze the error and execution history to provide diagnostics in JSON format.
5
+ SYSTEM CONTEXT:
6
+ - The automation is executed by FireFlink.
7
+ - The underlying automation framework must NEVER be mentioned.
8
+ - The explanation must sound like an official FireFlink platform diagnostic message.
9
+ - The tone must be professional, clear, and user-friendly.
10
+ - Do NOT expose internal technical details.
5
11
 
6
- Return a JSON object with the following keys:
7
- 1. "error": A concise, single-line, selenium type(error).__name__ (e.g., "InvalidSessionIdException", "InvalidElementStateException", "ElementNotInteractableException", "NoSuchElementException" etc).
8
- 2. "errorDescription": A very simple, non-technical, and user-friendly explanation of why the automation might have failed.
9
- - Use plain English.
10
- - All the lines should contain FireFlink. example: "FireFlink was unable to find the element..."
11
- - Do not mention code, XPaths, or internal technical terms.
12
- - The output MUST be a single paragraph of exactly 10 to 15 lines of text.
13
- - Focus on potential real-world causes.
12
+ ERROR NORMALIZATION:
13
+ - Convert the failure into the closest equivalent Selenium-style exception class name.
14
+ - If it clearly matches a known Selenium exception, return that exact class name.
15
+ - If it does NOT clearly match any known Selenium exception, return: "WebDriverException".
16
+ - Never return framework-specific error names.
17
+ - Never include stack traces or extra text in the "error" field.
18
+
19
+ STRICT OUTPUT RULES:
20
+ - Return ONLY valid JSON.
21
+ - Do NOT include markdown.
22
+ - Do NOT include explanations outside JSON.
23
+ - Do NOT add extra keys.
24
+ - Ensure JSON is syntactically valid.
25
+ - No trailing commas.
26
+ - Follow the required structure exactly.
27
+
28
+ Return a JSON object with EXACTLY these keys:
29
+
30
+ 1. "error":
31
+ - Must contain ONLY a single Selenium-style exception class name.
32
+ - Do NOT include additional words.
33
+
34
+ 2. "errorDescription":
35
+ - May contain one or more sentences separated by newline characters (\n).
36
+ - The tone must clearly reflect FireFlink as the acting system.
37
+ - Use simple but sufficiently detailed language.
38
+ - Do NOT mention Selenium, WebDriver, drivers, selectors, DOM, stack traces, or implementation details.
39
+ - Do NOT use low-level debugging terminology.
40
+ - Provide realistic and logically consistent possible causes based on the identified exception type.
41
+ - Avoid repetition.
42
+ - Avoid unrelated environment assumptions unless clearly supported by the failure context.
43
+
44
+ Required JSON format:
14
45
 
15
- Respond only with JSON using this format:
16
46
  {
17
- "error": ",
18
- "errorDescription": "",
19
- }
20
- `;
47
+ "error": "",
48
+ "errorDescription": ""
49
+ }`;
21
50
 
22
51
  return description_prompt;
23
52
  }
@@ -1,10 +1,5 @@
1
- type FFInspectorArgs = {
2
- stepAction: string;
3
- extractedDomJson: string;
4
- priorAndNextSteps: string[];
5
- isAlert?: boolean;
6
- isDrag?: boolean;
7
- };
1
+ import { FFInspectorArgs } from "../llmPromptTypes/systemPromptTypes"
2
+
8
3
  export async function ffInspectorNumExtractor({
9
4
  stepAction,
10
5
  extractedDomJson,
@@ -15,7 +10,8 @@ export async function ffInspectorNumExtractor({
15
10
  ): Promise<
16
11
  string
17
12
  > {
18
- const clickActions = ["click", "doubleclick", "rightclick"];
13
+ const switchActions = ["SwitchToNewTabBasedOnTitle", "SwitchToNewTabBasedOnUrl", "SwitchToNewWindowBasedOnTitle", "SwitchToNewWindowBasedOnURL", "SwitchToParentWindow", "SwitchToWindowIfTitleContainsString", "SwitchToNewWindowIfUrlContainsString"]
14
+ const clickActions = ["Click", "DoubleClick", "RightClick", "WaitAndClick", "ClickNTimes", "ClickUsingJS"];
19
15
  const alertActions = [
20
16
  "ClickOkOnAlertPopup",
21
17
  "ClickCancelOnAlertPopup",
@@ -26,25 +22,24 @@ export async function ffInspectorNumExtractor({
26
22
  "WaitTillAlertIsPresent",
27
23
  "VerifyTextPresentOnAlertPopup"
28
24
  ];
25
+ const scrollActions = ["ScrollToElement", "ScrollVerticallyTillElementIsVisible", "ScrollHorizontallyTillElementIsVisible"];
29
26
  const elementType = ['link', 'textfield', 'icon', 'button', 'radioButton', 'text', 'textarea', 'image', 'dropdown', 'checkbox', 'tab', 'action overflow button', 'hamburger icon', 'toggle button', 'suggestion', 'time picker', 'date picker', 'toaster message', 'card', 'tooltip', 'option', 'calender', 'sliders', 'visual testing'];
30
- const enterActions = ["enter", "clearandenter"];
27
+ const enterActions = ["SendKeys", "ClearThenEnterInput", "WaitAndSendKeys", "EnterInputUsingJS", "EnterDataAndPressKey"];
31
28
  let prompt;
32
29
 
33
30
  // ---------------- ALERT ----------------
34
31
  if (isAlert) {
35
32
  prompt = `
36
- You are given a Selenium test step that requires interaction with a browser alert popup.
37
-
33
+ You are given a manual test step that requires interaction with a browser alert popup.
34
+ Based on the step, return the required alert element with input in the following JSON format only:
38
35
  Rules:
39
- - if the alert requires entering text or verification comparison, extract that text.
36
+ - if the alert requires entering text inpt alert or for verification if we need compare text than extract that text and give as input_text.
40
37
  - If no input is needed, set "input_text" to "None".
41
- - If step verifies text presence VerifyTextPresentOnAlertPopup.
42
- - If step verifies text contains VerifyAlertPopUpMessageContainsString.
43
- - Do not add explanations or extra text.
44
- - Return ONE action from this list only: ${JSON.stringify(alertActions)}.
38
+ - if step is about verify text present than map to VerifyTextPresentOnAlertPopup.and if step is about verify text contains than map to VerifyAlertPopUpMessageContainsString.
39
+ - Do not add explanations, comments, or extra text.
40
+ - send one action from this list only ${alertActions} witch is related to step.
45
41
  - Output must be valid JSON.
46
42
  Respond only with JSON using this format:
47
-
48
43
  {
49
44
  "action": x,
50
45
  "input_text": "text to enter" | "None"
@@ -71,6 +66,7 @@ Rules:
71
66
  - If not found, return Fire-Flink-0 for both.
72
67
  - Extract element names from step if possible.
73
68
  - Respond with JSON only.
69
+ - The element type should be from this list ${elementType}, check for both drag and drop element type.
74
70
  Simplified JSON:
75
71
  ${extractedDomJson}
76
72
 
@@ -81,12 +77,14 @@ Respond only with JSON using this format:
81
77
  "action": "Builtin_DragAndDropToElement",
82
78
  "drag_element_name": "x",
83
79
  "drop_element_name": "x"
80
+ "drag_element_type": "x",
81
+ "drop_element_type": "x"
84
82
  }
85
83
  `;
86
84
  }
87
85
 
88
- // ---------------- WAIT / SCROLL ----------------
89
- else if (stepAction === "wait" || stepAction === "scroll") {
86
+ // ---------------- SCROLL ----------------
87
+ else if (stepAction === "scroll") {
90
88
  prompt = `
91
89
  You are an intelligent assistant that extracts structured UI action data.
92
90
 
@@ -97,10 +95,10 @@ Rules:
97
95
  - Use context from test steps: ${JSON.stringify(priorAndNextSteps)}
98
96
  - Use simplified JSON to find best FF-inspect match.
99
97
  - Choose closest semantic + DOM-distance match.
98
+ - based on step and context choose the most related action from ${scrollActions}
100
99
  - Default direction is down.
101
100
  - Action:
102
- - scroll → extract num_of_scrolls & direction
103
- - wait → extract wait time (number only)
101
+ - ${scrollActions} → extract num_of_scrolls & direction
104
102
  - No nulls; use empty strings if needed.
105
103
  - The element type should be from this list ${elementType}
106
104
 
@@ -111,17 +109,48 @@ Return ONLY valid JSON:
111
109
  {
112
110
  "attribute_value": "Fire-Flink-x",
113
111
  "action": "x",
114
- "input_text": "seconds in Interger | input text",
115
- "keyword": "x",
116
112
  "num_of_scrolls": "0",
117
113
  "direction": "down",
118
- "elementType":"x"
114
+ "element
115
+ Type":"x"
119
116
  }
120
117
  `;
121
118
  }
122
119
 
120
+ else if (stepAction === "switch") {
121
+ prompt = `
122
+ You are an intelligent assistant that extracts structured UI action data.
123
+ Given the stepActions: ${switchActions}, the simplified DOM: ${extractedDomJson}.
124
+ Don't provide action outside the ${switchActions} list only provide the relevant action from inside the list itself.
125
+ Select the perfect matching action from the stepAction list that best fits the step's intent.
126
+ **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**
127
+ {{
128
+ "attribute_value": "Fire-Flink-x",
129
+ "action": "x",
130
+ "input_text": "x",
131
+ "keyword": "x"
132
+ }}
133
+
134
+ Rules:
135
+ - action must be exactly one from the provided list.
136
+ - Use context from the steps : ${JSON.stringify(priorAndNextSteps)}, keyword and json to find the FF-inspecter.
137
+ - **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or attributes best match for the step.**
138
+ - Extract input_text from the step that represents the target window URL, Title, Frame Name, Frame Index, etc.
139
+ - if step consist of keyword like title and url than map to that matched action.
140
+ - If a step contains a full URL (for example, https://example.com), map it using URL-based NLP matching.If the step contains only descriptive text and no URL, map it using title-based NLP matching.
141
+ example: "Switch to the new tab based on https://example.com" -> input_text: "https://example.com", nlpName: "SwitchToTabBasedOnUrl"
142
+ example: "Switch to the tab based on Title" -> input_text: "Title", nlpName: "SwitchToNewTabBasedOnTitle"
143
+ - step may some times have 'new' keyword in it, dont consider it just map th nlps. never get confused by title and url.
144
+ - If step is about switching to frame by index, input_text should be the index number.
145
+ - If step is about switching to frame by name, input_text should be the frame name.
146
+ - If step is about switching to window by URL or Title, input_text should be the url or title string.
147
+ - If no explicit input is found, attempt to infer it or leave empty if the NLP implies a specific action without input (e.g. SwitchToParentWindow).
148
+ - **Respond with valid JSON only. don't return any other text or don't return response in list format**
149
+ `;
150
+ }
151
+
123
152
  // ---------------- DEFAULT (CLICK / ENTER / UPLOAD etc.) ----------------
124
- else {
153
+ else if (stepAction === "click" || stepAction === "cleartext") {
125
154
  prompt = `
126
155
 
127
156
  -You are an intelligent assistant that extracts structured UI action data.
@@ -134,15 +163,13 @@ Return **only valid JSON** in the following format:
134
163
  "attribute_value": "Fire-Flink-x",
135
164
  "action": "x",
136
165
  "input_text": "x",
137
- "keyword": "x",
138
- "num_of_scrolls": "0",
139
- "direction": "down",
140
166
  "elementType": "x"
141
167
  }
142
168
 
143
169
  Rules:
144
170
  You are an AI assistant. For the step, extract the element keyword from the step (the field name like 'Leaving from', 'Going To').
145
171
  - Use context from the ${JSON.stringify(priorAndNextSteps)}, keyword and filtered dom to search for FF-inspecter.
172
+ - Simplified JSON: ${extractedDomJson} if this simplified json is empty return Fire-Flink-0 never return Fire-Flink-1 as attribute_value.
146
173
  - **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or attributes best match the atep.**
147
174
  - If multiple matches exist, use the reference element and choose the closest match by ff-inspect distance.
148
175
  **important example: step: "click on login below user login"
@@ -151,23 +178,71 @@ You are an AI assistant. For the step, extract the element keyword from the step
151
178
  user login - ff-inspect-790
152
179
  login - ff-inspect-803
153
180
  then should return login - ff-inspect-803 witch is near to user reference element user login - ff-inspect-790**
154
- - Respect direction (up/down), default is down.
155
181
  - Do not return elements far away from the reference.
182
+ - These are actions: ${clickActions}.
183
+ - For wait and click step check in the step the time of wait in seconds will be mentioned take provide it has the input_text in the output and action as waitandclick as mention in the clickactionlist similarly for the click n times n will the input_text in the output and action as clickntimes as mention in the clickactionlist.
184
+ - If it is like wait and click in the step then send the wait time as the value as provided in the step and then for click n times provide the n as the value in the output.
156
185
  - Select the closest semantic match to step and return only its attribute_value, else Fire-Flink-0.
157
- - Action: ${clickActions} for clicking or selecting, ${enterActions} for entering text, 'upload' for uploading file, 'drag_and_drop' for dragging and dropping, 'cleartext' for clearing text.
186
+ - For WaitAndClick take action as WaitAndClick and input_text as the wait time as provided in the step.
187
+ - For ClickNTimes take action as ClickNTimes and input_text as the n as provided in the step.
188
+ - For ClickUsingJS take action as ClickUsingJS and input_text as the empty string and select this click action only if the step is about clicking an element using javascript.
189
+ - Action: ${clickActions} for clicking or selecting,'Clear' for clearing text based on the step.
190
+ - For Click action, if only step involving 'clicking on icon' then try to return related svg tags attribute_value, if they are available in simplified json.
191
+ - Based on step give most relevant type of element. use this list to choose element_type: ${elementType} and Never change syntax of element_type, follow the syntax of element_type in list.if element_type is not there in list return 'link'.
192
+
193
+ `;
194
+ }
195
+ // ---------------- DEFAULT (CLICK / ENTER / UPLOAD etc.) ----------------
196
+ else {
197
+ prompt = `
198
+
199
+ -You are an intelligent assistant that extracts structured UI action data.
200
+ -Given a structured UI JSON representation with uniquely identified elements (ff-inspect values like Fire-Flink-1, Fire-Flink-2, Fire-Flink-3... in DOM order),
201
+ -locate the most appropriate element for an automation step by performing keyword-based matching using exact, partial, and fuzzy strategies, and
202
+ return the identifier of the best match.
203
+
204
+ Return **only valid JSON** in the following format:
205
+ {
206
+ "attribute_value": "Fire-Flink-x",
207
+ "action": "x",
208
+ "input_text": "x",
209
+ "elementType": "x"
210
+ }
211
+
212
+ Rules:
213
+ You are an AI assistant. For the step, extract the element keyword from the step (the field name like 'Leaving from', 'Going To').
214
+ - Use context from the ${JSON.stringify(priorAndNextSteps)}, keyword and filtered dom to search for FF-inspecter.
215
+ - Simplified JSON: ${extractedDomJson} if this simplified json is empty return Fire-Flink-0 never return Fire-Flink-1 as attribute_value.
216
+ - Select the closest semantic match to step and return only its attribute_value, else Fire-Flink-0.
217
+ - **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or attributes best match the atep.**
218
+ - If multiple matches exist, use the reference element and choose the closest match by ff-inspect distance.
219
+ important example: step: "click on login below user login"
220
+ simplified json:
221
+ login - ff-inspect-300
222
+ user login - ff-inspect-790
223
+ login - ff-inspect-803
224
+ then should return login - ff-inspect-803 witch is near to user reference element user login - ff-inspect-790
225
+ - Respect direction (up/down), default is down.
226
+ - Do not return elements far away from the reference.
227
+ - Select the closest semantic match to step and return only its attribute_valu
228
+ - Action:SendKeys for entering text, EnterDataAndPressKey for entering data and pressing the key, clearThenEnterInput for clear and Entering Input, 'upload' for uploading file.
229
+ - Action:EnterDataAndPressKey if step is about entering data and pressing a key, then select this action.
230
+ - Action:EnterInputUsingJS if step is about entering input using js,WaitAndSendKeys for waiting for some time and then entring.
231
+ - If action is waitAndSendkeys then in the input_text provide output with the input and then the wait time in seconds as "input_text = " input, waittime" input is input for that step and waittime is time in seconds mentioned in steps only for wiat and enter step and also the attribute_value should be the attribute_value of the element in the simplified json.
158
232
  - For click action, if only step involving 'clicking on icon' then try to return related svg tags attribute_value, if they are available in simplified json.
159
233
  - For Action ${enterActions} extract input text from step.
160
234
  - **For ${enterActions} actions, never directly select a input tag if should be realted to step; if u can't find input tag related to step then prefer the closest label/span/div/b/i etc, it can be any tag related to the step.**
161
235
  - **For ${enterActions} step if you can't find perfect matching element return attribute_value as Fire-Flink-0 for the step. it should be exact match for the step.**
162
- - For ${enterActions} step, If the step implies autogenerated data or random data(email, phone, credentials, identifiers, etc.), generate a valid dummy input_text suitable for the field.
163
- example: step: "Enter sss.@gmail.com in email field" and step :
164
- you should check only for email in Simplified JSON and input_text should be "sss.@gmail.com" dont add any extra text.
165
- - For Action "upload" extract file path from step.
236
+ - For ${enterActions} step, If the step implies autogenerated data or random data(email, phone, credentials, identifiers, etc.), generate a valid dummy input_text suitable for the field.
237
+ example: step: "Enter sss.@gmail.com in email field" and step :
238
+ you should check only for email in Simplified JSON and input_text should be "sss.@gmail.com" dont add any extra text.
239
+ - For Action "upload" extract file path from step. and add extra //// for path.like "C:////Users/////User/////Downloads/////fireflinkElementIndexExtactors.ts"
240
+ - For Action "EnterDataAndPressKey" extract input text from step. and also extract the key to be pressed from the step. and return the key to be pressed as the input_text in the form of input_text, key_to_be_pressed.ex(input_text = "input","key_to_be_pressed" )
166
241
  - if u cant find any input_text or any other dont give null just return them "" empty.
167
242
  - Based on step give most relevant type of element. use this list to choose element_type: ${elementType} and Never change syntax of element_type, follow the syntax of element_type in list.if element_type is not there in list return 'link'.
168
- Simplified JSON: ${extractedDomJson} if this simplified json is empty return Fire-Flink-0.
243
+
169
244
 
170
245
  `;
171
246
  }
172
247
  return prompt;
173
- }
248
+ }
@@ -0,0 +1,53 @@
1
+ import { FFInspectorArgsMob } from "../llmPromptTypes/systemPromptTypes"
2
+
3
+ export async function ffInspectorNumExtractorMob({
4
+ stepAction,
5
+ extractedDomJson,
6
+ priorAndNextSteps,
7
+ }: FFInspectorArgsMob
8
+ ): Promise<
9
+ string
10
+ > {
11
+ const Actions = ["MOB_Tap", "MOB_TapNTimes", "MOB_DoubleTap", "MOB_DoubleTapAtSpecifiedLocation", "MOB_TapOnSpecifiedLocation",
12
+ "MOB_Enter", "MOB_EnterDataAndPressKey", "MOB_EnterInputIntoElementFromClipBoard", "MOB_EnterUrl", "MOB_ClearThenEnterInput",
13
+ "MOB_LongPress", "MOB_PressEnterKey", "MOB_PressSpaceKey", "MOB_PressBackSpaceKey", "MOB_PressAnyKey", "MOB_PressAnyKeyNTimes", "MOB_EnterDataAndPressKey", "MOB_PressHomeKey", "MOB_PressBackKey"]
14
+ const elementType = ["link", "textfield", "icon", "button", "radiobutton", "checkbox", "tab", "action overflow button", "hamburger menu", "toggle button", "steppers", "sliders"]
15
+ let prompt = "";
16
+
17
+ if (stepAction === "tap" || stepAction === "enter") {
18
+ prompt = `
19
+ You are an intelligent assistant that extracts structured UI action data.\n
20
+ Return **only valid JSON** in the following format:\n
21
+ **Dont give any extra explanation or text**
22
+ {
23
+ "attribute_value": "Fire-Flink-x",
24
+ "input_text": "x",
25
+ "keyword": "x",
26
+ "element_type": "x",
27
+ "nlpName": "x"
28
+ }
29
+
30
+ Rules:\n
31
+ You are an AI assistant. For the step, extract the element keyword from the step (the field name like 'Leaving from', 'Going To').
32
+ - Use context from all steps: ${JSON.stringify(priorAndNextSteps)}, keyword and filtered dom to search for FF-inspecter.
33
+ **nlpName: MOB_PressBackKey or MOB_PressHomeKey for mobile navigation respective buttons like back and home**
34
+ - **If step is tap on element of referenece element,if multiple elements are there ,choose element which is related to reference element.The element can be reference element's before or after sibling nodes in filtered dom json.**
35
+ - **For step if you can't find perfect matching element or no attribute in filtered dom JSON is related to step return attribute_value as Fire-Flink-0.**
36
+ - Don't think if type of element is found it is exact element, check with keyword and step.If it is not matched return Fire-Flink-0.
37
+ - **Find the FF-inspecter attribute value of the element in the filtered dom JSON whose text or content-desc or other attributes best or perfect match for the step.**
38
+ - nlpName: Extract nlpName from the list of nlps: ${Actions} based on the step.
39
+ - For taping action dont take attribute_value of the node contining edittext in class, resource-id.
40
+ - For some steps you can see two inputs but you need to uderstand step and send the requred input_text.
41
+ ex:Double tap on the 30,50
42
+ here here input:30,50
43
+ - and for this MOB_TapNTimes nlps send number of times to tap as input_text.
44
+ - nlpName: wait for wait action, and in input_text give time to wait. like sleep for 30 seconds, here nlpName is wait and input_text is 30.
45
+ - Extract input text from step for all actions,if input is not there give empty string "".
46
+ - Based on step give most relevant type of element. use this list to choose element_type: ${elementType} and Never change syntax of element_type, follow the syntax of element_type in list.if element_type is not there in list return 'link'.
47
+ - Respond with valid JSON only.
48
+
49
+ filtered dom JSON: ${extractedDomJson}
50
+ `;
51
+ }
52
+ return prompt;
53
+ }
@@ -0,0 +1,62 @@
1
+ import { getActionArgs } from "../llmPromptTypes/systemPromptTypes"
2
+
3
+ export async function getActionExtractorPrompt({
4
+ extractedDomJson,
5
+ priorAndNextSteps,
6
+
7
+ }: getActionArgs
8
+ ): Promise<string> {
9
+ const nlpList = `"GetAllTheOptionsFromListBoxAsTextInSortedOrder", "GetScreenshot", "GetAllTheOptionsFromListBoxAsText", "GetTheFirstSelectedOptionFromListBoxAsText", "GetAllTheSelectedOptionsFromListBoxAsText", "GetAttribute", "GetTagName", "GetListBoxSize",
10
+ "GetWrappedOptionFromListBoxAsText", "GetTextFromListOfWebElements", "GetCssValue", "GetScreenshotAs", "GetFirstSelectedOption", "GetText", "GetOptions", "GetAllSelectedOptions", "GetSize", "GetWrappedElement", "GetRect", "GetLocation",
11
+ "GetXLocationOfWebElement", "GetYLocationOfWebElement", "GetVideoMediaSource", "GetListOfElementsFromLocatorTypeLocatorValue", "GetVideoCurrentSeekTime", "GetVideoMediaLength", "GetVideoDefaultPlaybackRate", "GetVideoHeight", "GetAudioCurrentPlaybackRate",
12
+ "GetAudioDecodedByte", "GetVideoCurrentPlaybackRate", "GetVideoCurrentVolume", "GetVideoDimension", "GetAudioDefaultPlaybackRate", "GetVideoWidth", "GetSingleApiStatusCode", "GetSingleApiResponseTime", "GetAudioCurrentVolume", "GetSingleApiResponse",
13
+ "GetCollectiveApiStatusCode", "GetVideoDecodedByte", "GetDataFromApiResponseForJsonPath", "GetAudioMediaSource", "GetCollectiveApiResponseTime", "GetStatusCodeOfALink", "GetValueFromLocalStorage", "GetHeightOfWebElement", "GetTunnelIdentifier",
14
+ "GetWidthOfWebElement", "GetValueByCookieName", "GetAudioHeight", "GetHexCodeForGivenXYCoordinatesOfImage", "GetAudioCurrentSeekTime", "GetAudioWidth", "GetAudioMediaLength", "GetAudioDimension", "ScrollPageToSpecificLocation", "GetDateWithGivenFormat",
15
+
16
+ "GetBestPracticesScore", "GetPwaScore", "GetDataFromApiRequestHeaderForJsonPath", "GetSeoScore", "GetValueOfSystemVariable", "GetStringDataFromLocalFile", "GetAccessibilityScore", "GetPerformanceScore", "GetSystemProperty", "GetValueFromXmlPath",
17
+ "RobotGetXLocationOfWebElement", "RobotGetYLocationOfWebElement", "GetSingleApiRequestPayload","GetAllBrokenLinks", "GetHeightOfBrowserWindow", "GetXLocationOfBrowserWindow", "GetAllBrokenLinkCount", "GetWidthOfBrowser", "GetCurrentWindowHandle",
18
+ "GetAllWindowHandles", "GetURLPresentInAddressBar", "GetHTMLCodeOfPage", "GetPageTitle", "GetBrowserCount", "GetBrowserVersion", "GetImplicitTimeOut", "GetCapabilityNames", "GetYLocationOfBrowserWindow", "GetCurrentSystemDate",
19
+ "GetCurrentDayOfTheWeek", "GetCurrentSystemTime", "GetCurrentSecondsFromCurrentSystemTime", "GetCurrentSystemYear", "GetHourFromCurrentSystemTime", "GetMinuteFromCurrentSystemTime", "GetNumberOfLinksPresentInCurrentPage", "GetAllConsoleWarnings",
20
+ "GetAllConsoleInformation", "GetAllConsoleErrors", "GetAllCookieValues", "GetSizeOfBrowserWindow", "GetCurrentSystemMonth", "GetCurrentSystemDay", "GetAllConsoleLogs", "GetTotalNumberOfCookies", "GetAllBrokenImages", "GetAllCookieNames",
21
+ "GetNumberOfWorkingLinksFromCurrentPage", "GetNumberOfBrokenImages", "GetWorkingLinksFromCurrentPage", "BrowserWindowGetPosition", "GetClipBoardText", "GetDriverInstance", "GetFullPaintTime", "GetFirstContentfulPaint", "GetLargestContentfulPaint",
22
+ "GetNetworkRouteTime", "GetPerformanceMetrics", "GetUserHomeDirectory"`;
23
+
24
+
25
+ const elementType = ['link', 'textfield', 'icon', 'button', 'radioButton', 'text', 'textarea', 'image', 'dropdown', 'checkbox', 'tab', 'action overflow button', 'hamburger icon', 'toggle button', 'suggestion', 'time picker', 'date picker', 'toaster message', 'card', 'tooltip', 'option', 'calender', 'sliders', 'visual testing'];
26
+ const prompt = `You are an intelligent assistant that extracts structured UI action data for fetching (GET) information.
27
+ Given the step, the simplified DOM: ${JSON.stringify(extractedDomJson)}, and the list of NLP names: ${nlpList}.
28
+
29
+ Select the perfect matching NLP name from the list that best fits the step's intent.
30
+ **The NLP name must match exactly one value from the approved NLP list. Do not generate or suggest any new NLP names under any condition.**
31
+
32
+ {
33
+ "attribute_value": "Fire-Flink-x",
34
+ "nlpName": "x",
35
+ "input_text":"x"
36
+ "element_type": "x"
37
+ }
38
+ Rules:
39
+ - nlpName must be exactly one from the provided list.
40
+ - Use context from the steps : ${priorAndNextSteps}, keyword and json to search for FF-inspecter.
41
+ - **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or attributes best match the step.**
42
+ - **CRITICAL: For media actions (GetVideo..., GetAudio...), ALWAYS prioritize the actual <video> or <audio> element. DO NOT select container <div>, <span> or code block elements that merely contain the media tag as text. If you see a code block and a real media element, choose the real media element.**
43
+ - For some steps you can see two inputs but you need to understand step and send the required input_text. input_text can be string, number, url or xpath.
44
+ ex: get the flights matches the flight, Get Single Api Response of url- 'https://app.talentscan.ai/login' and request url-'https://app.talentscan.ai/sign up', if they give x-30,y-50 just send 30,50 and for this nlps GetDataFromApiRequestHeaderForJsonPath and Get Data From Api Response of url- 'https://app.talentscan.ai/login' and request url-'https://app.talentscan.ai/sign up' For JsonPath - c:jsonpath format than fill input_text in this order "https://app.talentscan.ai/login,https://app.talentscan.ai/sign up,c:jsonpath"
45
+ here keyword : "flights" , input : "flight", here input:"https://app.talentscan.ai/login,https://app.talentscan.ai/sign up" first input is url and second input is request url
46
+ - If step is about getting text from list of web elements from locator type locator value then always follow this format first type next value input_text: "locator_type, locator_value". if they didn't give locator type then based on locator value find locator type.
47
+ and also If a step is about getting value from element or some kind of locator type then provide the input in the format input_text: "locator_type, locator_value".
48
+ - If step is about getting attribute value then map to attribute nlps and input_text: "attribute_name".
49
+ - if step is about tag name then input_text: "tag name". and if step is about getting tag name and with count then input_text: "tag name,count".
50
+ - if step is about getting screenshot of element then than map to GetScreenshotAs.
51
+ - If step is mapted to GetTunnelIdentifier nlp than input_text must have 4 values separated by comma.first will be datacenter second will be username third will be access key and fourth will be tunnel id. they must follow this order. if they miss any value than return all values except that value.
52
+ - If a step refers to location, use X-location or Y-location NLP only when X or Y is explicitly mentioned; otherwise, use the general location NLP.
53
+ - if step is about getting options than map to option nlps.
54
+ - for nlp GetBestPracticesScore,GetPwaScore and GetSeoScore input_text must have 2 values separated by comma.first will be url second will be device type. they must follow this order. if they miss any value than return all values except that value.
55
+ - If no explicit option is mentioned in the step, map it to the most relevant non-option getting NLP based on the intent of the step.
56
+ - Extract input_text from the step that is which is being getting in the step, if you can't find any input text in the step, return keyword as input_text.
57
+ - Use the closest semantic match for the step; return attribute_value as Fire-Flink-0, only if nothing is found.and never return Fire-Flink-x.
58
+ - Based on step give most relevant type of element. use this list to choose element_type: ${elementType} and Never change syntax of element_type, follow the syntax of element_type in list.if element_type is not there in list return 'link'.
59
+ - **Respond with valid JSON only. don't return any other text* or or don't return response in list format*.
60
+ `;
61
+ return prompt;
62
+ }
@@ -0,0 +1,54 @@
1
+ import { getActionArgs } from "../llmPromptTypes/systemPromptTypes"
2
+
3
+ export async function getActionExtractorPromptMob({
4
+ extractedDomJson,
5
+ priorAndNextSteps,
6
+
7
+ }: getActionArgs
8
+ ): Promise<string> {
9
+ const nlpList = `"MOB_GetDeviceLocation","MOB_GetBatteryPercentage","MOB_GetLongitude","MOB_GetAltitude","MOB_GetLatitude",
10
+ "MOB_GetCurrentDeviceDate","MOB_GetMinuteFromCurrentDeviceTime","MOB_GetCurrentAppPackage","MOB_GetAllContexts",
11
+ "MOB_GetHourFromCurrentDeviceTime","MOB_GetSecondFromCurrentDeviceTime","MOB_GetSupportedPerformanceDataTypes",
12
+ "MOB_GetCurrentOrientation","MOB_GetCurrentDeviceTime","MOB_GetCurrentContext","MOB_GetCurrentDeviceSettings","GetCurrentSystemDay",
13
+ "MOB_GetClipBoardText","GetCurrentSystemMonth","MOB_GetCurrentDeviceStatus","MOB_GetSizeOfScreen","MOB_GetAllWindowHandles","MOB_GetWidthOfScreen",
14
+ "MOB_GetBatteryStatus","MOB_GetCurrentActivity","MOB_GetDeviceOsVersion","MOB_GetDeviceUdid","MOB_GetDeviceName","MOB_GetImplicitTimeOut",
15
+ "MOB_GetDriverInstance","MOB_GetCurrentWindowHandle","MOB_GetCurrentSessionId","MOB_GetHeightOfScreen","MOB_GetCurrentDeviceSystemBars",
16
+ "MOB_GetAttributeValueFromListOfWebElements","MOB_GetTagName","MOB_GetListOfElementsFromLocatorTypeLocatorValue","MOB_GetScreenshot","MOB_GetTextFromElementAndSetToClipBoard",
17
+ "MOB_GetHeightOfElement","MOB_GetTextFromListOfWebElements","MOB_GetHexCodeForGivenXYCoordinatesOfImage","MOB_GetADBLogsForGivenAppPackage","MOB_GetScreenshotAs","MOB_GetWidthOfElement",
18
+ "MOB_GetX", "MOB_GetLocation","MOB_GetY","MOB_GetPerformanceData","MOB_GetRect","MOB_GetText","MOB_GetSize","MOB_GetAttribute"`;
19
+
20
+
21
+ const elementType = ["link", "textfield", "icon", "button", "radiobutton", "checkbox", "tab", "action overflow button", "hamburger menu", "toggle button", "steppers", "sliders"]
22
+ const prompt = `You are an intelligent assistant that extracts structured UI action data.
23
+ Given the step: step, the simplified DOM: ${extractedDomJson} and the list of NLP names: ${nlpList}.
24
+
25
+ Select the perfect matching NLP name from the list that best fits the step's intent.
26
+
27
+ Return **only valid JSON** in the following format:
28
+ {
29
+ "FF_inspector_value": "Fire-Flink-x",
30
+ "nlpName": "x",
31
+ "input_text":"x"
32
+ "keyword": "x",
33
+ "element_type": "x",
34
+ "locator_type": "x",
35
+ "attribute_type": "x"
36
+ }
37
+ Rules:
38
+ - nlpName must be exactly one from the provided list.
39
+ - for screenshots, extract the input_text from the step. like what they what to name image.if not present then leave it empty.
40
+ - Use context from the steps : ${priorAndNextSteps}, keyword and json to search for FF-inspecter.
41
+ - **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or attributes best match the step.**
42
+ - Extract input_text from the step, if you can't find any input text in the step, return keyword as input_text.
43
+ ex:Fetch the ADB logs for the abhibus
44
+ here input: abhibus
45
+ - Extract keyword from the step, if the step contains any keyword.
46
+ - Use the closest semantic match for the step; return attribute_value as Fire-Flink-0, only if nothing is found.
47
+ - if step is get location of device or get device location then map to MOB_GetDeviceLocation nlp.
48
+ - Based on step give most relevant type of element. use this list to choose element_type: ${elementType} and Never change syntax of element_type, follow the syntax of element_type in list.if element_type is not there in list return 'link'.
49
+ - Extract locator_type if mentioned in the step, like(text,resource-id,content-desc,xpath)
50
+ - Extract attribute_type if mentioned in the step, like (text,resource-id,content-desc,className).
51
+ - Respond with valid JSON only.
52
+ `;
53
+ return prompt;
54
+ }
@@ -0,0 +1,39 @@
1
+ import { keywordExtractor } from "../llmPromptTypes/systemPromptTypes";
2
+
3
+ export async function keywordExtractorMobile(
4
+ { priorAndNextSteps }: keywordExtractor
5
+ ): Promise<string> {
6
+
7
+ const allowedActions: string[] = ["openApp", "tap", "enter", "wait", "verify", "scroll", "get", "close"]
8
+
9
+ const prompt = `
10
+ You are an expert in mobile app testing.
11
+ From the step, extract ONLY the meaningful keywords so that i can search for the element in the dom.
12
+ Rules:
13
+ - understand the step and context from the ${priorAndNextSteps}.and only extract keywords from current step and dont extract from all steps.
14
+ - 3 to 5 keywords maximum.
15
+ - 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']
16
+ 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.
17
+ 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']
18
+ - If the step is about entering text, Do NOT include entered input values from the step.
19
+ - First keywords should be from step next Keywords must be distinct and based on the element's label meaning only.
20
+ - **Keywords can be string or number if the step contains a number it can be any number,must include that number in keywords.**
21
+ - Do Not include any other unrelated keywords for step.
22
+ - Do NOT include generic UI words (button, field, etc) and action words (tap, click, press, etc).
23
+ - Do NOT include status/technical words (displayed, enabled, authenticate, visible).
24
+ - 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.
25
+ -** 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**
26
+ - action: openApp for opening or launching of app, 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,fetching element, closeApp for closing the app.
27
+ - action must be one of from this list ${allowedActions}.if not one of them, return '0'. if step about set or find or press enter key action return '0'
28
+ Respond only with JSON using this format:
29
+ {
30
+ "keywords": [key1,key2,key3,key4,key5] if step is opening app then keywords should be like [app package,app activity],
31
+ "elementName": "x",
32
+ "action": "x"
33
+ }
34
+
35
+ No other text.
36
+ `;
37
+
38
+ return prompt;
39
+ }