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.
- package/.env +1 -0
- package/.husky/pre-commit +5 -0
- package/ARCHITECTURE.md +6 -3
- package/Note.md +7 -0
- package/RELEASE_GUIDE.md +1 -1
- package/bitbucket-pipelines.yml +4 -25
- package/eslint.config.ts +4 -0
- package/package.json +21 -9
- package/src/ai/llmcalls/decodeApiKey.ts +1 -1
- package/src/ai/llmcalls/llmAction.ts +154 -47
- package/src/ai/llmprompts/llmPromptTypes/systemPromptTypes.ts +45 -0
- package/src/ai/llmprompts/promptRegistry.ts +34 -8
- package/src/ai/llmprompts/systemPrompts/actionExtractorPrompt.ts +4 -7
- package/src/ai/llmprompts/systemPrompts/combinedActionExtractorPrompt.ts +41 -0
- package/src/ai/llmprompts/systemPrompts/combinedActionExtractorPromptMob.ts +53 -0
- package/src/ai/llmprompts/systemPrompts/errorDescriptionPrompt.ts +43 -14
- package/src/ai/llmprompts/systemPrompts/fireflinkElementIndexExtactors.ts +111 -36
- package/src/ai/llmprompts/systemPrompts/fireflinkElementIndexExtractor_Mob.ts +53 -0
- package/src/ai/llmprompts/systemPrompts/getActionExtractorPrompt.ts +62 -0
- package/src/ai/llmprompts/systemPrompts/getActionExtractorPromptMob.ts +54 -0
- package/src/ai/llmprompts/systemPrompts/mobileKeywordExtractor.ts +39 -0
- package/src/ai/llmprompts/systemPrompts/userStoryToListPrompt.ts +48 -11
- package/src/ai/llmprompts/systemPrompts/verifyActionExtractorPrompt.ts +82 -0
- package/src/ai/llmprompts/systemPrompts/verifyActionExtractorPromptMob.ts +58 -0
- package/src/ai/llmprompts/systemPrompts/visionPrompt.ts +8 -14
- package/src/ai/llmprompts/systemPrompts/visionPromptMobile.ts +25 -0
- package/src/ai/llmprompts/systemPrompts/waitActionExtractorPrompt.ts +65 -0
- package/src/ai/llmprompts/systemPrompts/waitActionExtractorPromptMob.ts +45 -0
- package/src/ai/llmprompts/userPrompts/userPrompt.ts +28 -4
- package/src/automation/actions/executor.ts +4478 -48
- package/src/automation/actions/interaction/alert/clickCancelOnAlertPopup.ts +21 -0
- package/src/automation/actions/interaction/alert/clickOkOnAlertPopup.ts +20 -0
- package/src/automation/actions/interaction/alert/enterDataToAlert.ts +20 -0
- package/src/automation/actions/interaction/alert/getTextPresentOnAlertPopup.ts +19 -0
- package/src/automation/actions/interaction/alert/verifyAlertPopUpMessageContainsString.ts +32 -0
- package/src/automation/actions/interaction/alert/verifyAlertPopupIsDisplayed.ts +19 -0
- package/src/automation/actions/interaction/alert/verifyTextPresentOnAlertPopup.ts +33 -0
- package/src/automation/actions/interaction/alert/waitTillAlertIsPresent.ts +25 -0
- package/src/automation/actions/interaction/clear/clear.ts +61 -0
- package/src/automation/actions/interaction/clear/clearAndEnter.ts +58 -0
- package/src/automation/actions/interaction/click/click.ts +61 -0
- package/src/automation/actions/interaction/click/clickNtimes.ts +67 -0
- package/src/automation/actions/interaction/click/clickUsingJs.ts +33 -0
- package/src/automation/actions/interaction/click/doubleClick.ts +66 -0
- package/src/automation/actions/interaction/click/rightClick.ts +29 -0
- package/src/automation/actions/interaction/click/waitAndClick.ts +83 -0
- package/src/automation/actions/interaction/dragAndDrop/dragAndDrop.ts +46 -0
- package/src/automation/actions/interaction/enterActions/enterInput.ts +81 -0
- package/src/automation/actions/interaction/enterActions/enterInputAndPress.ts +134 -0
- package/src/automation/actions/interaction/enterActions/enterUrl.ts +52 -0
- package/src/automation/actions/interaction/enterActions/enterusingJs.ts +41 -0
- package/src/automation/actions/interaction/enterActions/waitAndEnter.ts +106 -0
- package/src/automation/actions/interaction/find/findElements.ts +57 -0
- package/src/automation/actions/interaction/get/browserWindowGetPosition.ts +15 -0
- package/src/automation/actions/interaction/get/getAllBrokenImages.ts +16 -0
- package/src/automation/actions/interaction/get/getAllBrokenLinkCount.ts +17 -0
- package/src/automation/actions/interaction/get/getAllBrokenLinks.ts +16 -0
- package/src/automation/actions/interaction/get/getAllConsoleErrors.ts +16 -0
- package/src/automation/actions/interaction/get/getAllConsoleInformation.ts +16 -0
- package/src/automation/actions/interaction/get/getAllConsoleLogs.ts +16 -0
- package/src/automation/actions/interaction/get/getAllConsoleWarnings.ts +18 -0
- package/src/automation/actions/interaction/get/getAllCookieNames.ts +16 -0
- package/src/automation/actions/interaction/get/getAllCookieValues.ts +16 -0
- package/src/automation/actions/interaction/get/getAllSelectedOptions.ts +43 -0
- package/src/automation/actions/interaction/get/getAllTheOptionsFromListBoxAsText.ts +46 -0
- package/src/automation/actions/interaction/get/getAllTheOptionsFromListBoxAsTextInSortedOrder.ts +54 -0
- package/src/automation/actions/interaction/get/getAllTheSelectedOptionsFromListBoxAsText.ts +43 -0
- package/src/automation/actions/interaction/get/getAllWindowHandles.ts +18 -0
- package/src/automation/actions/interaction/get/getAttribute.ts +83 -0
- package/src/automation/actions/interaction/get/getAudioCurrentPlaybackRate.ts +35 -0
- package/src/automation/actions/interaction/get/getAudioCurrentSeekTime.ts +36 -0
- package/src/automation/actions/interaction/get/getAudioCurrentVolume.ts +36 -0
- package/src/automation/actions/interaction/get/getAudioDecodedByte.ts +43 -0
- package/src/automation/actions/interaction/get/getAudioDefaultPlaybackRate.ts +36 -0
- package/src/automation/actions/interaction/get/getAudioDimension.ts +43 -0
- package/src/automation/actions/interaction/get/getAudioHeight.ts +38 -0
- package/src/automation/actions/interaction/get/getAudioMediaLength.ts +34 -0
- package/src/automation/actions/interaction/get/getAudioMediaSource.ts +44 -0
- package/src/automation/actions/interaction/get/getAudioWidth.ts +38 -0
- package/src/automation/actions/interaction/get/getBestPracticesScore.ts +20 -0
- package/src/automation/actions/interaction/get/getBrowserCount.ts +17 -0
- package/src/automation/actions/interaction/get/getBrowserVersion.ts +16 -0
- package/src/automation/actions/interaction/get/getCapabilityNames.ts +18 -0
- package/src/automation/actions/interaction/get/getClipBoardText.ts +16 -0
- package/src/automation/actions/interaction/get/getCollectiveApiResponseTime.ts +27 -0
- package/src/automation/actions/interaction/get/getCollectiveApiStatusCode.ts +29 -0
- package/src/automation/actions/interaction/get/getCssValue.ts +38 -0
- package/src/automation/actions/interaction/get/getCurrentDayOfTheWeek.ts +18 -0
- package/src/automation/actions/interaction/get/getCurrentSecondsFromCurrentSystemTime.ts +19 -0
- package/src/automation/actions/interaction/get/getCurrentSystemDate.ts +18 -0
- package/src/automation/actions/interaction/get/getCurrentSystemDay.ts +16 -0
- package/src/automation/actions/interaction/get/getCurrentSystemMonth.ts +16 -0
- package/src/automation/actions/interaction/get/getCurrentSystemTime.ts +18 -0
- package/src/automation/actions/interaction/get/getCurrentSystemYear.ts +18 -0
- package/src/automation/actions/interaction/get/getCurrentWindowHandle.ts +36 -0
- package/src/automation/actions/interaction/get/getDataFromApiRequestHeaderForJsonPath.ts +21 -0
- package/src/automation/actions/interaction/get/getDataFromApiResponseForJsonPath.ts +21 -0
- package/src/automation/actions/interaction/get/getDateWithGivenFormat.ts +35 -0
- package/src/automation/actions/interaction/get/getDriverInstance.ts +35 -0
- package/src/automation/actions/interaction/get/getFirstContentfulPaint.ts +16 -0
- package/src/automation/actions/interaction/get/getFirstSelectedOption.ts +44 -0
- package/src/automation/actions/interaction/get/getFullPaintTime.ts +16 -0
- package/src/automation/actions/interaction/get/getHTMLCodeOfPage.ts +18 -0
- package/src/automation/actions/interaction/get/getHeightOfBrowserWindow.ts +18 -0
- package/src/automation/actions/interaction/get/getHeightOfWebElement.ts +36 -0
- package/src/automation/actions/interaction/get/getHourFromCurrentSystemTime.ts +18 -0
- package/src/automation/actions/interaction/get/getImplicitTimeOut.ts +36 -0
- package/src/automation/actions/interaction/get/getLargestContentfulPaint.ts +16 -0
- package/src/automation/actions/interaction/get/getListBoxSize.ts +41 -0
- package/src/automation/actions/interaction/get/getListOfElementsFromLocatorTypeLocatorValue.ts +63 -0
- package/src/automation/actions/interaction/get/getLocation.ts +68 -0
- package/src/automation/actions/interaction/get/getMinuteFromCurrentSystemTime.ts +18 -0
- package/src/automation/actions/interaction/get/getNetworkRouteTime.ts +16 -0
- package/src/automation/actions/interaction/get/getNumberOfBrokenImages.ts +16 -0
- package/src/automation/actions/interaction/get/getNumberOfLinksPresentInCurrentPage.ts +18 -0
- package/src/automation/actions/interaction/get/getNumberOfWorkingLinksFromCurrentPage.ts +15 -0
- package/src/automation/actions/interaction/get/getOptions.ts +35 -0
- package/src/automation/actions/interaction/get/getPageTitle.ts +18 -0
- package/src/automation/actions/interaction/get/getPerformanceMetrics.ts +15 -0
- package/src/automation/actions/interaction/get/getPwaScore.ts +20 -0
- package/src/automation/actions/interaction/get/getRect.ts +87 -0
- package/src/automation/actions/interaction/get/getScreenshot.ts +41 -0
- package/src/automation/actions/interaction/get/getScreenshotAs.ts +64 -0
- package/src/automation/actions/interaction/get/getSeoScore.ts +20 -0
- package/src/automation/actions/interaction/get/getSingleApiRequestPayload.ts +22 -0
- package/src/automation/actions/interaction/get/getSingleApiResponse.ts +30 -0
- package/src/automation/actions/interaction/get/getSingleApiResponseTime.ts +28 -0
- package/src/automation/actions/interaction/get/getSingleApiStatusCode.ts +32 -0
- package/src/automation/actions/interaction/get/getSize.ts +68 -0
- package/src/automation/actions/interaction/get/getSizeOfBrowserWindow.ts +17 -0
- package/src/automation/actions/interaction/get/getStringDataFromLocalFile.ts +25 -0
- package/src/automation/actions/interaction/get/getSystemProperty.ts +46 -0
- package/src/automation/actions/interaction/get/getTagName.ts +67 -0
- package/src/automation/actions/interaction/get/getText.ts +68 -0
- package/src/automation/actions/interaction/get/getTheFirstSelectedOptionFromListBoxAsText.ts +44 -0
- package/src/automation/actions/interaction/get/getTotalNumberOfCookies.ts +16 -0
- package/src/automation/actions/interaction/get/getTunnelIdentifier.ts +25 -0
- package/src/automation/actions/interaction/get/getURLPresentInAddressBar.ts +18 -0
- package/src/automation/actions/interaction/get/getUserHomeDirectory.ts +16 -0
- package/src/automation/actions/interaction/get/getValueByCookieName.ts +27 -0
- package/src/automation/actions/interaction/get/getValueFromLocalStorage.ts +26 -0
- package/src/automation/actions/interaction/get/getValueOfSystemVariable.ts +20 -0
- package/src/automation/actions/interaction/get/getVideoCurrentPlaybackRate.ts +36 -0
- package/src/automation/actions/interaction/get/getVideoCurrentSeekTime.ts +36 -0
- package/src/automation/actions/interaction/get/getVideoCurrentVolume.ts +36 -0
- package/src/automation/actions/interaction/get/getVideoDecodedByte.ts +52 -0
- package/src/automation/actions/interaction/get/getVideoDefaultPlaybackRate.ts +36 -0
- package/src/automation/actions/interaction/get/getVideoDimension.ts +40 -0
- package/src/automation/actions/interaction/get/getVideoHeight.ts +36 -0
- package/src/automation/actions/interaction/get/getVideoMediaLength.ts +36 -0
- package/src/automation/actions/interaction/get/getVideoMediaSource.ts +46 -0
- package/src/automation/actions/interaction/get/getVideoWidth.ts +36 -0
- package/src/automation/actions/interaction/get/getWidthOfBrowser.ts +18 -0
- package/src/automation/actions/interaction/get/getWidthOfWebElement.ts +36 -0
- package/src/automation/actions/interaction/get/getWorkingLinksFromCurrentPage.ts +16 -0
- package/src/automation/actions/interaction/get/getWrappedElement.ts +36 -0
- package/src/automation/actions/interaction/get/getWrappedOptionFromListBoxAsText.ts +47 -0
- package/src/automation/actions/interaction/get/getXLocationOfBrowserWindow.ts +18 -0
- package/src/automation/actions/interaction/get/getXLocationOfWebElement.ts +71 -0
- package/src/automation/actions/interaction/get/getYLocationOfBrowserWindow.ts +18 -0
- package/src/automation/actions/interaction/get/getYLocationOfWebElement.ts +70 -0
- package/src/automation/actions/interaction/iframe/switchToDefaultContent.ts +15 -0
- package/src/automation/actions/interaction/maximize/maximize.ts +15 -0
- package/src/automation/actions/interaction/maximize/minimize.ts +17 -0
- package/src/automation/actions/interaction/navigation/goBack.ts +14 -0
- package/src/automation/actions/interaction/navigation/navigate.ts +16 -0
- package/src/automation/actions/interaction/navigation/refresh.ts +14 -0
- package/src/automation/actions/interaction/press/mobPressBackKey.ts +19 -0
- package/src/automation/actions/interaction/press/pressAnyKey.ts +89 -0
- package/src/automation/actions/interaction/press/pressAnyKeyNTimes.ts +100 -0
- package/src/automation/actions/interaction/press/pressEnterKey.ts +45 -0
- package/src/automation/actions/interaction/scroll/scrollHorizontallyTillElementIsVisible.ts +29 -0
- package/src/automation/actions/interaction/scroll/scrollPageToSpecificLocation.ts +37 -0
- package/src/automation/actions/interaction/scroll/scrollToElement.ts +28 -0
- package/src/automation/actions/interaction/scroll/scrollVerticallyTillElementIsVisible.ts +29 -0
- package/src/automation/actions/interaction/set/setClipBoardText.ts +46 -0
- package/src/automation/actions/interaction/shadowDom/shadowDomClick.ts +25 -0
- package/src/automation/actions/interaction/shadowDom/shadowDomEnter.ts +27 -0
- package/src/automation/actions/interaction/shadowDom/shadowDomGetText.ts +28 -0
- package/src/automation/actions/interaction/shadowDom/shadowDomUpload.ts +37 -0
- package/src/automation/actions/interaction/shadowDom/shadowDomVerifyPartialText.ts +29 -0
- package/src/automation/actions/interaction/shadowDom/shadowDomVerifyText.ts +22 -0
- package/src/automation/actions/interaction/switch/switchToNewTabBasedOnTitle.ts +16 -0
- package/src/automation/actions/interaction/switch/switchToNewWindowBasedOnTitle.ts +16 -0
- package/src/automation/actions/interaction/switch/switchToParentWindow.ts +19 -0
- package/src/automation/actions/interaction/switch/switchToTabBasedOnUrl.ts +16 -0
- package/src/automation/actions/interaction/switch/switchToWindowBasedOnURL.ts +16 -0
- package/src/automation/actions/interaction/switch/switchToWindowIfTitleContainsString.ts +18 -0
- package/src/automation/actions/interaction/switch/switchToWindowIfUrlContainsString.ts +18 -0
- package/src/automation/actions/interaction/upload/uploadfile.ts +41 -0
- package/src/automation/actions/interaction/verify/VerifyAccessibilityScore.ts +90 -0
- package/src/automation/actions/interaction/verify/VerifyAllBrokenImages.ts +54 -0
- package/src/automation/actions/interaction/verify/VerifyAllBrowserWindowsClosed.ts +27 -0
- package/src/automation/actions/interaction/verify/VerifyAllOptionsAreDeSelected.ts +55 -0
- package/src/automation/actions/interaction/verify/VerifyAllOptionsAreSelected.ts +66 -0
- package/src/automation/actions/interaction/verify/VerifyAttributeValue.ts +96 -0
- package/src/automation/actions/interaction/verify/VerifyBestPracticesScore.ts +87 -0
- package/src/automation/actions/interaction/verify/VerifyBrowserHtmlCodeContainsString.ts +35 -0
- package/src/automation/actions/interaction/verify/VerifyBrowserWindowHeight.ts +35 -0
- package/src/automation/actions/interaction/verify/VerifyBrowserWindowTitleContainsString.ts +31 -0
- package/src/automation/actions/interaction/verify/VerifyBrowserWindowTitleIsString.ts +30 -0
- package/src/automation/actions/interaction/verify/VerifyBrowserWindowUrlContainsExpectedUrl.ts +30 -0
- package/src/automation/actions/interaction/verify/VerifyBrowserWindowUrlIsString.ts +30 -0
- package/src/automation/actions/interaction/verify/VerifyBrowserWindowWidth.ts +35 -0
- package/src/automation/actions/interaction/verify/VerifyBrowserWindowXLocation.ts +36 -0
- package/src/automation/actions/interaction/verify/VerifyBrowserWindowYLocation.ts +35 -0
- package/src/automation/actions/interaction/verify/VerifyCheckBoxIsNotSelected.ts +46 -0
- package/src/automation/actions/interaction/verify/VerifyCheckBoxIsSelected.ts +43 -0
- package/src/automation/actions/interaction/verify/VerifyCssAttributeValue.ts +62 -0
- package/src/automation/actions/interaction/verify/VerifyElementIsClickable.ts +86 -0
- package/src/automation/actions/interaction/verify/VerifyElementIsDisabled.ts +91 -0
- package/src/automation/actions/interaction/verify/VerifyElementIsDisplayed.ts +87 -0
- package/src/automation/actions/interaction/verify/VerifyElementIsEnabled.ts +87 -0
- package/src/automation/actions/interaction/verify/VerifyElementIsNotDisplayed.ts +45 -0
- package/src/automation/actions/interaction/verify/VerifyElementIsSelected.ts +83 -0
- package/src/automation/actions/interaction/verify/VerifyElementNotContainsText.ts +129 -0
- package/src/automation/actions/interaction/verify/VerifyHeightOfWebElement.ts +101 -0
- package/src/automation/actions/interaction/verify/VerifyHexCodeForGivenXYCoordinates.ts +51 -0
- package/src/automation/actions/interaction/verify/VerifyIfAllCookiesAreDeleted.ts +27 -0
- package/src/automation/actions/interaction/verify/VerifyIfAudioEnded.ts +48 -0
- package/src/automation/actions/interaction/verify/VerifyIfAudioIsMuted.ts +48 -0
- package/src/automation/actions/interaction/verify/VerifyIfAudioIsPaused.ts +48 -0
- package/src/automation/actions/interaction/verify/VerifyIfAudioIsPlaying.ts +57 -0
- package/src/automation/actions/interaction/verify/VerifyIfBrowserWindowIsClosed.ts +27 -0
- package/src/automation/actions/interaction/verify/VerifyIfCookieNameIsAdded.ts +38 -0
- package/src/automation/actions/interaction/verify/VerifyIfCookieNameIsDeleted.ts +33 -0
- package/src/automation/actions/interaction/verify/VerifyIfCookieObjectIsPresent.ts +49 -0
- package/src/automation/actions/interaction/verify/VerifyIfGivenOptionIsDuplicate.ts +60 -0
- package/src/automation/actions/interaction/verify/VerifyIfImageIsBroken.ts +40 -0
- package/src/automation/actions/interaction/verify/VerifyIfLinkIsBroken.ts +38 -0
- package/src/automation/actions/interaction/verify/VerifyIfLinkIsWorking.ts +37 -0
- package/src/automation/actions/interaction/verify/VerifyIfLinksAreBroken.ts +46 -0
- package/src/automation/actions/interaction/verify/VerifyIfLinksAreWorking.ts +45 -0
- package/src/automation/actions/interaction/verify/VerifyIfOptionWithIndexIsDeselectedInElement.ts +75 -0
- package/src/automation/actions/interaction/verify/VerifyIfOptionWithIndexIsSelectedInListBox.ts +77 -0
- package/src/automation/actions/interaction/verify/VerifyIfOptionWithTextIsDeselected.ts +40 -0
- package/src/automation/actions/interaction/verify/VerifyIfOptionWithValueIsDeselected.ts +61 -0
- package/src/automation/actions/interaction/verify/VerifyIfOptionWithValueIsSelected.ts +58 -0
- package/src/automation/actions/interaction/verify/VerifyIfOptionWithVisibleTextIsSelected.ts +40 -0
- package/src/automation/actions/interaction/verify/VerifyIfSpecifiedOptionIsSelected.ts +78 -0
- package/src/automation/actions/interaction/verify/VerifyIfStatusCodeOfALinkIsStatusCode.ts +37 -0
- package/src/automation/actions/interaction/verify/VerifyIfStatusCodesOfLinks.ts +46 -0
- package/src/automation/actions/interaction/verify/VerifyIfVideoEnded.ts +49 -0
- package/src/automation/actions/interaction/verify/VerifyIfVideoIsMuted.ts +49 -0
- package/src/automation/actions/interaction/verify/VerifyIfVideoIsPaused.ts +49 -0
- package/src/automation/actions/interaction/verify/VerifyIfVideoIsPlaying.ts +50 -0
- package/src/automation/actions/interaction/verify/VerifyIfVideoPlayingInMute.ts +58 -0
- package/src/automation/actions/interaction/verify/VerifyIfVideoPlayingInUnmute.ts +58 -0
- package/src/automation/actions/interaction/verify/VerifyIfXAndYCoordinateOfElement.ts +101 -0
- package/src/automation/actions/interaction/verify/VerifyLinkNavigatesToTitle.ts +41 -0
- package/src/automation/actions/interaction/verify/VerifyListBoxOptionsAreSorted.ts +72 -0
- package/src/automation/actions/interaction/verify/VerifyNavigateURL.ts +34 -0
- package/src/automation/actions/interaction/verify/VerifyNumberOfElementsByTagName.ts +35 -0
- package/src/automation/actions/interaction/verify/VerifyNumberOfElementsByXpath.ts +52 -0
- package/src/automation/actions/interaction/verify/VerifyPartialAttributeValue.ts +94 -0
- package/src/automation/actions/interaction/verify/VerifyPartialTitleOfCurrentPage.ts +29 -0
- package/src/automation/actions/interaction/verify/VerifyPerformanceScore.ts +84 -0
- package/src/automation/actions/interaction/verify/VerifyPwaScore.ts +66 -0
- package/src/automation/actions/interaction/verify/VerifyRadioButtonIsNotSelected.ts +42 -0
- package/src/automation/actions/interaction/verify/VerifyRadioButtonIsSelected.ts +42 -0
- package/src/automation/actions/interaction/verify/VerifySeoScore.ts +79 -0
- package/src/automation/actions/interaction/verify/VerifyTagName.ts +44 -0
- package/src/automation/actions/interaction/verify/VerifyThatSpecifiedOptionIsNotSelected.ts +73 -0
- package/src/automation/actions/interaction/verify/VerifyTitleInAllPage.ts +51 -0
- package/src/automation/actions/interaction/verify/VerifyTitleOfCurrentPage.ts +30 -0
- package/src/automation/actions/interaction/verify/VerifyValueOfElementContainsString.ts +51 -0
- package/src/automation/actions/interaction/verify/VerifyValueOfElementIsCleared.ts +45 -0
- package/src/automation/actions/interaction/verify/VerifyValueOfElementIsString.ts +54 -0
- package/src/automation/actions/interaction/verify/VerifyWidthOfElement.ts +90 -0
- package/src/automation/actions/interaction/verify/VerifyXLocationOfElement.ts +89 -0
- package/src/automation/actions/interaction/verify/VerifyYLocationOfElement.ts +90 -0
- package/src/automation/actions/interaction/verify/checkIfElementIsDisplayed.ts +83 -0
- package/src/automation/actions/interaction/verify/verifypartialtext.ts +131 -0
- package/src/automation/actions/interaction/verify/verifytext.ts +143 -0
- package/src/automation/actions/interaction/wait/wait.ts +16 -0
- package/src/automation/actions/interaction/wait/waitTillAttributeOfElementIsString.ts +88 -0
- package/src/automation/actions/interaction/wait/waitTillElementContainsText.ts +79 -0
- package/src/automation/actions/interaction/wait/waitTillElementHasText.ts +71 -0
- package/src/automation/actions/interaction/wait/waitTillElementIsClickable.ts +72 -0
- package/src/automation/actions/interaction/wait/waitTillPresenceOfAllElements.ts +72 -0
- package/src/automation/actions/interaction/wait/waitTillPresenceOfElement.ts +67 -0
- package/src/automation/actions/interface/IframeInterface.ts +6 -0
- package/src/automation/actions/interface/alertActionInterface.ts +39 -0
- package/src/automation/actions/interface/clearActionInterface.ts +27 -0
- package/src/automation/actions/interface/clickActionInterface.ts +87 -0
- package/src/automation/actions/interface/dragAndDropToElementInterface.ts +18 -0
- package/src/automation/actions/interface/findActionInterface.ts +15 -0
- package/src/automation/actions/interface/getActionInterface.ts +873 -0
- package/src/automation/actions/interface/interactionActionInterface.ts +51 -3
- package/src/automation/actions/interface/maximizeAndMinimizeInterface.ts +12 -0
- package/src/automation/actions/interface/navigationActionInterface.ts +1 -1
- package/src/automation/actions/interface/pressActionInterface.ts +25 -0
- package/src/automation/actions/interface/scrollActionInterface.ts +45 -0
- package/src/automation/actions/interface/setActionInterface.ts +10 -0
- package/src/automation/actions/interface/shadowDomInterface.ts +78 -0
- package/src/automation/actions/interface/switchingActionInterface.ts +93 -0
- package/src/automation/actions/interface/uploadFile.ts +14 -0
- package/src/automation/actions/interface/verifyActionInterface.ts +743 -0
- package/src/automation/actions/interface/waitActionInterface.ts +75 -0
- package/src/automation/browserSession/initiateBrowserSession.ts +12 -40
- package/src/automation/mobileSession/initiateMobileSession.ts +81 -0
- package/src/core/constants/allAction.ts +21 -0
- package/src/core/constants/defaultValues.ts +1 -0
- package/src/core/constants/supportedActions.ts +27 -2
- package/src/core/interfaces/actionInterface.ts +238 -3
- package/src/core/interfaces/automationRunnerInterface.ts +2 -1
- package/src/core/interfaces/browserCapabilitiesInterface.ts +1 -3
- package/src/core/interfaces/errorInfoInterface.ts +7 -0
- package/src/core/interfaces/executionDetails.ts +10 -6
- package/src/core/interfaces/fireflinkScriptPayloadInterface.ts +17 -5
- package/src/core/interfaces/llmResponseInterface.ts +28 -4
- package/src/core/interfaces/promptInterface.ts +20 -0
- package/src/core/interfaces/scriptGenrationDataInterface.ts +2 -2
- package/src/core/interfaces/simplifyAndFlattenInterface.ts +13 -0
- package/src/core/main/actionHandlerFactory.ts +1528 -53
- package/src/core/main/executionContext.ts +5 -1
- package/src/core/main/runAutomationScript.ts +528 -123
- package/src/core/main/stepProcessor.ts +4 -2
- package/src/core/types/llmResponseType.ts +7 -3
- package/src/core/types/promptMap.ts +7 -4
- package/src/core/types/promptType.ts +6 -0
- package/src/core/types/scriptTypesType.ts +1 -0
- package/src/domAnalysis/getRelaventElements.ts +10 -1
- package/src/domAnalysis/relativeElementsFromDom.ts +205 -0
- package/src/domAnalysis/searchBest.ts +130 -17
- package/src/domAnalysis/simplifyAndFlatten.ts +139 -10
- package/src/fireflinkData/fireflinkLocators/getListOfLocators.ts +1 -2
- package/src/fireflinkData/fireflinkScript/scriptGenrationData.ts +70 -21
- package/src/imageAnalysisMobile/annotatedScreenshotMobile.ts +137 -0
- package/src/imageAnalysisMobile/annotatedScreenshotMobileInterface.ts +6 -0
- package/src/imageAnalysisWeb/annotateScreenshot.ts +196 -0
- package/src/imageAnalysisWeb/generateAnnotatedScreenshots.ts +43 -0
- package/src/imageAnalysisWeb/screenshotInterface.ts +18 -0
- package/src/index.ts +2 -2
- package/src/service/{fireflinkApi.service.ts → api/fireflinkApi.service.ts} +5 -7
- package/src/service/kafka/fireflinkKafka.service.ts +25 -0
- package/src/service/scriptRunner.service.ts +23 -42
- package/src/utils/DomExtraction/jsForAttributeInjection.ts +68 -12
- package/src/utils/InstancesDetails/getInstancesInfo.ts +12 -0
- package/src/utils/alertPopup/isAlertPresent.ts +20 -0
- package/src/utils/alertPopup/isAlertPresentInterface.ts +6 -0
- package/src/utils/helpers/enterActionHelper.ts +88 -2
- package/src/utils/helpers/imageUtils.ts +10 -0
- package/src/utils/helpers/sameActionsHelper.ts +52 -0
- package/src/utils/helpers/xpathcreation.ts +59 -0
- package/src/utils/iframesExtraction/findElementUsingFF.ts +45 -0
- package/src/utils/iframesExtraction/iframeInterface.ts +22 -0
- package/src/utils/iframesExtraction/switchToIframeByMeta.ts +23 -0
- package/src/utils/javascript/jsFindElement.ts +39 -31
- package/src/utils/javascript/jsForShadowRoot.ts +9 -9
- package/src/utils/javascript/jsForVision.ts +151 -0
- package/src/utils/logger/logData.ts +126 -47
- package/src/utils/mobileXpath/findXpathFromIndex.ts +87 -0
- package/src/utils/mobileXpath/findXpathFromIndexInterface.ts +4 -0
- package/src/utils/newTab/newTabTracker.ts +62 -0
- package/src/automation/actions/interaction/click.ts +0 -25
- package/src/automation/actions/interaction/enterInput.ts +0 -36
- package/src/automation/actions/navigation/getTitle.ts +0 -9
- package/src/automation/actions/navigation/goBack.ts +0 -9
- package/src/automation/actions/navigation/navigate.ts +0 -10
- package/src/automation/actions/navigation/refresh.ts +0 -9
- package/src/automation/actions/wait/wait.ts +0 -10
|
@@ -2,23 +2,60 @@
|
|
|
2
2
|
export async function buildStepExtractionPrompt(
|
|
3
3
|
): Promise<string> {
|
|
4
4
|
const prompt = `
|
|
5
|
-
You are a
|
|
5
|
+
You are a precise assistant.
|
|
6
|
+
Extract Steps from the following user story for web automation.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
Each step must be a
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Do not
|
|
12
|
-
Do not remove
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
Rules:
|
|
9
|
+
1. Each step must be a string — not a tuple.
|
|
10
|
+
2. Keep the wording the same except:
|
|
11
|
+
- Do not add new steps, only rewrite existing ones.
|
|
12
|
+
- Do not remove any steps.
|
|
13
|
+
- Do not remove quotes from the step. if these quotes are present in the step, keep them as it is.
|
|
14
|
+
3. Output only a **valid TypeScript array of strings**. No explanations, markdown, or code fences..
|
|
15
|
+
4. Please paste the “below example array” here, so I can make it dynamic and generic strictly in the same format.
|
|
16
|
+
**Dont include any other text in the array. and also dont include example array in the response.**
|
|
16
17
|
Output Format
|
|
17
18
|
|
|
18
19
|
Respond strictly in valid JSON using the following structure:
|
|
19
20
|
{
|
|
20
|
-
"
|
|
21
|
+
"manualSteps": ["step 1", "step 2", "step 3"]
|
|
21
22
|
}
|
|
22
23
|
`;
|
|
23
24
|
return prompt;
|
|
24
25
|
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export async function androidbuildStepExtractionPrompt(
|
|
29
|
+
): Promise<string> {
|
|
30
|
+
const prompt = `
|
|
31
|
+
You are a precise assistant.
|
|
32
|
+
Extract **step data** from the following mobile {user_story_raw}.
|
|
33
|
+
|
|
34
|
+
Rules:
|
|
35
|
+
Dont take text from one step and use it in another step.
|
|
36
|
+
1. If the step is about luanching an app, like (action, param1, param2) or(action,'param1,param2') then wrap them into a tuple.
|
|
37
|
+
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.
|
|
38
|
+
If they mention package:com.app.android and activity:com.app.activity remove variable name and then convert them into (launch app, 'com.app.android, 'com.app.activity')
|
|
39
|
+
2.Dont remove parameters from the step. and never combine or merge steps and dont create any extra steps.
|
|
40
|
+
step may be any formate for enter if input is give seperatly with comma use this
|
|
41
|
+
example:'enter username in text field','testuser' → ('enter username in text field','testuser').
|
|
42
|
+
if not given seperatly with comma use and mention in step it self than this
|
|
43
|
+
example:'enter testuser in text field' → ('enter testuser in text field','testuser').
|
|
44
|
+
3. If it's just a single string value, keep it as a string.
|
|
45
|
+
4. Always output a **Always output a valid list of strings.** containing strings or tuples only.
|
|
46
|
+
- Do not add explanations, reasoning, or extra text outside the list.
|
|
47
|
+
- Do not make any assumption if step inputs are missing in user_story_raw
|
|
48
|
+
- **Dont change the order of steps from user story**
|
|
49
|
+
5. If the step is tuple keep it as tuple like this (step). if not just keep it as a string like this 'step'.
|
|
50
|
+
**strictly follow the output format**
|
|
51
|
+
[
|
|
52
|
+
('Launch Mobile App','com.app.android','com.app.activity'),
|
|
53
|
+
'Tap on cancel button',
|
|
54
|
+
'Tap on signin with email',
|
|
55
|
+
('enter username in text field','testuser'),
|
|
56
|
+
('enter testuser in text field','testuser'),
|
|
57
|
+
'verify element is displayed'
|
|
58
|
+
]
|
|
59
|
+
`;
|
|
60
|
+
return prompt;
|
|
61
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
|
|
2
|
+
import { verifyActionArgs } from "../llmPromptTypes/systemPromptTypes"
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export async function verifyActionExtractorPrompt({
|
|
6
|
+
extractedDomJson,
|
|
7
|
+
priorAndNextSteps,
|
|
8
|
+
|
|
9
|
+
}: verifyActionArgs
|
|
10
|
+
): Promise<string> {
|
|
11
|
+
const nlpList = `VerifyElementIsDisabled,VerifyElementIsEnabled,VerifyElementIsSelected,VerifyIfOptionWithIndexIsSelectedInListBox,VerifyWidthOfElement,VerifyBrowserWindowXLocation,
|
|
12
|
+
VerifyIfCookieNameIsDeleted,VerifyBrowserWindowWidth,VerifyValueOfElementIsCleared,
|
|
13
|
+
VerifyTagName,VerifyIfCookieNameIsAdded,VerifyLinkNavigatesToTitle,VerifyXLocationOfElement,
|
|
14
|
+
VerifyAllOptionsAreDeselected,VerifyBrowserHtmlCodeContainsString,VerifyBrowserWindowYLocation,
|
|
15
|
+
VerifyNumberOfElementsByTagName,VerifyListBoxOptionsAreSorted,VerifyNavigateURL,
|
|
16
|
+
VerifyHeightOfWebElement,VerifyValueOfElementContainsString,VerifyBrowserWindowHeight,VerifyIfLinksAreBroken,
|
|
17
|
+
VerifyIfLinkIsBroken,VerifyValueOfElementIsString,VerifyYLocationOfElement,
|
|
18
|
+
VerifyNumberOfElementsByXpath,VerifyIfOptionWithIndexIsDeselectedInElement,VerifyAttributeValue,
|
|
19
|
+
VerifyElementIsDisplayed,VerifyAllOptionsAreSelected,VerifyIfOptionWithValueIsDeselected,
|
|
20
|
+
VerifyBrowserWindowTitleContainsString,VerifyBrowserWindowTitleIsString,
|
|
21
|
+
VerifyTitleOfCurrentPage,VerifyPartialTitleOfCurrentPage,VerifyElementIsNotDisplayed,
|
|
22
|
+
VerifyCssAttributeValue,VerifyPartialAttributeValue,VerifyIfSpecifiedOptionIsSelected,
|
|
23
|
+
VerifyTitleInAllPage,VerifyIfOptionWithValueIsSelected,VerifyIfVideoIsPlaying,
|
|
24
|
+
VerifyIfGivenOptionIsDuplicate,VerifyRadioButtonIsSelected,VerifyRadioButtonIsNotSelected,
|
|
25
|
+
VerifyThatSpecifiedOptionIsNotSelected,
|
|
26
|
+
VerifyText,VerifyPartialText,VerifyElementNotContainsText,VerifyElementIsClickable,
|
|
27
|
+
VerifyCheckBoxIsSelected,VerifyCheckBoxIsNotSelected,
|
|
28
|
+
VerifyUrlContainsExpectedUrl,VerifyUrlIsString,
|
|
29
|
+
VerifyIfBrowserWindowIsClosed,VerifyAllBrowserWindowsClosed,
|
|
30
|
+
VerifyIfAllCookiesAreDeleted,VerifyIfCookieObjectIsPresent,
|
|
31
|
+
VerifyIfXAndYCoordinateOfElement,VerifyIfVideoIsMuted,VerifyIfVideoIsPaused,
|
|
32
|
+
VerifyIfVideoEnded,VerifyIfVideoPlayingInMute,VerifyIfVideoPlayingInUnmute,
|
|
33
|
+
VerifyIfAudioIsPlaying,VerifyIfAudioIsPaused,VerifyIfAudioIsMuted,VerifyIfAudioEnded,
|
|
34
|
+
VerifyIfLinkIsWorking,VerifyIfLinksAreWorking,
|
|
35
|
+
VerifyIfImageIsBroken,VerifyAllBrokenImages,VerifyIfStatusCodeOfALinkIsStatusCode,
|
|
36
|
+
VerifyIfStatusCodesOfLinks,VerifyIfOptionWithVisibleTextIsSelected,VerifyBrowserWindowUrlIsString,
|
|
37
|
+
VerifyIfOptionWithTextIsDeselected,VerifyPerformanceScore,VerifyAccessibilityScore,VerifyBrowserWindowUrlContainsExpectedUrl,
|
|
38
|
+
VerifyBestPracticesScore,VerifySeoScore,VerifyPwaScore,VerifyHexCodeForGivenXYCoordinates`;
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
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'];
|
|
42
|
+
const prompt = `You are an intelligent assistant that extracts structured UI action data.
|
|
43
|
+
Given the step, the simplified DOM: ${extractedDomJson}, and the list of NLP names: ${nlpList} don't provide the other nlp names which are not present in the list in any manner.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
Select the perfect matching NLP name from the list that best fits the step's intent.
|
|
47
|
+
**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.**
|
|
48
|
+
step may give any way,you need to get most matching and most related nlp name from the list that relates to step.
|
|
49
|
+
for these nlp's VerifyIfSpecifiedOptionIsSelected,VerifyThatSpecifiedOptionIsNotSelected,VerifyIfOptionWithValueIsSelected,VerifyIfOptionWithValueIsDeselected,in step if they mention word value then only match with these VerifyIfOptionWithValueIsSelected,VerifyIfOptionWithValueIsDeselected.Otherwise go with specified option nlp's.
|
|
50
|
+
example: verify if email element is present
|
|
51
|
+
nlp name should be VerifyElementIsDisplayed
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
{
|
|
55
|
+
"attribute_value": "Fire-Flink-x",
|
|
56
|
+
"nlpName": "x",
|
|
57
|
+
"input_text":"x"
|
|
58
|
+
"elementType": "x"
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
Rules:
|
|
62
|
+
- nlpName must be exactly one from the provided list.
|
|
63
|
+
- Use context from the steps : ${priorAndNextSteps}, keyword and json to search for FF-inspecter.
|
|
64
|
+
- **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or any other attributes best match the step in the simplified DOM.**
|
|
65
|
+
- 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.
|
|
66
|
+
ex: Verify the flights matches the flight, Verify the home has 30 and 50 coordinates if they give x-30,y-50 just send 30,50 and verify hex code '#FFFFFF' for given (34,11) coordinates or they will give x-34,y-11 hexcode-#FFFFFF format than fill input_text in this order "#FFFFFF,34,11"
|
|
67
|
+
here keyword : "flights" , input : "flight", here input:"30,50" , here input:"#FFFFFF,34,11"
|
|
68
|
+
- If step is about checking attribute value then map to attribute nlps and input_text: "attribute_name,element_name" here attribute_name can be id,text,href etc not fire-flink-x. input_text should be in this format.if they mention css attribute value then input_text should be "css_property,expected_value".
|
|
69
|
+
and also If a step requires comparing two values, provide the input in the format input_text: "value1,value2".
|
|
70
|
+
- if step is about tag name then input_text: "tag name". and if step is about verifying tag name and with count then input_text: "tag name,count". and if any step is about verifying number of elements with xpath then input_text should be "xpath,count"
|
|
71
|
+
- if step is about verifying location then input_text: "coordinates".
|
|
72
|
+
- If a step involves a URL, map navigation/action keywords (navigate) to VerifyNavigateURL, partial match keywords (contains, includes) to VerifyUrlContainsExpectedUrl or VerifyBrowserWindowUrlContainsExpectedUrl exact match keywords (equals, is, exactly) to VerifyUrlIsString or VerifyBrowserWindowUrlIsString based on step if they mention navigate to title match with (VerifyLinkNavigatesToTitle) default to exact match if unclear, and prioritize navigation if both intents exist.
|
|
73
|
+
- If no explicit option is mentioned in the step, map it to the most relevant non-option verification NLP based on the intent of the step.
|
|
74
|
+
- **Extract input_text from the step that is which is being verified in the step, if you can't find any input text in the step, return keyword as input_text.**
|
|
75
|
+
if step is verifying value of element then extract value which is being verified only not any other words in the step.
|
|
76
|
+
- Extract keyword from the step, if the step contains any keyword.
|
|
77
|
+
- if no matching element found for the step return attribute_value as only 'Fire-Flink-0' dont give Fire-Flink-x or any string .
|
|
78
|
+
- 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'.
|
|
79
|
+
- **Respond with valid JSON only. don't return any other text or don't return response in list format**
|
|
80
|
+
`;
|
|
81
|
+
return prompt;
|
|
82
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
|
|
2
|
+
import { verifyActionArgs } from "../llmPromptTypes/systemPromptTypes"
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export async function verifyActionExtractorPromptMob({
|
|
6
|
+
extractedDomJson,
|
|
7
|
+
priorAndNextSteps,
|
|
8
|
+
|
|
9
|
+
}: verifyActionArgs
|
|
10
|
+
): Promise<string> {
|
|
11
|
+
const nlpList = ` "MOB_VerifyElementIsDisplayed,MOB_VerifyElementIsEnabled,MOB_VerifyElementIsSelected,MOB_VerifyText,MOB_VerifyAttributeValue,MOB_VerifyPartialAttributeValue,"
|
|
12
|
+
"MOB_VerifyElementIsDisplayedInSpecifiedTime,MOB_VerifyElementIsEnabledInSpecifiedTime,MOB_VerifyElementIsDisabledInSpecifiedTime,"
|
|
13
|
+
"MOB_VerifyBatteryLevel,MOB_VerifyPartialText,MOB_VerifyElementIsClickable,"
|
|
14
|
+
"MOB_VerifyIfKeyboardIsHidden,MOB_VerifyIfKeyboardIsShown,MOB_VerifyIfXAndYCoordinateOfElement,"
|
|
15
|
+
"MOB_VerifyHeightOfElement,MOB_VerifyXLocationOfAndroidElement,MOB_VerifyIfDeviceIsUnlocked,"
|
|
16
|
+
"MOB_VerifyIfWifiOff,MOB_VerifyElementIsSelectedInSpecifiedTime,MOB_VerifyIfWifiOn,MOB_VerifyIfDeviceIsLocked,"
|
|
17
|
+
"MOB_VerifyIfAirplaneModeOff,MOB_VerifyIfGpsOff,MOB_VerifyHexCodeForGivenXYCoordinates,"
|
|
18
|
+
"MOB_VerifyYLocationOfAndroidElement,MOB_VerifyIfGpsOn,MOB_VerifyIfAirplaneModeOn,"
|
|
19
|
+
"MOB_VerifyWidthOfElement,MOB_VerifyElementIsNotDisplayed,MOB_VerifyElementNotContainsText,"
|
|
20
|
+
"MOB_VerifyIfAppIsClosed"`;
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
const elementType = ["link", "textfield", "icon", "button", "radiobutton", "checkbox", "tab", "action overflow button", "hamburger menu", "toggle button", "steppers", "sliders"]
|
|
24
|
+
|
|
25
|
+
const prompt = `You are an intelligent assistant that extracts structured UI action data.
|
|
26
|
+
Given the step: step, the simplified DOM: ${extractedDomJson}, and the list of NLP names: ${nlpList}.
|
|
27
|
+
|
|
28
|
+
Select the perfect matching NLP name from the list that best fits the step's intent.
|
|
29
|
+
|
|
30
|
+
Return **only valid JSON** in the following format:
|
|
31
|
+
{
|
|
32
|
+
"FF_inspector_value": "Fire-Flink-x",
|
|
33
|
+
"nlpName": "x",
|
|
34
|
+
"input_text":"x"
|
|
35
|
+
"keyword": "x",
|
|
36
|
+
"element_type": "x",
|
|
37
|
+
"locator_type":"x"
|
|
38
|
+
}
|
|
39
|
+
Rules:
|
|
40
|
+
- nlpName must be exactly one from the provided list.
|
|
41
|
+
- Use context from the steps : ${priorAndNextSteps}, keyword and json to search for FF-inspecter.
|
|
42
|
+
- **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or attributes best match the step.**
|
|
43
|
+
- For some steps you can see two inputs but you need to uderstand step and send the requred input_text.
|
|
44
|
+
ex: Verify the flights matches the flight,Verify the home has 30 and 50 coordinates
|
|
45
|
+
here keyword : "flights" , input : flight, here input:30,50
|
|
46
|
+
- If step mention time and element name then Input_text should be elementname,time.
|
|
47
|
+
example: Verify the home is displayed for 30 seconds
|
|
48
|
+
here keyword : "home" , input : home,30
|
|
49
|
+
- If step mention verify text then only pick MOB_VerifyText nlp otherwise pick MOB_VerifyElementIsDisplayed.
|
|
50
|
+
- Extract input_text from the step that is which is being verified in the {step}, if you can't find any input text in the step, return keyword as input_text.
|
|
51
|
+
- Extract keyword from the step, if the step contains any keyword.
|
|
52
|
+
- Use the closest semantic match for the step; return attribute_value as Fire-Flink-0, only if nothing is found.
|
|
53
|
+
- 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'.
|
|
54
|
+
- Extract locator_type if mentioned in the step, like(text,resource-id,content-desc) . if not found return 'empty'.
|
|
55
|
+
- Respond with valid JSON only.
|
|
56
|
+
`;
|
|
57
|
+
return prompt;
|
|
58
|
+
}
|
|
@@ -1,26 +1,20 @@
|
|
|
1
|
+
import { visionPrompt } from "../llmPromptTypes/systemPromptTypes"
|
|
1
2
|
|
|
2
|
-
type visionPrompt = {
|
|
3
|
-
currentStep: string,
|
|
4
|
-
priorAndNextSteps: string[]
|
|
5
|
-
}
|
|
6
3
|
export async function visionPrompt(
|
|
7
|
-
{
|
|
4
|
+
{ priorAndNextSteps }: visionPrompt
|
|
8
5
|
): Promise<string> {
|
|
9
6
|
|
|
10
7
|
const customPromptText = `
|
|
11
8
|
You are a precise automation assistant.
|
|
12
9
|
Context: ${priorAndNextSteps}
|
|
13
|
-
- Use the context to understand the step and select the closest semantic match to
|
|
10
|
+
- Use the context to understand the step and select the closest semantic match to Step and return only its index, else Fire-Flink-0.
|
|
14
11
|
- **If u can't find the element, return Fire-Flink-0. dont return any other elements index.**
|
|
15
|
-
- Using the provided annotated screenshot and
|
|
16
|
-
- Match the index to the text or action described in
|
|
17
|
-
- Return only the Fire-Flink-
|
|
18
|
-
- Do not provide any additional text or explanation. The output must be strictly Fire-Flink-
|
|
19
|
-
Now, Analyze the step:
|
|
20
|
-
Step: "${currentStep}"
|
|
21
|
-
|
|
12
|
+
- Using the provided annotated screenshot and Step, identify the correct element index from the image.
|
|
13
|
+
- Match the index to the text or action described in Step as accurately as possible.
|
|
14
|
+
- Return only the Fire-Flink-x for the target element.
|
|
15
|
+
- Do not provide any additional text or explanation. The output must be strictly Fire-Flink-x.
|
|
22
16
|
Respond only with JSON using this format:
|
|
23
|
-
{fireflinkIndex: Fire-Flink-
|
|
17
|
+
{fireflinkIndex: Fire-Flink-x | Fire-Flink-0}
|
|
24
18
|
|
|
25
19
|
`.trim();
|
|
26
20
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { visionPromptMobile } from "../llmPromptTypes/systemPromptTypes"
|
|
2
|
+
|
|
3
|
+
export async function visionPromptMobile(
|
|
4
|
+
{ priorAndNextSteps }: visionPromptMobile
|
|
5
|
+
): Promise<string> {
|
|
6
|
+
|
|
7
|
+
const customPromptText = `
|
|
8
|
+
You are a precise mobile automation assistant.
|
|
9
|
+
- You are given an image containing multiple elements outlined with Red bounding boxes.Each bounding box has a small black index number label drawn above it (like 1, 2, 3...).
|
|
10
|
+
- Do not treat numbers appearing in the step as index numbers.if any number appears in the step it is not an index number.
|
|
11
|
+
- Use the context from the all steps ${priorAndNextSteps}
|
|
12
|
+
- **Analyze the user's step and action done by that step action determine which UI element in the screenshot corresponds semantically to that action.
|
|
13
|
+
- for action enter check for edit text field and choose index number of that box.
|
|
14
|
+
- **pick the index number that is on the box where element present that best matches semantically or visually to that action of the given step.**
|
|
15
|
+
- Identify which element number (from the image) best matches that step.
|
|
16
|
+
- Return the **index** number as shown in the image (1-based).
|
|
17
|
+
- if there are two elements that match step and one have box and other doesn't have box then prefer the one with box and return that index number.
|
|
18
|
+
- if no correct element found or if none of correct elements has no box,then return 0.
|
|
19
|
+
Respond only with JSON using this format:
|
|
20
|
+
{fireflinkIndex: Fire-Flink-x | Fire-Flink-0}
|
|
21
|
+
|
|
22
|
+
`.trim();
|
|
23
|
+
|
|
24
|
+
return customPromptText;
|
|
25
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { waitActionArgs } from "../llmPromptTypes/systemPromptTypes"
|
|
2
|
+
|
|
3
|
+
export async function waitActionExtractorPrompt({
|
|
4
|
+
extractedDomJson,
|
|
5
|
+
priorAndNextSteps,
|
|
6
|
+
|
|
7
|
+
}: waitActionArgs
|
|
8
|
+
): Promise<string> {
|
|
9
|
+
const nlpList = `
|
|
10
|
+
"WaitTillUlrOfPageContainsString",
|
|
11
|
+
"WaitTillTitleOfPageIsString",
|
|
12
|
+
"WaitTillUrlOfPageIsString",
|
|
13
|
+
"WaitTitleOfPageContainsString",
|
|
14
|
+
"WaitTillElementVisible",
|
|
15
|
+
"WaitTillAlertIsPresent",
|
|
16
|
+
"WaitUntilElementIsInvisible",
|
|
17
|
+
"WaitUntilElementIsClickable",
|
|
18
|
+
"WaitAttributeOfElementContainsString",
|
|
19
|
+
"WaitTillAttributeOfElementIsString",
|
|
20
|
+
"WaitUntilElementIsSelected",
|
|
21
|
+
"WaitUntilAllElementIsInvisible",
|
|
22
|
+
"WaitTillPresenceOfAllElements",
|
|
23
|
+
"WaitTillElementContainsText",
|
|
24
|
+
"WaitTillPresenceOfElement",
|
|
25
|
+
"WaitTillElementHasText",
|
|
26
|
+
"WaitTillPageLoads",
|
|
27
|
+
"WaitTillAttributeOfElementIsNotEmpty",
|
|
28
|
+
"WaitTillValueAttributeOfElementHasText",
|
|
29
|
+
"WaitAndSendKeys",
|
|
30
|
+
"WaitTillStalenessOfElement",
|
|
31
|
+
"WaitAndClick",
|
|
32
|
+
"Sleep"`;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
const elementType = ["link", "textfield", "icon", "button", "radiobutton", "checkbox", "tab", "action overflow button", "hamburger menu", "toggle button", "steppers", "sliders"]
|
|
36
|
+
const prompt = `
|
|
37
|
+
You are an intelligent assistant that extracts structured UI action data.
|
|
38
|
+
Given the step, the simplified DOM: ${extractedDomJson}, and the list of NLP names: ${nlpList}.
|
|
39
|
+
|
|
40
|
+
Select the perfect matching NLP name from the list that best fits the step's intent.
|
|
41
|
+
|
|
42
|
+
Return **only valid JSON** in the following format:
|
|
43
|
+
{
|
|
44
|
+
"attribute_value": "Fire-Flink-x",
|
|
45
|
+
"nlpName": "x",
|
|
46
|
+
"input_text":"x"
|
|
47
|
+
"keyword": "x",
|
|
48
|
+
"element_type": "x"
|
|
49
|
+
}
|
|
50
|
+
Rules:
|
|
51
|
+
- nlpName must be exactly one from the provided list.
|
|
52
|
+
- For steps like wait for some time or wait for 5 secondes. give input in number only and nlpName should be "Sleep".
|
|
53
|
+
- Use context from the steps : ${priorAndNextSteps}, keyword and json to search for FF-inspecter.
|
|
54
|
+
- **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or attributes best match the step.**
|
|
55
|
+
- For some steps you can see two inputs but you need to uderstand step and send the requred input_text.
|
|
56
|
+
ex: Wait until the flights has the flight text
|
|
57
|
+
here keyword : "flights" , input : flight
|
|
58
|
+
- Extract input_text from the step, if you can't find any input text in the step, return keyword as input_text.
|
|
59
|
+
- Extract keyword from the step, if the step contains any keyword.
|
|
60
|
+
- Use the closest semantic match for the step; return attribute_value as Fire-Flink-0, only if nothing is found.
|
|
61
|
+
- 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'.
|
|
62
|
+
- Respond with valid JSON only.
|
|
63
|
+
`;
|
|
64
|
+
return prompt;
|
|
65
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { waitActionArgs } from "../llmPromptTypes/systemPromptTypes"
|
|
2
|
+
|
|
3
|
+
export async function waitActionExtractorPromptMob({
|
|
4
|
+
extractedDomJson,
|
|
5
|
+
priorAndNextSteps,
|
|
6
|
+
|
|
7
|
+
}: waitActionArgs
|
|
8
|
+
): Promise<string> {
|
|
9
|
+
const nlpList = `"MOB_WaitTillPresenceOfElement","MOB_WaitTillElementIsSelected","MOB_WaitTillElementHasText","MOB_WaitTillElementIsEnabled",
|
|
10
|
+
"MOB_WaitTillElementIsVisible","MOB_WaitTillElementContainsText","MOB_WaitTillAttributeOfElementContainsString","MOB_WaitTillAllElementsAreInvisible",
|
|
11
|
+
"MOB_WaitTillElementIsInvisible","MOB_WaitTillElementIsClickable","MOB_WaitTillAttributeOfElementIsString","MOB_WaitTillPresenceOfAllElements",
|
|
12
|
+
"MOB_WaitTillStalenessOfElement","MOB_WaitAndSendKeys","MOB_WaitAndClick","Sleep"`;
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const elementType = ["link", "textfield", "icon", "button", "radiobutton", "checkbox", "tab", "action overflow button", "hamburger menu", "toggle button", "steppers", "sliders"]
|
|
16
|
+
const prompt = `
|
|
17
|
+
You are an intelligent assistant that extracts structured UI action data.
|
|
18
|
+
Given the step, the simplified DOM: ${extractedDomJson}, and the list of NLP names: ${nlpList}.
|
|
19
|
+
|
|
20
|
+
Select the perfect matching NLP name from the list that best fits the step's intent.
|
|
21
|
+
|
|
22
|
+
Return **only valid JSON** in the following format:
|
|
23
|
+
{
|
|
24
|
+
"attribute_value": "Fire-Flink-x",
|
|
25
|
+
"nlpName": "x",
|
|
26
|
+
"input_text":"x"
|
|
27
|
+
"keyword": "x",
|
|
28
|
+
"element_type": "x"
|
|
29
|
+
}
|
|
30
|
+
Rules:
|
|
31
|
+
- nlpName must be exactly one from the provided list.
|
|
32
|
+
- For steps like wait for some time or wait for 5 secondes. give input in number only and nlpName should be "Sleep".
|
|
33
|
+
- Use context from the steps : ${priorAndNextSteps}, keyword and json to search for FF-inspecter.
|
|
34
|
+
- **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or attributes best match the step.**
|
|
35
|
+
- For some steps you can see two inputs but you need to uderstand step and send the requred input_text.
|
|
36
|
+
ex: Wait until the flights has the flight text
|
|
37
|
+
here keyword : "flights" , input : flight
|
|
38
|
+
- Extract input_text from the step, if you can't find any input text in the step, return keyword as input_text.
|
|
39
|
+
- Extract keyword from the step, if the step contains any keyword.
|
|
40
|
+
- Use the closest semantic match for the step; return attribute_value as Fire-Flink-0, only if nothing is found.
|
|
41
|
+
- 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'.
|
|
42
|
+
- Respond with valid JSON only.
|
|
43
|
+
`;
|
|
44
|
+
return prompt;
|
|
45
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { PromptType } from "../../../core/types/promptType.js";
|
|
2
2
|
import { visionPromptMessage } from "../../../core/types/visionllmInputType.js";
|
|
3
|
+
import { formatImageBase64 } from "../../../utils/helpers/imageUtils.js";
|
|
3
4
|
|
|
4
5
|
export const userInputFormatters: {
|
|
5
6
|
[K in PromptType]: (
|
|
6
|
-
userInput: Record<string, any
|
|
7
|
+
userInput: Record<string, any>,
|
|
7
8
|
) => string | visionPromptMessage;
|
|
8
9
|
} = {
|
|
9
10
|
[PromptType.USER_STORY_TO_LIST]: (userInput) =>
|
|
@@ -12,13 +13,35 @@ export const userInputFormatters: {
|
|
|
12
13
|
[PromptType.KEYWORD_EXTRACTOR]: (userInput) =>
|
|
13
14
|
`Extract keywords from the following input:\n\n${JSON.stringify(userInput.currentStep, null, 2)}`,
|
|
14
15
|
|
|
15
|
-
[PromptType.ERROR_DESCRIPTION]: (
|
|
16
|
-
`Analyze the following error context:\n\n${JSON.stringify(
|
|
16
|
+
[PromptType.ERROR_DESCRIPTION]: (error) =>
|
|
17
|
+
`Analyze the following error context:\n\n${JSON.stringify(error.error, null, 2)}`,
|
|
17
18
|
|
|
18
19
|
[PromptType.FF_INSPECTOR]: (userInput) =>
|
|
19
20
|
`Inspect the DOM for the following action context:\n\n${JSON.stringify(userInput.currentStep, null, 2)}`,
|
|
20
21
|
|
|
22
|
+
[PromptType.VERIFY_PROMPT]: (userInput) =>
|
|
23
|
+
`Inspect the DOM for the following verify context:\n\n${JSON.stringify(userInput.currentStep, null, 2)}`,
|
|
24
|
+
|
|
25
|
+
[PromptType.GET_PROMPT]: (userInput) =>
|
|
26
|
+
`Inspect the DOM for the following get context:\n\n${JSON.stringify(userInput.currentStep, null, 2)}`,
|
|
27
|
+
|
|
28
|
+
[PromptType.COMBINED_ACTION_EXTRACTOR_PROMPT]: (userInput) =>
|
|
29
|
+
`Inspect the DOM for the following wait context:\n\n${JSON.stringify(userInput.currentStep, null, 2)}`,
|
|
30
|
+
|
|
31
|
+
[PromptType.WAIT_ACTION_EXTRACTOR_PROMPT]: (userInput) =>
|
|
32
|
+
`Inspect the DOM for the following wait context:\n\n${JSON.stringify(userInput.currentStep, null, 2)}`,
|
|
33
|
+
|
|
21
34
|
[PromptType.VISION_PROMPT]: (userInput) => {
|
|
35
|
+
let imageBase64: string | null = null;
|
|
36
|
+
|
|
37
|
+
if (userInput.annotatedScreenshot) {
|
|
38
|
+
imageBase64 = formatImageBase64(userInput.annotatedScreenshot);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!imageBase64) {
|
|
42
|
+
throw new Error("Vision image is missing. No annotatedScreenshot provided.");
|
|
43
|
+
}
|
|
44
|
+
|
|
22
45
|
const content: visionPromptMessage = [
|
|
23
46
|
{
|
|
24
47
|
type: "text",
|
|
@@ -31,10 +54,11 @@ export const userInputFormatters: {
|
|
|
31
54
|
{
|
|
32
55
|
type: "image_url",
|
|
33
56
|
image_url: {
|
|
34
|
-
url:
|
|
57
|
+
url: imageBase64
|
|
35
58
|
}
|
|
36
59
|
}
|
|
37
60
|
];
|
|
61
|
+
|
|
38
62
|
return content;
|
|
39
63
|
}
|
|
40
64
|
|