ff-automationv2 2.2.27 → 2.2.29
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.d.ts +9 -4
- package/dist/ai/llmcalls/llmAction.js +173 -37
- package/dist/ai/llmcalls/parseLlmOputput.js +18 -6
- package/dist/ai/llmprompts/promptRegistry.js +11 -0
- package/dist/ai/llmprompts/systemPrompts/actionExtractorPrompt.js +19 -10
- package/dist/ai/llmprompts/systemPrompts/combinedActionExtractorPrompt.js +7 -6
- package/dist/ai/llmprompts/systemPrompts/combinedActionExtractorPromptMob.js +14 -13
- package/dist/ai/llmprompts/systemPrompts/errorDescriptionPrompt.js +6 -4
- package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtactors.js +120 -62
- package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtractor_Mob.js +33 -28
- package/dist/ai/llmprompts/systemPrompts/getActionExtractorPrompt.js +18 -16
- package/dist/ai/llmprompts/systemPrompts/getActionExtractorPromptMob.js +13 -13
- package/dist/ai/llmprompts/systemPrompts/mobileKeywordExtractor.js +13 -11
- package/dist/ai/llmprompts/systemPrompts/userStoryToListPrompt.js +1 -1
- package/dist/ai/llmprompts/systemPrompts/verifyActionExtractorPrompt.js +20 -18
- package/dist/ai/llmprompts/systemPrompts/verifyActionExtractorPromptMob.js +9 -9
- package/dist/ai/llmprompts/systemPrompts/visionPrompt.js +4 -2
- package/dist/ai/llmprompts/systemPrompts/visionPromptMobile.js +1 -0
- package/dist/ai/llmprompts/systemPrompts/waitActionExtractorPrompt.js +10 -9
- package/dist/ai/llmprompts/systemPrompts/waitActionExtractorPromptMob.js +8 -7
- package/dist/ai/llmprompts/userPrompts/userPrompt.js +7 -8
- package/dist/automation/actions/executor.d.ts +38 -34
- package/dist/automation/actions/executor.js +280 -166
- package/dist/automation/actions/interaction/alert/clickCancelOnAlertPopup.js +4 -4
- package/dist/automation/actions/interaction/alert/clickOkOnAlertPopup.js +4 -4
- package/dist/automation/actions/interaction/alert/enterDataToAlert.js +4 -3
- package/dist/automation/actions/interaction/alert/getTextPresentOnAlertPopup.js +4 -4
- package/dist/automation/actions/interaction/alert/verifyAlertPopUpMessageContainsString.js +4 -3
- package/dist/automation/actions/interaction/alert/verifyAlertPopupIsDisplayed.js +10 -4
- package/dist/automation/actions/interaction/alert/verifyTextPresentOnAlertPopup.js +4 -3
- package/dist/automation/actions/interaction/alert/waitTillAlertIsPresent.js +5 -5
- package/dist/automation/actions/interaction/clear/clear.js +33 -26
- package/dist/automation/actions/interaction/clear/clearAndEnter.js +33 -26
- package/dist/automation/actions/interaction/click/MOB_DoubleTapAtSpecifiedLocation.js +5 -6
- package/dist/automation/actions/interaction/click/click.js +57 -25
- package/dist/automation/actions/interaction/click/clickNtimes.js +29 -24
- package/dist/automation/actions/interaction/click/clickUsingJs.js +12 -12
- package/dist/automation/actions/interaction/click/doubleClick.js +32 -25
- package/dist/automation/actions/interaction/click/rightClick.js +18 -13
- package/dist/automation/actions/interaction/click/tapOnSpecifiedLocation.js +7 -5
- package/dist/automation/actions/interaction/click/waitAndClick.js +29 -27
- package/dist/automation/actions/interaction/dragAndDrop/dragAndDrop.js +2 -2
- package/dist/automation/actions/interaction/elementLessAction/MobCheckIfAppIsClosed.js +14 -9
- package/dist/automation/actions/interaction/elementLessAction/MobRunAppInBackgroundInterface.js +9 -9
- package/dist/automation/actions/interaction/elementlessActions/activateAppUsingAppPackage.d.ts +0 -3
- package/dist/automation/actions/interaction/elementlessActions/activateAppUsingAppPackage.js +8 -9
- package/dist/automation/actions/interaction/elementlessActions/installAPK.js +74 -33
- package/dist/automation/actions/interaction/elementlessActions/isAppInstalled.js +10 -8
- package/dist/automation/actions/interaction/elementlessActions/openAppWithApkFilePath.js +87 -68
- package/dist/automation/actions/interaction/elementlessActions/openMobileApplication.js +8 -6
- package/dist/automation/actions/interaction/elementlessActions/receiveMessageOnEmulator.js +4 -3
- package/dist/automation/actions/interaction/elementlessActions/terminateAppUsingAppPackage.js +8 -6
- package/dist/automation/actions/interaction/elementlessActions/uninstallAPK.js +76 -32
- package/dist/automation/actions/interaction/enterActions/EnterInputIntoElementFromClipBoardInterface_mob.js +17 -13
- package/dist/automation/actions/interaction/enterActions/enterInput.js +50 -30
- package/dist/automation/actions/interaction/enterActions/enterInputAndPress.js +32 -24
- package/dist/automation/actions/interaction/enterActions/enterUrl.js +22 -17
- package/dist/automation/actions/interaction/enterActions/enterusingJs.js +19 -13
- package/dist/automation/actions/interaction/enterActions/waitAndEnter.js +33 -26
- package/dist/automation/actions/interaction/find/MOB_FindElement.js +37 -21
- package/dist/automation/actions/interaction/find/findElements.js +49 -32
- package/dist/automation/actions/interaction/get/MOB_GetADBLogsForGivenAppPackage.js +5 -6
- package/dist/automation/actions/interaction/get/MOB_GetAllContexts.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetAllWindowHandles.js +8 -9
- package/dist/automation/actions/interaction/get/MOB_GetAltitude.js +20 -10
- package/dist/automation/actions/interaction/get/MOB_GetBatteryPercentage.js +7 -9
- package/dist/automation/actions/interaction/get/MOB_GetBatteryStatus.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetClipBoardText.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentActivity.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentAppPackage.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentContext.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentDeviceDate.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentDeviceSettings.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentDeviceStatus.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentDeviceSystemBars.js +5 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentDeviceTime.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentOrientation.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentSessionId.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetDeviceLocation.js +20 -9
- package/dist/automation/actions/interaction/get/MOB_GetDeviceName.js +7 -8
- package/dist/automation/actions/interaction/get/MOB_GetDeviceOsVersion.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetDeviceUdid.js +7 -8
- package/dist/automation/actions/interaction/get/MOB_GetHeightOfElement.js +12 -11
- package/dist/automation/actions/interaction/get/MOB_GetHeightOfScreen.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetHourFromCurrentDeviceTime.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetLatitude.js +20 -12
- package/dist/automation/actions/interaction/get/MOB_GetLongitude.js +20 -12
- package/dist/automation/actions/interaction/get/MOB_GetMinuteFromCurrentDeviceTime.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetSecondFromCurrentDeviceTime.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetSizeOfScreen.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetSupportedPerformanceDataTypes.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetTextFromElementAndSetToClipBoard.js +11 -8
- package/dist/automation/actions/interaction/get/MOB_GetWidthOfElement.js +12 -11
- package/dist/automation/actions/interaction/get/MOB_GetWidthOfScreen.js +4 -6
- package/dist/automation/actions/interaction/get/browserWindowGetPosition.js +4 -4
- package/dist/automation/actions/interaction/get/getAllBrokenImages.js +4 -4
- package/dist/automation/actions/interaction/get/getAllBrokenLinkCount.js +4 -4
- package/dist/automation/actions/interaction/get/getAllBrokenLinks.js +5 -5
- package/dist/automation/actions/interaction/get/getAllConsoleErrors.js +4 -4
- package/dist/automation/actions/interaction/get/getAllConsoleInformation.js +5 -5
- package/dist/automation/actions/interaction/get/getAllConsoleLogs.js +5 -5
- package/dist/automation/actions/interaction/get/getAllConsoleWarnings.js +5 -5
- package/dist/automation/actions/interaction/get/getAllCookieNames.js +5 -5
- package/dist/automation/actions/interaction/get/getAllCookieValues.js +5 -5
- package/dist/automation/actions/interaction/get/getAllSelectedOptions.js +12 -12
- package/dist/automation/actions/interaction/get/getAllTheOptionsFromListBoxAsText.js +12 -12
- package/dist/automation/actions/interaction/get/getAllTheOptionsFromListBoxAsTextInSortedOrder.js +12 -12
- package/dist/automation/actions/interaction/get/getAllTheSelectedOptionsFromListBoxAsText.js +12 -12
- package/dist/automation/actions/interaction/get/getAllWindowHandles.js +5 -5
- package/dist/automation/actions/interaction/get/getAttribute.js +27 -25
- package/dist/automation/actions/interaction/get/getAudioCurrentPlaybackRate.js +12 -12
- package/dist/automation/actions/interaction/get/getAudioCurrentSeekTime.js +12 -12
- package/dist/automation/actions/interaction/get/getAudioCurrentVolume.js +12 -12
- package/dist/automation/actions/interaction/get/getAudioDecodedByte.js +12 -12
- package/dist/automation/actions/interaction/get/getAudioDefaultPlaybackRate.js +12 -12
- package/dist/automation/actions/interaction/get/getAudioMediaLength.js +12 -12
- package/dist/automation/actions/interaction/get/getAudioMediaSource.js +12 -12
- package/dist/automation/actions/interaction/get/getBestPracticesScore.js +4 -3
- package/dist/automation/actions/interaction/get/getBrowserCount.js +4 -4
- package/dist/automation/actions/interaction/get/getBrowserVersion.js +4 -4
- package/dist/automation/actions/interaction/get/getCapabilityNames.js +4 -4
- package/dist/automation/actions/interaction/get/getClipBoardText.js +4 -4
- package/dist/automation/actions/interaction/get/getCollectiveApiResponseTime.js +5 -4
- package/dist/automation/actions/interaction/get/getCollectiveApiStatusCode.js +5 -4
- package/dist/automation/actions/interaction/get/getCssValue.js +12 -12
- package/dist/automation/actions/interaction/get/getCurrentDayOfTheWeek.js +4 -4
- package/dist/automation/actions/interaction/get/getCurrentSecondsFromCurrentSystemTime.js +5 -5
- package/dist/automation/actions/interaction/get/getCurrentSystemDate.js +4 -4
- package/dist/automation/actions/interaction/get/getCurrentSystemDay.js +5 -5
- package/dist/automation/actions/interaction/get/getCurrentSystemMonth.js +5 -5
- package/dist/automation/actions/interaction/get/getCurrentSystemTime.js +5 -5
- package/dist/automation/actions/interaction/get/getCurrentSystemYear.js +5 -5
- package/dist/automation/actions/interaction/get/getCurrentWindowHandle.js +9 -10
- package/dist/automation/actions/interaction/get/getDataFromApiRequestHeaderForJsonPath.js +5 -4
- package/dist/automation/actions/interaction/get/getDataFromApiResponseForJsonPath.js +5 -4
- package/dist/automation/actions/interaction/get/getDateWithGivenFormat.js +5 -4
- package/dist/automation/actions/interaction/get/getDriverInstance.js +12 -11
- package/dist/automation/actions/interaction/get/getFirstContentfulPaint.js +5 -5
- package/dist/automation/actions/interaction/get/getFirstSelectedOption.js +12 -12
- package/dist/automation/actions/interaction/get/getFullPaintTime.js +5 -5
- package/dist/automation/actions/interaction/get/getHTMLCodeOfPage.js +4 -4
- package/dist/automation/actions/interaction/get/getHeightOfBrowserWindow.js +4 -4
- package/dist/automation/actions/interaction/get/getHeightOfWebElement.js +12 -12
- package/dist/automation/actions/interaction/get/getHourFromCurrentSystemTime.js +4 -4
- package/dist/automation/actions/interaction/get/getImplicitTimeOut.js +11 -10
- package/dist/automation/actions/interaction/get/getLargestContentfulPaint.js +4 -4
- package/dist/automation/actions/interaction/get/getListBoxSize.js +12 -12
- package/dist/automation/actions/interaction/get/getListOfElementsFromLocatorTypeLocatorValue.js +90 -44
- package/dist/automation/actions/interaction/get/getLocation.js +32 -31
- package/dist/automation/actions/interaction/get/getMinuteFromCurrentSystemTime.js +4 -4
- package/dist/automation/actions/interaction/get/getNetworkRouteTime.js +4 -4
- package/dist/automation/actions/interaction/get/getNumberOfBrokenImages.js +4 -4
- package/dist/automation/actions/interaction/get/getNumberOfLinksPresentInCurrentPage.js +4 -4
- package/dist/automation/actions/interaction/get/getNumberOfWorkingLinksFromCurrentPage.js +4 -4
- package/dist/automation/actions/interaction/get/getOptions.js +12 -12
- package/dist/automation/actions/interaction/get/getPageTitle.js +5 -5
- package/dist/automation/actions/interaction/get/getPerformanceMetrics.js +5 -5
- package/dist/automation/actions/interaction/get/getPwaScore.js +5 -4
- package/dist/automation/actions/interaction/get/getRect.js +26 -23
- package/dist/automation/actions/interaction/get/getScreenshot.js +12 -18
- package/dist/automation/actions/interaction/get/getScreenshotAs.js +27 -32
- package/dist/automation/actions/interaction/get/getSeoScore.js +5 -4
- package/dist/automation/actions/interaction/get/getSingleApiRequestPayload.js +7 -6
- package/dist/automation/actions/interaction/get/getSingleApiResponse.js +12 -14
- package/dist/automation/actions/interaction/get/getSingleApiResponseTime.js +13 -13
- package/dist/automation/actions/interaction/get/getSingleApiStatusCode.d.ts +1 -1
- package/dist/automation/actions/interaction/get/getSingleApiStatusCode.js +21 -17
- package/dist/automation/actions/interaction/get/getSize.js +26 -24
- package/dist/automation/actions/interaction/get/getSizeOfBrowserWindow.js +5 -5
- package/dist/automation/actions/interaction/get/getStringDataFromLocalFile.js +11 -13
- package/dist/automation/actions/interaction/get/getSystemProperty.js +7 -33
- package/dist/automation/actions/interaction/get/getTagName.js +26 -24
- package/dist/automation/actions/interaction/get/getText.js +28 -25
- package/dist/automation/actions/interaction/get/getTheFirstSelectedOptionFromListBoxAsText.js +12 -12
- package/dist/automation/actions/interaction/get/getTotalNumberOfCookies.js +5 -5
- package/dist/automation/actions/interaction/get/getTunnelIdentifier.js +5 -4
- package/dist/automation/actions/interaction/get/getURLPresentInAddressBar.js +5 -5
- package/dist/automation/actions/interaction/get/getUserHomeDirectory.js +5 -5
- package/dist/automation/actions/interaction/get/getValueByCookieName.js +7 -11
- package/dist/automation/actions/interaction/get/getValueFromLocalStorage.js +7 -10
- package/dist/automation/actions/interaction/get/getValueOfSystemVariable.js +8 -6
- package/dist/automation/actions/interaction/get/getVideoCurrentPlaybackRate.js +12 -12
- package/dist/automation/actions/interaction/get/getVideoCurrentSeekTime.js +12 -12
- package/dist/automation/actions/interaction/get/getVideoCurrentVolume.js +12 -12
- package/dist/automation/actions/interaction/get/getVideoDecodedByte.js +12 -12
- package/dist/automation/actions/interaction/get/getVideoDefaultPlaybackRate.js +12 -12
- package/dist/automation/actions/interaction/get/getVideoMediaLength.js +12 -12
- package/dist/automation/actions/interaction/get/getVideoMediaSource.js +12 -12
- package/dist/automation/actions/interaction/get/getWidthOfBrowser.js +5 -5
- package/dist/automation/actions/interaction/get/getWidthOfWebElement.js +12 -12
- package/dist/automation/actions/interaction/get/getWorkingLinksFromCurrentPage.js +5 -5
- package/dist/automation/actions/interaction/get/getWrappedElement.js +12 -12
- package/dist/automation/actions/interaction/get/getWrappedOptionFromListBoxAsText.js +14 -14
- package/dist/automation/actions/interaction/get/getXLocationOfBrowserWindow.js +5 -4
- package/dist/automation/actions/interaction/get/getXLocationOfWebElement.js +26 -24
- package/dist/automation/actions/interaction/get/getYLocationOfBrowserWindow.js +5 -5
- package/dist/automation/actions/interaction/get/getYLocationOfWebElement.js +26 -24
- package/dist/automation/actions/interaction/iframe/switchToDefaultContent.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/AirplaneModeSwitchOff.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/AirplaneModeSwitchOn.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/Break.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/Continue.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/GpsSwitchOff.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/GpsSwitchOn.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/HideKeyboard.js +13 -7
- package/dist/automation/actions/interaction/inputlessActions/LockDevice.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/OpenChromeBrowser.js +18 -6
- package/dist/automation/actions/interaction/inputlessActions/OpenNotification.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/ResetApp.js +14 -7
- package/dist/automation/actions/interaction/inputlessActions/RestartCurrentDevice.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/SetDeviceOrientationAsLandscape.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/SetDeviceOrientationAsPortrait.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/SetEmulatorPowerStateOff.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/SetEmulatorPowerStateOn.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/WifiSwitchOff.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/WifiSwitchOn.js +5 -5
- package/dist/automation/actions/interaction/maximize/maximize.js +5 -5
- package/dist/automation/actions/interaction/maximize/minimize.js +5 -5
- package/dist/automation/actions/interaction/mouse/mouseClickOnCurrentCursorNTImes.d.ts +2 -0
- package/dist/automation/actions/interaction/mouse/mouseClickOnCurrentCursorNTImes.js +31 -0
- package/dist/automation/actions/interaction/mouse/mouseClickOnCurrentCursorPoint.d.ts +2 -0
- package/dist/automation/actions/interaction/mouse/mouseClickOnCurrentCursorPoint.js +27 -0
- package/dist/automation/actions/interaction/mouse/mouseDoubleClickAtCursorPoint.d.ts +2 -0
- package/dist/automation/actions/interaction/mouse/mouseDoubleClickAtCursorPoint.js +31 -0
- package/dist/automation/actions/interaction/mouse/mouseHover.d.ts +2 -0
- package/dist/automation/actions/interaction/mouse/mouseHover.js +36 -0
- package/dist/automation/actions/interaction/mouse/mouseReleaseLeftMouseButton.d.ts +2 -0
- package/dist/automation/actions/interaction/mouse/mouseReleaseLeftMouseButton.js +42 -0
- package/dist/automation/actions/interaction/mouse/pressAndHold.d.ts +2 -0
- package/dist/automation/actions/interaction/mouse/pressAndHold.js +47 -0
- package/dist/automation/actions/interaction/navigation/goBack.js +5 -5
- package/dist/automation/actions/interaction/navigation/navigate.js +5 -4
- package/dist/automation/actions/interaction/navigation/refresh.js +5 -5
- package/dist/automation/actions/interaction/pinch/PinchInByPercentMob.js +12 -13
- package/dist/automation/actions/interaction/pinch/PinchOutByPercentMob.js +12 -11
- package/dist/automation/actions/interaction/press/longPress.js +15 -11
- package/dist/automation/actions/interaction/press/mobPressBackKey.js +4 -6
- package/dist/automation/actions/interaction/press/mobPressBackSpaceKey.js +12 -8
- package/dist/automation/actions/interaction/press/mobPressSpaceKey.js +12 -8
- package/dist/automation/actions/interaction/press/pressAnyKey.js +25 -16
- package/dist/automation/actions/interaction/press/pressAnyKeyNTimes.js +23 -14
- package/dist/automation/actions/interaction/press/pressEnterKey.js +21 -14
- package/dist/automation/actions/interaction/press/pressHomeKey.js +16 -9
- package/dist/automation/actions/interaction/scroll/scrollHorizontallyTillElementIsVisible.js +20 -15
- package/dist/automation/actions/interaction/scroll/scrollPageToSpecificLocation.js +8 -7
- package/dist/automation/actions/interaction/scroll/scrollToElement.js +18 -13
- package/dist/automation/actions/interaction/scroll/scrollVerticallyTillElementIsVisible.js +20 -15
- package/dist/automation/actions/interaction/set/MOB_SetContext.js +5 -6
- package/dist/automation/actions/interaction/set/MOB_SetEmulatorPowerPercentage.js +5 -6
- package/dist/automation/actions/interaction/set/setClipBoardText.js +13 -13
- package/dist/automation/actions/interaction/shadowDom/shadowDomClick.js +5 -4
- package/dist/automation/actions/interaction/shadowDom/shadowDomEnter.js +5 -4
- package/dist/automation/actions/interaction/shadowDom/shadowDomGetText.js +6 -5
- package/dist/automation/actions/interaction/shadowDom/shadowDomUpload.js +13 -9
- package/dist/automation/actions/interaction/shadowDom/shadowDomVerifyPartialText.js +6 -5
- package/dist/automation/actions/interaction/shadowDom/shadowDomVerifyText.js +6 -5
- package/dist/automation/actions/interaction/swipe/swipeDirectionNTimes.js +12 -10
- package/dist/automation/actions/interaction/swipe/swipeDownToElement.js +13 -10
- package/dist/automation/actions/interaction/swipe/swipeIos.d.ts +2 -0
- package/dist/automation/actions/interaction/swipe/swipeIos.js +52 -0
- package/dist/automation/actions/interaction/swipe/swipeLeftToElement.js +16 -11
- package/dist/automation/actions/interaction/swipe/swipeRightToElement.js +15 -10
- package/dist/automation/actions/interaction/swipe/swipeUpToElement.js +12 -10
- package/dist/automation/actions/interaction/swipe/swipeUpToElementForMWeb.js +16 -13
- package/dist/automation/actions/interaction/swipe/swipeUsingReferenceElement.js +19 -16
- package/dist/automation/actions/interaction/switch/switchToNewTabBasedOnTitle.js +7 -6
- package/dist/automation/actions/interaction/switch/switchToNewWindowBasedOnTitle.js +6 -5
- package/dist/automation/actions/interaction/switch/switchToParentWindow.js +6 -6
- package/dist/automation/actions/interaction/switch/switchToTabBasedOnUrl.js +6 -5
- package/dist/automation/actions/interaction/switch/switchToWindowBasedOnURL.js +5 -4
- package/dist/automation/actions/interaction/switch/switchToWindowIfTitleContainsString.js +7 -6
- package/dist/automation/actions/interaction/switch/switchToWindowIfUrlContainsString.js +6 -5
- package/dist/automation/actions/interaction/upload/uploadfile.js +21 -18
- package/dist/automation/actions/interaction/verify/MOB_VerifyBatteryLevel.js +8 -8
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfAirplaneModeOff.js +7 -7
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfAirplaneModeOn.js +7 -7
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfAppIsClosed.js +19 -10
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfDeviceIsLocked.js +7 -6
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfDeviceIsUnlocked.js +7 -7
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfGpsOff.js +12 -8
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfGpsOn.js +12 -8
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfKeyboardIsHidden.js +7 -7
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfKeyboardIsShown.js +8 -7
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfWifiOff.js +8 -7
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfWifiOn.js +8 -7
- package/dist/automation/actions/interaction/verify/VerifyAccessibilityScore.js +8 -7
- package/dist/automation/actions/interaction/verify/VerifyAllBrokenImages.js +6 -6
- package/dist/automation/actions/interaction/verify/VerifyAllBrowserWindowsClosed.js +12 -10
- package/dist/automation/actions/interaction/verify/VerifyAllOptionsAreDeSelected.js +19 -19
- package/dist/automation/actions/interaction/verify/VerifyAllOptionsAreSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyAttributeValue.js +35 -53
- package/dist/automation/actions/interaction/verify/VerifyBestPracticesScore.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyBrowserHtmlCodeContainsString.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowHeight.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowTitleContainsString.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowTitleIsString.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowUrlContainsExpectedUrl.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowUrlIsString.js +5 -4
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowWidth.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowXLocation.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowYLocation.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyCheckBoxIsNotSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyCheckBoxIsSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyCssAttributeValue.js +20 -14
- package/dist/automation/actions/interaction/verify/VerifyElementIsClickable.js +28 -25
- package/dist/automation/actions/interaction/verify/VerifyElementIsDisabled.js +29 -27
- package/dist/automation/actions/interaction/verify/VerifyElementIsDisplayed.js +26 -24
- package/dist/automation/actions/interaction/verify/VerifyElementIsEnabled.js +26 -24
- package/dist/automation/actions/interaction/verify/VerifyElementIsEnabledInSpecifiedTime.d.ts +2 -0
- package/dist/automation/actions/interaction/verify/VerifyElementIsEnabledInSpecifiedTime.js +84 -0
- package/dist/automation/actions/interaction/verify/VerifyElementIsNotDisplayed.js +51 -28
- package/dist/automation/actions/interaction/verify/VerifyElementIsSelected.js +39 -27
- package/dist/automation/actions/interaction/verify/VerifyElementIsSelectedInSpecifiedTime.d.ts +2 -0
- package/dist/automation/actions/interaction/verify/VerifyElementIsSelectedInSpecifiedTime.js +83 -0
- package/dist/automation/actions/interaction/verify/VerifyElementNotContainsText.js +23 -23
- package/dist/automation/actions/interaction/verify/VerifyHeightOfWebElement.js +23 -23
- package/dist/automation/actions/interaction/verify/VerifyHexCodeForGivenXYCoordinates.js +44 -14
- package/dist/automation/actions/interaction/verify/VerifyIfAllCookiesAreDeleted.js +4 -4
- package/dist/automation/actions/interaction/verify/VerifyIfAudioEnded.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfAudioIsMuted.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfAudioIsPaused.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfAudioIsPlaying.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfBrowserWindowIsClosed.js +8 -9
- package/dist/automation/actions/interaction/verify/VerifyIfCookieNameIsAdded.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyIfCookieNameIsDeleted.js +5 -4
- package/dist/automation/actions/interaction/verify/VerifyIfCookieObjectIsPresent.js +5 -5
- package/dist/automation/actions/interaction/verify/VerifyIfGivenOptionIsDuplicate.js +14 -14
- package/dist/automation/actions/interaction/verify/VerifyIfImageIsBroken.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyIfLinkIsBroken.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyIfLinkIsWorking.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyIfLinksAreBroken.js +5 -4
- package/dist/automation/actions/interaction/verify/VerifyIfLinksAreWorking.js +5 -4
- package/dist/automation/actions/interaction/verify/VerifyIfOptionWithIndexIsDeselectedInElement.js +13 -13
- package/dist/automation/actions/interaction/verify/VerifyIfOptionWithIndexIsSelectedInListBox.js +13 -13
- package/dist/automation/actions/interaction/verify/VerifyIfOptionWithTextIsDeselected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfOptionWithValueIsDeselected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfOptionWithValueIsSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfOptionWithVisibleTextIsSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfSpecifiedOptionIsSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfStatusCodeOfALinkIsStatusCode.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyIfStatusCodesOfLinks.js +30 -22
- package/dist/automation/actions/interaction/verify/VerifyIfVideoEnded.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfVideoIsMuted.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfVideoIsPaused.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfVideoIsPlaying.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfVideoPlayingInMute.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfVideoPlayingInUnmute.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfXAndYCoordinateOfElement.js +25 -23
- package/dist/automation/actions/interaction/verify/VerifyLinkNavigatesToTitle.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyListBoxOptionsAreSorted.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyNavigateURL.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyNumberOfElementsByTagName.js +7 -5
- package/dist/automation/actions/interaction/verify/VerifyNumberOfElementsByXpath.js +13 -7
- package/dist/automation/actions/interaction/verify/VerifyPartialAttributeValue.js +33 -42
- package/dist/automation/actions/interaction/verify/VerifyPartialTitleOfCurrentPage.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyPerformanceScore.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyPwaScore.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyRadioButtonIsNotSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyRadioButtonIsSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifySeoScore.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyTagName.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyThatSpecifiedOptionIsNotSelected.js +20 -31
- package/dist/automation/actions/interaction/verify/VerifyTitleInAllPage.js +8 -7
- package/dist/automation/actions/interaction/verify/VerifyTitleOfCurrentPage.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyValueOfElementContainsString.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyValueOfElementIsCleared.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyValueOfElementIsString.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyWidthOfElement.js +23 -23
- package/dist/automation/actions/interaction/verify/VerifyXLocationOfElement.js +23 -23
- package/dist/automation/actions/interaction/verify/VerifyYLocationOfElement.js +26 -23
- package/dist/automation/actions/interaction/verify/checkIfElementIsDisplayed.js +26 -22
- package/dist/automation/actions/interaction/verify/verifyElementIsDisplayedWithinSpecifiedTime.d.ts +2 -0
- package/dist/automation/actions/interaction/verify/verifyElementIsDisplayedWithinSpecifiedTime.js +85 -0
- package/dist/automation/actions/interaction/verify/verifypartialtext.js +28 -25
- package/dist/automation/actions/interaction/verify/verifytext.js +30 -30
- package/dist/automation/actions/interaction/wait/MOB_WaitTillAllElementsAreInvisible.ts.js +5 -6
- package/dist/automation/actions/interaction/wait/MOB_WaitTillAttributeOfElementContainsString.js +17 -14
- package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsEnabled.js +12 -11
- package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsInvisible.js +14 -12
- package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsSelected.js +12 -11
- package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsVisible.js +15 -13
- package/dist/automation/actions/interaction/wait/MOB_WaitTillStalenessOfElement.js +12 -11
- package/dist/automation/actions/interaction/wait/wait.js +5 -4
- package/dist/automation/actions/interaction/wait/waitTillAttributeOfElementIsString.js +26 -24
- package/dist/automation/actions/interaction/wait/waitTillElementContainsText.js +26 -24
- package/dist/automation/actions/interaction/wait/waitTillElementHasText.js +26 -24
- package/dist/automation/actions/interaction/wait/waitTillElementIsClickable.js +28 -25
- package/dist/automation/actions/interaction/wait/waitTillPresenceOfAllElements.js +32 -22
- package/dist/automation/actions/interaction/wait/waitTillPresenceOfElement.js +26 -24
- package/dist/automation/actions/interface/FireFlinkResponseSchema.d.ts +148 -0
- package/dist/automation/actions/interface/FireFlinkResponseSchema.js +209 -0
- package/dist/automation/actions/interface/alertActionInterface.d.ts +1 -0
- package/dist/automation/actions/interface/findActionInterface.d.ts +3 -0
- package/dist/automation/actions/interface/getActionInterface.d.ts +76 -66
- package/dist/automation/actions/interface/interactionActionInterface.d.ts +5 -0
- package/dist/automation/actions/interface/mouseActionsinterface.d.ts +51 -0
- package/dist/automation/actions/interface/mouseActionsinterface.js +2 -0
- package/dist/automation/actions/interface/pinchActionInterface.d.ts +7 -0
- package/dist/automation/actions/interface/pressActionInterface.d.ts +4 -0
- package/dist/automation/actions/interface/swipeActionInterface.d.ts +25 -10
- package/dist/automation/actions/interface/verifyActionInterface.d.ts +36 -0
- package/dist/automation/actions/interface/waitActionInterface.d.ts +19 -0
- package/dist/automation/browserSession/initiateBrowserSession.d.ts +1 -1
- package/dist/automation/browserSession/initiateBrowserSession.js +4 -4
- package/dist/automation/cloudSession/initiateCloudSession.js +3 -1
- package/dist/automation/mobileSession/initiateMobileSession.d.ts +25 -1
- package/dist/automation/mobileSession/initiateMobileSession.js +23 -10
- package/dist/core/constants/allAction.js +2 -1
- package/dist/core/constants/supportedActions.d.ts +1 -0
- package/dist/core/constants/supportedActions.js +17 -9
- package/dist/core/interfaces/actionInterface.d.ts +34 -33
- package/dist/core/interfaces/errorInfoInterface.d.ts +1 -1
- package/dist/core/interfaces/fireflinkScriptPayloadInterface.d.ts +4 -1
- package/dist/core/interfaces/llmConfigurationInterface.d.ts +3 -2
- package/dist/core/interfaces/llmResponseInterface.d.ts +10 -10
- package/dist/core/interfaces/scriptGenrationDataInterface.d.ts +14 -0
- package/dist/core/interfaces/simplifyAndFlattenInterface.d.ts +5 -0
- package/dist/core/main/actionHandlerFactory.js +134 -64
- package/dist/core/main/executionContext.d.ts +1 -1
- package/dist/core/main/executionContext.js +1 -1
- package/dist/core/main/runAutomationScript.d.ts +1 -0
- package/dist/core/main/runAutomationScript.js +209 -90
- package/dist/core/main/stepProcessor.d.ts +2 -1
- package/dist/core/main/stepProcessor.js +2 -2
- package/dist/core/types/scriptTypesType.d.ts +1 -1
- package/dist/core/types/visionllmInputType.d.ts +4 -5
- package/dist/domAnalysis/getRelaventElements.d.ts +5 -1
- package/dist/domAnalysis/getRelaventElements.js +14 -5
- package/dist/domAnalysis/relativeElementsFromDom.d.ts +2 -1
- package/dist/domAnalysis/relativeElementsFromDom.js +66 -1
- package/dist/domAnalysis/searchBest.d.ts +5 -1
- package/dist/domAnalysis/searchBest.js +153 -50
- package/dist/domAnalysis/simplifyAndFlatten.d.ts +3 -2
- package/dist/domAnalysis/simplifyAndFlatten.js +109 -16
- package/dist/fireflinkData/fireflinkLocators/getListOfLocators.js +17 -11
- package/dist/fireflinkData/fireflinkLocators/{elementsFromHTML.d.ts → parser/getElementsFromHTML.d.ts} +3 -9
- package/dist/fireflinkData/fireflinkLocators/parser/getElementsFromHTML.js +557 -0
- package/dist/fireflinkData/fireflinkLocators/types/locator.d.ts +17 -0
- package/dist/fireflinkData/fireflinkLocators/types/locator.js +2 -0
- package/dist/fireflinkData/fireflinkLocators/utils/androidSelector.d.ts +2 -0
- package/dist/fireflinkData/fireflinkLocators/utils/androidSelector.js +31 -0
- package/dist/fireflinkData/fireflinkLocators/utils/cssSelector.d.ts +19 -0
- package/dist/fireflinkData/fireflinkLocators/utils/cssSelector.js +192 -0
- package/dist/fireflinkData/fireflinkLocators/utils/iosSelector.d.ts +2 -0
- package/dist/fireflinkData/fireflinkLocators/utils/iosSelector.js +159 -0
- package/dist/fireflinkData/fireflinkLocators/utils/referenceXpath.d.ts +35 -0
- package/dist/fireflinkData/fireflinkLocators/utils/referenceXpath.js +590 -0
- package/dist/fireflinkData/fireflinkLocators/utils/xpath.d.ts +38 -0
- package/dist/fireflinkData/fireflinkLocators/utils/xpath.js +1182 -0
- package/dist/fireflinkData/fireflinkLocators/utils/xpathHelpers.d.ts +137 -0
- package/dist/fireflinkData/fireflinkLocators/utils/xpathHelpers.js +1647 -0
- package/dist/fireflinkData/fireflinkScript/appendScriptData.d.ts +2 -0
- package/dist/fireflinkData/fireflinkScript/appendScriptData.js +51 -0
- package/dist/fireflinkData/fireflinkScript/scriptGenrationData.js +4 -0
- package/dist/imageAnalysisMobile/annotatedScreenshotMobile.d.ts +4 -0
- package/dist/imageAnalysisMobile/annotatedScreenshotMobile.js +115 -7
- package/dist/imageAnalysisWeb/annotateScreenshot.js +4 -4
- package/dist/imageAnalysisWeb/generateAnnotatedScreenshots.d.ts +4 -1
- package/dist/imageAnalysisWeb/generateAnnotatedScreenshots.js +15 -17
- package/dist/llmConfig/llmConfiguration.d.ts +4 -3
- package/dist/llmConfig/llmConfiguration.js +41 -18
- package/dist/service/fireflink.service.d.ts +1 -1
- package/dist/service/fireflink.service.js +4 -4
- package/dist/tests/poc.d.ts +0 -1
- package/dist/tests/poc.js +211 -226
- package/dist/tests/test.d.ts +1 -0
- package/dist/tests/test.js +26 -0
- package/dist/tests/test12.d.ts +1 -0
- package/dist/tests/test12.js +78 -73
- package/dist/tests/testss.d.ts +1 -0
- package/dist/tests/testss.js +23 -0
- package/dist/utils/DomExtraction/jsForAttributeInjection.d.ts +2 -0
- package/dist/utils/DomExtraction/jsForAttributeInjection.js +220 -8
- package/dist/utils/InstancesDetails/getInstancesInfo.d.ts +26 -1
- package/dist/utils/InstancesDetails/getInstancesInfo.js +11 -5
- package/dist/utils/browserCap/capability.d.ts +10 -10
- package/dist/utils/browserCap/capability.js +21 -16
- package/dist/utils/frameWorkDetector/frameWorkDetector.d.ts +6 -0
- package/dist/utils/frameWorkDetector/frameWorkDetector.js +43 -0
- package/dist/utils/frameWorkDetector/frameWorkDetectorInterface.d.ts +10 -0
- package/dist/utils/frameWorkDetector/frameWorkDetectorInterface.js +2 -0
- package/dist/utils/helpers/enterActionHelper.d.ts +1 -0
- package/dist/utils/helpers/enterActionHelper.js +2 -1
- package/dist/utils/helpers/platformContext.d.ts +3 -0
- package/dist/utils/helpers/platformContext.js +11 -0
- package/dist/utils/helpers/platformSyntax.d.ts +1 -0
- package/dist/utils/helpers/platformSyntax.js +17 -0
- package/dist/utils/helpers/sameActionsHelper.js +7 -2
- package/dist/utils/helpers/xpathcreation.d.ts +5 -1
- package/dist/utils/helpers/xpathcreation.js +43 -4
- package/dist/utils/iframesExtraction/findElementUsingFF.js +12 -9
- package/dist/utils/iframesExtraction/iframeInterface.d.ts +4 -0
- package/dist/utils/javascript/jsForShadowRoot.d.ts +1 -1
- package/dist/utils/javascript/jsForShadowRoot.js +4 -0
- package/dist/utils/javascript/jsForVision.d.ts +2 -2
- package/dist/utils/javascript/jsForVision.js +17 -5
- package/dist/utils/logger/logData.d.ts +1 -0
- package/dist/utils/logger/logData.js +19 -0
- package/dist/utils/sslConfig/apiCallPatch.d.ts +1 -0
- package/dist/utils/sslConfig/apiCallPatch.js +33 -0
- package/dist/utils/sslConfig/getSecureAgent.d.ts +2 -0
- package/dist/utils/sslConfig/getSecureAgent.js +30 -0
- package/dist/utils/swipe/domSearchHelper.d.ts +1 -1
- package/dist/utils/swipe/domSearchHelper.js +43 -42
- package/dist/utils/swipe/swipeMovement.js +28 -19
- package/package.json +21 -6
- package/dist/automation/actions/interaction/get/getAudioDimension.d.ts +0 -2
- package/dist/automation/actions/interaction/get/getAudioDimension.js +0 -34
- package/dist/automation/actions/interaction/get/getAudioHeight.d.ts +0 -2
- package/dist/automation/actions/interaction/get/getAudioHeight.js +0 -30
- package/dist/automation/actions/interaction/get/getAudioWidth.d.ts +0 -2
- package/dist/automation/actions/interaction/get/getAudioWidth.js +0 -30
- package/dist/automation/actions/interaction/get/getVideoDimension.d.ts +0 -2
- package/dist/automation/actions/interaction/get/getVideoDimension.js +0 -31
- package/dist/automation/actions/interaction/get/getVideoHeight.d.ts +0 -2
- package/dist/automation/actions/interaction/get/getVideoHeight.js +0 -28
- package/dist/automation/actions/interaction/get/getVideoWidth.d.ts +0 -2
- package/dist/automation/actions/interaction/get/getVideoWidth.js +0 -28
- package/dist/fireflinkData/fireflinkLocators/elementsFromHTML.js +0 -514
- package/dist/fireflinkData/fireflinkLocators/typeList.d.ts +0 -1
- package/dist/fireflinkData/fireflinkLocators/typeList.js +0 -33
|
@@ -2,15 +2,20 @@ import { FireFlinkLLMResponse } from "../../core/types/llmResponseType.js";
|
|
|
2
2
|
import { PromptArgsMap } from "../../core/interfaces/promptInterface.js";
|
|
3
3
|
import { platform } from "../../core/types/scriptTypesType.js";
|
|
4
4
|
export declare class llmAction {
|
|
5
|
-
private client;
|
|
6
|
-
private visionClient;
|
|
7
5
|
private model;
|
|
8
6
|
private visionApiKey;
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
private apiKey;
|
|
8
|
+
private provider;
|
|
9
|
+
private serviceProvider;
|
|
10
|
+
private visionProvider;
|
|
11
|
+
constructor(apiKey: string, provider: any, model: string, visionApiKey: string, accountType: string, enterpriseConfigFile: any, serviceProvider: string);
|
|
12
|
+
getLLMResponse<K extends keyof PromptArgsMap>(platform: platform, type: K, args: PromptArgsMap[K], userInput: Record<string, any>, isVision: boolean): Promise<FireFlinkLLMResponse>;
|
|
11
13
|
private getLLMResponseText;
|
|
14
|
+
private getProviderToUse;
|
|
12
15
|
private getLLMResponseWithVision;
|
|
13
16
|
private isInvalidLLMOutput;
|
|
14
17
|
private handleKnownErrors;
|
|
15
18
|
private buildRetryFailure;
|
|
19
|
+
private extractValidatedJson;
|
|
20
|
+
private getProviderOptions;
|
|
16
21
|
}
|
|
@@ -1,65 +1,92 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.llmAction = void 0;
|
|
7
4
|
const promptRegistry_js_1 = require("../llmprompts/promptRegistry.js");
|
|
8
|
-
const openai_1 = __importDefault(require("openai"));
|
|
9
|
-
const decodeApiKey_js_1 = require("./decodeApiKey.js");
|
|
10
5
|
const userPrompt_js_1 = require("../../ai/llmprompts/userPrompts/userPrompt.js");
|
|
11
6
|
const promptType_js_1 = require("../../core/types/promptType.js");
|
|
12
7
|
const logData_js_1 = require("../../utils/logger/logData.js");
|
|
8
|
+
const ai_1 = require("ai");
|
|
9
|
+
const FireFlinkResponseSchema_js_1 = require("../../automation/actions/interface/FireFlinkResponseSchema.js");
|
|
10
|
+
const llmConfiguration_js_1 = require("../../llmConfig/llmConfiguration.js");
|
|
13
11
|
class llmAction {
|
|
14
|
-
constructor(apiKey,
|
|
15
|
-
this.
|
|
12
|
+
constructor(apiKey, provider, model, visionApiKey, accountType, enterpriseConfigFile, serviceProvider) {
|
|
13
|
+
this.apiKey = apiKey;
|
|
14
|
+
this.provider = provider;
|
|
15
|
+
this.serviceProvider = serviceProvider;
|
|
16
|
+
if (model.startsWith("publishers/google/models/")) {
|
|
17
|
+
this.model = `${model.split("/").pop()}`;
|
|
18
|
+
}
|
|
19
|
+
else if (model.startsWith("publishers/meta/models/")) {
|
|
20
|
+
this.model = `${model.split("/").pop()}`;
|
|
21
|
+
}
|
|
22
|
+
else if (model.startsWith("models/")) {
|
|
23
|
+
this.model = model.split("/").pop();
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.model = model;
|
|
27
|
+
}
|
|
16
28
|
this.visionApiKey = visionApiKey;
|
|
17
|
-
this.client = new openai_1.default({
|
|
18
|
-
apiKey: (0, decodeApiKey_js_1.decodeApiKey)(apiKey),
|
|
19
|
-
baseURL: baseURL,
|
|
20
|
-
});
|
|
21
|
-
this.visionClient = new openai_1.default({
|
|
22
|
-
apiKey: (0, decodeApiKey_js_1.decodeApiKey)(this.visionApiKey ?? "c2stcHJvai1HVTVlZGt4UDJEQXVBa29IbzB0MXdsTWFrWjljNnlQQjEtdUdGLXloZmhIclhEYnZubHo0M0l4QUoyME5Pc0hGYUw2OUFkdG5kOVQzQmxia0ZKQzUxTFJZX09aQzNzRHBOYjN5XzM5SUY4UXpBZElSU2ZBQ21wZjRtZG1OUzBlWXRhUjhudGhWdUktb2djeVBSMW1PdVpEdU83UUE="),
|
|
23
|
-
});
|
|
24
29
|
}
|
|
25
|
-
async getLLMResponse(platform, type, args, userInput) {
|
|
30
|
+
async getLLMResponse(platform, type, args, userInput, isVision) {
|
|
26
31
|
const promptBuilder = promptRegistry_js_1.prompts[platform][type];
|
|
27
32
|
const systemPrompt = await promptBuilder(args);
|
|
28
33
|
const userPrompt = userPrompt_js_1.userInputFormatters[type](userInput);
|
|
29
34
|
if (type === promptType_js_1.PromptType.VISION_PROMPT && Array.isArray(userPrompt)) {
|
|
30
|
-
return this.getLLMResponseWithVision(systemPrompt, userPrompt);
|
|
35
|
+
return this.getLLMResponseWithVision(systemPrompt, userPrompt, isVision);
|
|
31
36
|
}
|
|
32
37
|
if (typeof userPrompt !== "string") {
|
|
33
38
|
throw new Error("Invalid non-vision user prompt format");
|
|
34
39
|
}
|
|
35
|
-
return this.getLLMResponseText(systemPrompt, userPrompt);
|
|
40
|
+
return this.getLLMResponseText(platform, systemPrompt, userPrompt, type, args);
|
|
36
41
|
}
|
|
37
|
-
async getLLMResponseText(system, user) {
|
|
42
|
+
async getLLMResponseText(platform, system, user, type, args) {
|
|
38
43
|
let attempt = 0;
|
|
39
44
|
const MAX_RETRIES = 5;
|
|
40
|
-
|
|
45
|
+
const startTime = new Date().getTime();
|
|
46
|
+
const schemaToUse = (0, FireFlinkResponseSchema_js_1.getSchemaForPrompt)(type, platform, args);
|
|
41
47
|
while (attempt < MAX_RETRIES) {
|
|
42
48
|
attempt++;
|
|
43
49
|
try {
|
|
44
|
-
const response = await
|
|
45
|
-
model: this.model,
|
|
50
|
+
const response = await (0, ai_1.generateText)({
|
|
51
|
+
model: this.provider(this.model),
|
|
46
52
|
messages: [
|
|
47
53
|
{ role: "system", content: system },
|
|
48
54
|
{ role: "user", content: user },
|
|
49
55
|
],
|
|
50
|
-
|
|
56
|
+
output: ai_1.Output.object({
|
|
57
|
+
schema: schemaToUse,
|
|
58
|
+
}),
|
|
59
|
+
providerOptions: this.getProviderOptions()
|
|
51
60
|
});
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
61
|
+
const rawText = response.output;
|
|
62
|
+
const parsedContent = rawText;
|
|
63
|
+
logData_js_1.logger.info(`LLM Attempt ${attempt} - Raw Response:`, parsedContent);
|
|
64
|
+
if (this.isInvalidLLMOutput(parsedContent)) {
|
|
55
65
|
logData_js_1.logger.error(`Invalid LLM output. Retrying (${attempt})`);
|
|
56
66
|
continue;
|
|
57
67
|
}
|
|
58
|
-
|
|
59
|
-
return
|
|
68
|
+
await logData_js_1.logger.info("Time taken to get LLM response (Text):", Date.now() - startTime, "ms");
|
|
69
|
+
return {
|
|
70
|
+
...response,
|
|
71
|
+
output: parsedContent
|
|
72
|
+
};
|
|
60
73
|
}
|
|
61
74
|
catch (error) {
|
|
62
75
|
logData_js_1.logger.error(`LLM Error Attempt ${attempt}:`, error);
|
|
76
|
+
logData_js_1.logger.error(`Cause is ${error.cause}`, error.cause);
|
|
77
|
+
if (ai_1.NoObjectGeneratedError.isInstance(error) && error.text) {
|
|
78
|
+
try {
|
|
79
|
+
const recovered = this.extractValidatedJson(error.text, schemaToUse);
|
|
80
|
+
await logData_js_1.logger.info("Time taken to get LLM response (Text, recovered):", Date.now() - startTime, "ms");
|
|
81
|
+
return {
|
|
82
|
+
text: error.text,
|
|
83
|
+
output: recovered
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
catch (recoveryError) {
|
|
87
|
+
logData_js_1.logger.error(`Regex recovery also failed on attempt ${attempt}:`, recoveryError);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
63
90
|
const structuredError = this.handleKnownErrors(error);
|
|
64
91
|
if (structuredError)
|
|
65
92
|
return structuredError;
|
|
@@ -67,32 +94,82 @@ class llmAction {
|
|
|
67
94
|
}
|
|
68
95
|
return this.buildRetryFailure();
|
|
69
96
|
}
|
|
70
|
-
async
|
|
97
|
+
async getProviderToUse(isVision) {
|
|
98
|
+
if (this.serviceProvider === "DefaultFireFlink" && isVision) {
|
|
99
|
+
if (!this.visionProvider) {
|
|
100
|
+
const configProvider = new llmConfiguration_js_1.ServiceProviderProviderConfiguration();
|
|
101
|
+
this.visionProvider = await configProvider.getProvider({
|
|
102
|
+
serviceProvider: "OpenAi",
|
|
103
|
+
apiKey: this.visionApiKey,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return this.visionProvider;
|
|
107
|
+
}
|
|
108
|
+
return this.provider;
|
|
109
|
+
}
|
|
110
|
+
async getLLMResponseWithVision(system, userPrompt, isVision = false) {
|
|
71
111
|
let attempt = 0;
|
|
72
112
|
const MAX_RETRIES = 5;
|
|
73
|
-
|
|
113
|
+
let content;
|
|
114
|
+
const startTime = new Date().getTime();
|
|
115
|
+
const providerToUse = await this.getProviderToUse(isVision);
|
|
116
|
+
const modelToUse = (this.serviceProvider === "DefaultFireFlink" && isVision) ? "gpt-4.1" : this.model;
|
|
74
117
|
while (attempt < MAX_RETRIES) {
|
|
75
118
|
attempt++;
|
|
76
119
|
try {
|
|
77
|
-
const
|
|
78
|
-
|
|
120
|
+
const parts = userPrompt.map((item) => {
|
|
121
|
+
if (item.type === "input_text") {
|
|
122
|
+
return {
|
|
123
|
+
type: "text",
|
|
124
|
+
text: item.text,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
let imageValue = item.image_url;
|
|
128
|
+
if (item.image_url.startsWith("http://") || item.image_url.startsWith("https://")) {
|
|
129
|
+
imageValue = new URL(item.image_url);
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
type: "image",
|
|
133
|
+
image: imageValue,
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
const response = await (0, ai_1.generateText)({
|
|
137
|
+
model: providerToUse(modelToUse),
|
|
79
138
|
messages: [
|
|
80
139
|
{ role: "system", content: system },
|
|
81
|
-
{ role: "user", content:
|
|
140
|
+
{ role: "user", content: parts },
|
|
82
141
|
],
|
|
83
|
-
|
|
142
|
+
output: ai_1.Output.object({
|
|
143
|
+
schema: FireFlinkResponseSchema_js_1.VisionSchema,
|
|
144
|
+
}),
|
|
145
|
+
providerOptions: this.getProviderOptions()
|
|
84
146
|
});
|
|
85
|
-
|
|
86
|
-
|
|
147
|
+
content = response.output;
|
|
148
|
+
const parsedContent = content;
|
|
149
|
+
logData_js_1.logger.info(`Vision LLM Attempt ${attempt} - Raw Response:`, parsedContent);
|
|
87
150
|
if (this.isInvalidLLMOutput(content)) {
|
|
88
151
|
logData_js_1.logger.error(`Invalid Vision output. Retrying (${attempt})`);
|
|
89
152
|
continue;
|
|
90
153
|
}
|
|
91
|
-
|
|
154
|
+
await logData_js_1.logger.info("Time taken to get LLM response (vision):", Date.now() - startTime, "ms");
|
|
92
155
|
return response;
|
|
93
156
|
}
|
|
94
157
|
catch (error) {
|
|
95
|
-
logData_js_1.logger.error(`Vision LLM Error Attempt ${attempt}
|
|
158
|
+
logData_js_1.logger.error(`Vision LLM Error Attempt ${attempt}:`, error);
|
|
159
|
+
if (ai_1.NoObjectGeneratedError.isInstance(error) && error.text) {
|
|
160
|
+
try {
|
|
161
|
+
const recovered = this.extractValidatedJson(error.text, FireFlinkResponseSchema_js_1.VisionSchema);
|
|
162
|
+
logData_js_1.logger.info(`Vision LLM Attempt ${attempt} - Recovered via regex fallback:`, recovered);
|
|
163
|
+
await logData_js_1.logger.info("Time taken to get LLM response (vision, recovered):", Date.now() - startTime, "ms");
|
|
164
|
+
return {
|
|
165
|
+
text: error.text,
|
|
166
|
+
output: recovered
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
catch (recoveryError) {
|
|
170
|
+
logData_js_1.logger.error(`Regex recovery also failed on attempt ${attempt}:`, recoveryError);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
96
173
|
const structuredError = this.handleKnownErrors(error);
|
|
97
174
|
if (structuredError)
|
|
98
175
|
return structuredError;
|
|
@@ -148,5 +225,64 @@ class llmAction {
|
|
|
148
225
|
rawError: "Max retry limit reached",
|
|
149
226
|
};
|
|
150
227
|
}
|
|
228
|
+
extractValidatedJson(rawText, schemaToUse) {
|
|
229
|
+
const trimmed = rawText.trim();
|
|
230
|
+
const jsonMatch = trimmed.match(/\{[\s\S]*\}/);
|
|
231
|
+
if (!jsonMatch) {
|
|
232
|
+
throw new Error("No JSON object found in LLM response");
|
|
233
|
+
}
|
|
234
|
+
const parsedJson = JSON.parse(jsonMatch[0]);
|
|
235
|
+
return schemaToUse.parse(parsedJson);
|
|
236
|
+
}
|
|
237
|
+
getProviderOptions() {
|
|
238
|
+
switch (this.serviceProvider) {
|
|
239
|
+
case "OpenAI":
|
|
240
|
+
return {
|
|
241
|
+
openai: {
|
|
242
|
+
reasoningEffort: "low",
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
case "Anthropic":
|
|
246
|
+
return {
|
|
247
|
+
anthropic: {
|
|
248
|
+
effort: "low",
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
case "Gemini":
|
|
252
|
+
if (this.model.startsWith("gemini-2")) {
|
|
253
|
+
return {
|
|
254
|
+
google: {
|
|
255
|
+
thinkingConfig: {
|
|
256
|
+
thinkingBudget: 128,
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
if (this.model.startsWith("gemini-3")) {
|
|
262
|
+
return {
|
|
263
|
+
google: {
|
|
264
|
+
thinkingConfig: {
|
|
265
|
+
thinkingLevel: "low",
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
return {};
|
|
271
|
+
case "Groq":
|
|
272
|
+
return {
|
|
273
|
+
groq: {
|
|
274
|
+
reasoningEffort: "low",
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
case "Azure_AI":
|
|
278
|
+
return {
|
|
279
|
+
openai: {
|
|
280
|
+
reasoningEffort: "low",
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
default:
|
|
284
|
+
return {};
|
|
285
|
+
}
|
|
286
|
+
}
|
|
151
287
|
}
|
|
152
288
|
exports.llmAction = llmAction;
|
|
@@ -19,25 +19,37 @@ class LLMResultParser {
|
|
|
19
19
|
throw llmOutput;
|
|
20
20
|
}
|
|
21
21
|
try {
|
|
22
|
-
|
|
22
|
+
let content;
|
|
23
|
+
if (llmOutput?.output) {
|
|
24
|
+
content = llmOutput?.output;
|
|
25
|
+
}
|
|
26
|
+
else if (llmOutput?.output_text) {
|
|
27
|
+
content = llmOutput?.output_text;
|
|
28
|
+
}
|
|
23
29
|
if (!content) {
|
|
24
30
|
throw new Error("No content in LLM output");
|
|
25
31
|
}
|
|
32
|
+
// if (typeof content === "string") {
|
|
33
|
+
// content = content
|
|
34
|
+
// .replace(/^[\s\S]*?(?=\{)|(?<=\})[\s\S]*$/g, "")
|
|
35
|
+
// .trim();
|
|
36
|
+
// }
|
|
26
37
|
let parsedContent;
|
|
27
38
|
try {
|
|
28
39
|
parsedContent = JSON.parse(content);
|
|
29
40
|
}
|
|
30
41
|
catch {
|
|
31
|
-
const extracted = this.extractJsonObject(content);
|
|
32
|
-
if (!
|
|
42
|
+
// const extracted = this.extractJsonObject(content);
|
|
43
|
+
if (!content) {
|
|
33
44
|
throw new Error("Could not extract valid JSON from LLM response");
|
|
34
45
|
}
|
|
35
|
-
parsedContent =
|
|
46
|
+
parsedContent = content;
|
|
36
47
|
}
|
|
37
48
|
const usage = llmOutput?.usage ?? {};
|
|
38
|
-
this.inputTokens += Number(usage.
|
|
39
|
-
this.outputTokens += Number(usage.
|
|
49
|
+
this.inputTokens += Number(usage.input_tokens ?? 0);
|
|
50
|
+
this.outputTokens += Number(usage.output_tokens ?? 0);
|
|
40
51
|
this.totalTokens += Number(usage.total_tokens ?? 0);
|
|
52
|
+
// logger.info(`tokens : ${usage.output_tokens} + ${usage.input_tokens} = ${usage.total_tokens}`);
|
|
41
53
|
// logger.info(`Total tokens for this call is : ${usage.total_tokens}`);
|
|
42
54
|
return { response: parsedContent };
|
|
43
55
|
}
|
|
@@ -39,5 +39,16 @@ exports.prompts = {
|
|
|
39
39
|
getActionExtractorPrompt: getActionExtractorPromptMob_js_1.getActionExtractorPromptMob,
|
|
40
40
|
combinedActionExtractorPrompt: combinedActionExtractorPromptMob_js_1.combinedActionExtractorPromptMob,
|
|
41
41
|
waitActionExtractorPrompt: waitActionExtractorPromptMob_js_1.waitActionExtractorPromptMob,
|
|
42
|
+
},
|
|
43
|
+
ios: {
|
|
44
|
+
userStoryToList: userStoryToListPrompt_js_1.androidbuildStepExtractionPrompt,
|
|
45
|
+
keywordExtractorPrompt: mobileKeywordExtractor_js_1.keywordExtractorMobile,
|
|
46
|
+
errorDescriptionPrompt: errorDescriptionPrompt_js_1.buildErrorDescriptionPrompt,
|
|
47
|
+
ffInspectorNumExtractor: fireflinkElementIndexExtractor_Mob_js_1.ffInspectorNumExtractorMob,
|
|
48
|
+
verifyActionExtractorPrompt: verifyActionExtractorPromptMob_js_1.verifyActionExtractorPromptMob,
|
|
49
|
+
visionPrompt: visionPromptMobile_js_1.visionPromptMobile,
|
|
50
|
+
getActionExtractorPrompt: getActionExtractorPromptMob_js_1.getActionExtractorPromptMob,
|
|
51
|
+
combinedActionExtractorPrompt: combinedActionExtractorPromptMob_js_1.combinedActionExtractorPromptMob,
|
|
52
|
+
waitActionExtractorPrompt: waitActionExtractorPromptMob_js_1.waitActionExtractorPromptMob,
|
|
42
53
|
}
|
|
43
54
|
};
|
|
@@ -2,35 +2,44 @@
|
|
|
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"];
|
|
5
|
+
const allowedActions = ["enter", "wait", "verify", "scroll", "navigate", "navigateBack", "click", "maximize", "minimize", "get", "upload", "close", "open", "drag_and_drop", "switch", "cleartext", "notwebopenaction", "mouseAction"];
|
|
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.
|
|
9
9
|
Rules:
|
|
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
|
+
- If an element type is mentioned (e.g., icon, button, dropdown, text) in step.You should not add type is not mentioned in step , generate two keywords:
|
|
14
|
+
First keyword must be the pure element name
|
|
15
|
+
Second keyword should combine element name + type
|
|
16
|
+
Example: "click on x icon" → "x", "x icon"
|
|
17
|
+
- When a step contains two elements connected by a positional or relational phrase, keywords MUST contain at least one keyword from each element (reference and targe). Never omit the reference element. Example: "Click on x above y" → ["x", "y"].
|
|
18
|
+
- 3 to 5 keywords maximum. dont give more than 5 keywords. and no need for casesensitive.
|
|
19
|
+
- 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
|
+
example: step open browser,x:\\x\\x\\x,default -> ["path:c:\\x\\x\\x","profile:default"]
|
|
21
|
+
- 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.
|
|
22
|
+
- 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 source and the selected value (example: select 'x' in 'y' → "y", "x"), ensuring both are meaningful.
|
|
13
24
|
- If the step is about entering text or Uploading file, Should NOT include input value from the step into keywords.
|
|
14
25
|
- If the step has words like tag name audio, video, image,svg, checkbox etc, include them in the keywords.
|
|
15
|
-
- If icon is metioned in step than 'svg' should add in keywords and for Upload action first keyword should be 'file'.
|
|
16
|
-
- First keywords should be from step next Keywords must be distinct and based on the element's label meaning only.
|
|
17
|
-
- If a keyword contains exactly two words, you MUST always include both the spaced and concatenated (no-space) versions; omission of either is invalid.
|
|
26
|
+
- **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].**
|
|
18
27
|
- Do NOT split single-word keywords and do NOT include relation terms (above, below, next to, etc.) in keywords.
|
|
19
|
-
- Treat each keyword independently
|
|
20
|
-
- Example: Click on Sign In above Create Account button → ["Sign In", "SignIn", "Create Account", "CreateAccount"] never break kewword like ["create", "account"]
|
|
28
|
+
- Treat each keyword independently never merge different keywords.
|
|
21
29
|
- Keywords can be string or number if the step contains a number ,add it also as keyword.
|
|
22
30
|
- Do Not include any other unrelated keywords for step.
|
|
23
31
|
- Do NOT include generic UI words (button, field, etc) and action words (tap, click, press, etc).
|
|
24
32
|
- Do NOT include status/technical words (displayed, enabled, authenticate, visible).
|
|
25
|
-
- If an element label contains multiple words (e.g., "Sign In", "Add to Cart"), keep them together as ONE keyword like ["Sign In", "SignIn", "Add to Cart", "AddToCart"] and Never split them and also for keywords you generated, should not split them like ["sign", "in","add","to","cart"].
|
|
26
33
|
- 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.
|
|
27
|
-
- action
|
|
34
|
+
- Set action to notwebopenaction only when the instruction is related to a desktop application, mobile application, app, application, installed package, or bundle .
|
|
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.
|
|
36
|
+
- If mouse action related step is there select mouseAction from the allowed actions list check for the step and provide it.
|
|
28
37
|
- 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'
|
|
29
38
|
- 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".
|
|
30
39
|
Navigate action is allowed only when the step intent is purely navigation (e.g., "Navigate to URL").
|
|
31
40
|
If the step includes verification intent (verify/check/confirm/etc), you MUST return "verify" and MUST NOT return "navigate".
|
|
32
41
|
only give navigate action if step has only navigate action.
|
|
33
|
-
|
|
42
|
+
- Return ONLY a valid JSON object; the response must start with '{' and end with '}', with no markdown, code fences, explanations, or extra text.
|
|
34
43
|
Respond only with JSON using this format:
|
|
35
44
|
{
|
|
36
45
|
"keywords": [key1,key2,key3,key4,key5],
|
|
@@ -12,23 +12,24 @@ Select the perfect matching NLP name from the list that best fits the step's int
|
|
|
12
12
|
|
|
13
13
|
Return **only valid JSON** in the following format:
|
|
14
14
|
{
|
|
15
|
-
"
|
|
15
|
+
"attributeValue": "Fire-Flink-x",
|
|
16
16
|
"nlpName": "x",
|
|
17
|
-
"
|
|
17
|
+
"inputText":"x",
|
|
18
18
|
"keyword": "x",
|
|
19
|
-
"
|
|
19
|
+
"elementType": "x",
|
|
20
20
|
"keycode": "x"
|
|
21
21
|
}
|
|
22
22
|
Rules:
|
|
23
23
|
- nlpName must be exactly one from the provided list.
|
|
24
24
|
- Use context from the steps : ${priorAndNextSteps}, keyword and json to search for FF-inspecter.
|
|
25
25
|
- **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or attributes best match the step.**
|
|
26
|
-
- If step has mutipul inputs add all in
|
|
27
|
-
- Extract
|
|
26
|
+
- If step has mutipul inputs add all in inputText and all matched attributeValue also.
|
|
27
|
+
- Extract inputText from the step, if you can't find any input text in the step, return keyword as inputText.input can be number, app package, apk file path.dont include extra words.
|
|
28
28
|
- Extract keyword from the step, if the step contains any keyword.
|
|
29
29
|
- Extract keycode of keys if the step contains any key name like ENTER,SPACE,BACKSPACE etc and give keycode of the given key.
|
|
30
|
-
- Use the closest semantic match for the step; return
|
|
30
|
+
- Use the closest semantic match for the step; return attributeValue as Fire-Flink-0, only if nothing is found.
|
|
31
31
|
- 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'.
|
|
32
|
+
- Return ONLY a valid JSON object; the response must start with '{' and end with '}', with no markdown, code fences, explanations, or extra text.
|
|
32
33
|
- Respond with valid JSON only.
|
|
33
34
|
`;
|
|
34
35
|
return prompt;
|
|
@@ -6,43 +6,44 @@ async function combinedActionExtractorPromptMob({ extractedDomJson, priorAndNext
|
|
|
6
6
|
"MOB_IsAppInstalled","MOB_SetEmulatorPowerPercentage","MOB_ReceiveMessageOnEmulator","MOB_UninstallAPK",
|
|
7
7
|
"MOB_InstallAPK","MOB_SetClipBoardText","MOB_PressAnyKeyNTimes",
|
|
8
8
|
"MOB_SetContext","MOB_TerminateAppUsingAppPackage","MOB_OpenAppWithApkFilePath","MOB_ActivateAppUsingAppPackage",
|
|
9
|
-
"MOB_ExecuteJavaScript","MOB_LongPress","
|
|
10
|
-
"
|
|
9
|
+
"MOB_ExecuteJavaScript","MOB_LongPress","MOB_EnterInputIntoElementFromClipBoard",
|
|
10
|
+
"MOB_OpenNotification","MOB_PressEnterKey","MOB_ResetApp","MOB_HideKeyboard",
|
|
11
11
|
"MOB_SetEmulatorPowerStateOff","MOB_OpenChromeBrowser","MOB_SetDeviceOrientationAsPortrait","MOB_SetDeviceOrientationAsLandscape",
|
|
12
12
|
"MOB_SetEmulatorPowerStateOn","MOB_AirplaneModeSwitchOn","MOB_LockDevice","MOB_WifiSwitchOff",
|
|
13
13
|
"Continue","MOB_GpsSwitchOn","MOB_GpsSwitchOff","MOB_RestartCurrentDevice","MOB_AirplaneModeSwitchOff","Break","MOB_WifiSwitchOn",
|
|
14
|
-
"MOB_PinchInByPercent","MOB_PinchOutByPercent","MOB_Click",
|
|
14
|
+
"MOB_PinchInByPercent","MOB_PinchOutByPercent","MOB_Click","MOB_FindElement","MOB_FindElements",
|
|
15
15
|
"MOB_CreateCapabilitiesInstance","MOB_PressAnyKey","MOB_PressBackSpaceKey","MOB_PressSpaceKey","MOB_RunAppInBackground",
|
|
16
16
|
"MOB_SetAppiumDriverSettings","MOB_SetDriverInstance","MOB_SetImplicitTimeOut",
|
|
17
17
|
"MOB_TakeScreenShotAndCompareWithImage","MOB_TakeScreenshotAndCompareSectionWithImage","MOB_TakeScreenshotAndCompareWithImageIgnoringSpecifiedSection"`;
|
|
18
18
|
const elementType = ["link", "textfield", "icon", "button", "radiobutton", "checkbox", "tab", "action overflow button", "hamburger menu", "toggle button", "steppers", "sliders"];
|
|
19
19
|
const prompt = `
|
|
20
20
|
You are an intelligent assistant that extracts structured UI action data.
|
|
21
|
-
Given the step, the simplified DOM: ${extractedDomJson}, and the
|
|
21
|
+
Given the step, the simplified DOM: ${extractedDomJson}, and the nlpList: ${nlpList}.
|
|
22
22
|
|
|
23
|
-
Select the perfect matching NLP name from the
|
|
23
|
+
**Select the perfect matching NLP name from the nlpList that best fits and matches the user given step.**
|
|
24
24
|
if step has only word continue or break then return nlpName as continue or break only if they dont have any action in step.
|
|
25
25
|
|
|
26
26
|
Return **only valid JSON** in the following format:
|
|
27
27
|
{
|
|
28
|
-
"
|
|
28
|
+
"attributeValue": "Fire-Flink-x",
|
|
29
29
|
"nlpName": "x",
|
|
30
|
-
"
|
|
30
|
+
"inputText":"x",
|
|
31
31
|
"keyword": "x",
|
|
32
32
|
"elementType": "x",
|
|
33
|
-
"
|
|
33
|
+
"keyCode": "x"
|
|
34
34
|
}
|
|
35
35
|
Rules:
|
|
36
36
|
- nlpName must be exactly one from the provided list.
|
|
37
37
|
- Use context from the steps : ${priorAndNextSteps}, keyword and json to search for FF-inspecter.
|
|
38
38
|
- **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or attributes best match the step.**
|
|
39
|
-
- If step has mutipul inputs add all in
|
|
40
|
-
- Extract
|
|
39
|
+
- If step has mutipul inputs add all in inputText and all matched attributeValue also.
|
|
40
|
+
- **Extract inputText from the step, if you can't find any input text in the ste,input can be number or app package or bundle id or apk file path and if anything mentioned in string consider it as input text.dont include extra words.**
|
|
41
41
|
- Extract keyword from the step, if the step contains any keyword.
|
|
42
42
|
- Extract keycode of keys if the step contains any key name like ENTER,SPACE,BACKSPACE etc and give keycode of the given key.
|
|
43
|
-
- Use the closest semantic match for the step; return
|
|
44
|
-
- Based on step give most relevant type of element. use this list to choose
|
|
45
|
-
- If the steps is to find elements then provide nlpName as
|
|
43
|
+
- Use the closest semantic match for the step; return attributeValue as Fire-Flink-0, only if nothing is found.
|
|
44
|
+
- Based on step give most relevant type of element. use this list to choose elementType: ${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'.
|
|
45
|
+
- If the steps is to find elements then provide nlpName as MOB_FindElements and if the step is to find element then provide nlpName as MOB_FindElement.
|
|
46
|
+
- Return ONLY a valid JSON object; the response must start with '{' and end with '}', with no markdown, code fences, explanations, or extra text.
|
|
46
47
|
- Respond with valid json only.
|
|
47
48
|
`;
|
|
48
49
|
return prompt;
|
|
@@ -9,6 +9,8 @@ SYSTEM CONTEXT:
|
|
|
9
9
|
- The underlying automation framework must NEVER be mentioned.
|
|
10
10
|
- The tone must be professional, clear, and user-friendly.
|
|
11
11
|
- Do NOT expose internal technical details.
|
|
12
|
+
- IF error message contains a custom error message, error and errorDescription should be based on that custom error message.
|
|
13
|
+
- If error is based on llm response error or llm related error than error and errorDescription should be based on that context.
|
|
12
14
|
|
|
13
15
|
ERROR NORMALIZATION:
|
|
14
16
|
- Convert the failure into the closest equivalent Selenium-style exception class name.
|
|
@@ -30,7 +32,7 @@ STRICT OUTPUT RULES:
|
|
|
30
32
|
Return a JSON object with EXACTLY these keys:
|
|
31
33
|
|
|
32
34
|
1. "error":
|
|
33
|
-
- A concise, single-line, selenium exception name or appium exception name (error).__name__ (e.g., "InvalidSessionIdException", "NoSuchElementException", "WebDriverException","ElementNotInteractableException" etc) expamle: if error is element not found, return "NoSuchElementException"
|
|
35
|
+
- A concise, single-line, selenium exception name or appium exception name (error).__name__ (e.g., "InvalidSessionIdException", "NoSuchElementException", "WebDriverException","ElementNotInteractableException" etc) expamle: if error is element not found, return "NoSuchElementException" and for device not found or error relatd to appium server connection or related to app package or incorrect adb path return "WebDriverException".
|
|
34
36
|
- Must contain ONLY a single Selenium-style exception class name.
|
|
35
37
|
- Do NOT include additional words.
|
|
36
38
|
|
|
@@ -40,9 +42,9 @@ Return a JSON object with EXACTLY these keys:
|
|
|
40
42
|
- Avoid words like "system", "framework", or "process".
|
|
41
43
|
- Describe the issue as a general situation, not from a system perspective.
|
|
42
44
|
- Provide realistic possible causes based on the exception type.
|
|
43
|
-
- Keep it concise and non-repetitive.
|
|
44
|
-
|
|
45
|
-
Required JSON format:
|
|
45
|
+
- Keep it concise and non-repetitive. and should be exactly 40 words no more or no less.
|
|
46
|
+
- Return ONLY a valid JSON object; the response must start with '{' and end with '}', with no markdown, code fences, explanations, or extra text.
|
|
47
|
+
Required JSON format:
|
|
46
48
|
|
|
47
49
|
{
|
|
48
50
|
"error": "",
|