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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getAudioWidthInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAudioWidth = async (
|
|
4
|
+
args: getAudioWidthInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
// Get rendered width of the audio element
|
|
11
|
+
const _audioWidth = await args.driver.execute((el: any) => {
|
|
12
|
+
return el.offsetWidth;
|
|
13
|
+
}, element);
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
args.scriptDataAppender.add(async () => {
|
|
18
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
19
|
+
args.pageDOM,
|
|
20
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
21
|
+
);
|
|
22
|
+
return {
|
|
23
|
+
nlpName: "GetAudioWidth",
|
|
24
|
+
stepInputs: [],
|
|
25
|
+
elementsData: [{
|
|
26
|
+
name: args.elementName,
|
|
27
|
+
type: args.elementType,
|
|
28
|
+
locators: ffElement.locators,
|
|
29
|
+
platform: args.platform
|
|
30
|
+
}]
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
} catch (error) {
|
|
35
|
+
args.scriptDataAppender.setErrorNLP("GetAudioWidth");
|
|
36
|
+
throw new Error("GetAudioWidth action failed", { cause: error });
|
|
37
|
+
}
|
|
38
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getBestPracticesScoreInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getBestPracticesScore = async (
|
|
4
|
+
args: getBestPracticesScoreInterface
|
|
5
|
+
) => {
|
|
6
|
+
try {
|
|
7
|
+
const inputs = (args.value || "").split(",").map(v => v.trim());
|
|
8
|
+
const stepInputs = [inputs[0] || "", inputs[1] || ""];
|
|
9
|
+
|
|
10
|
+
args.scriptDataAppender.add(async () => ({
|
|
11
|
+
nlpName: "GetBestPracticesScore",
|
|
12
|
+
stepInputs: stepInputs,
|
|
13
|
+
elementsData: []
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
} catch (error) {
|
|
17
|
+
args.scriptDataAppender.setErrorNLP("GetBestPracticesScore");
|
|
18
|
+
throw new Error("GetBestPracticesScore action failed", { cause: error });
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getBrowserCountInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getBrowserCount = async (
|
|
4
|
+
args: getBrowserCountInterface
|
|
5
|
+
) => {
|
|
6
|
+
try {
|
|
7
|
+
args.scriptDataAppender.add(async () => ({
|
|
8
|
+
nlpName: "GetBrowserCount",
|
|
9
|
+
stepInputs: [],
|
|
10
|
+
elementsData: []
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
} catch (error) {
|
|
14
|
+
args.scriptDataAppender.setErrorNLP("GetBrowserCount");
|
|
15
|
+
throw new Error("GetBrowserCount action failed", { cause: error });
|
|
16
|
+
}
|
|
17
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getBrowserVersionInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getBrowserVersion = async (args: getBrowserVersionInterface) => {
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
args.scriptDataAppender.add(async () => ({
|
|
7
|
+
nlpName: "GetBrowserVersion",
|
|
8
|
+
stepInputs: [],
|
|
9
|
+
elementsData: []
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
} catch (error) {
|
|
13
|
+
args.scriptDataAppender.setErrorNLP("GetBrowserVersion");
|
|
14
|
+
throw new Error("GetBrowserVersion action failed", { cause: error });
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getCapabilityNamesInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getCapabilityNames = async (
|
|
4
|
+
args: getCapabilityNamesInterface
|
|
5
|
+
) => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
args.scriptDataAppender.add(async () => ({
|
|
9
|
+
nlpName: "GetCapabilityNames",
|
|
10
|
+
stepInputs: [],
|
|
11
|
+
elementsData: []
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
} catch (error) {
|
|
15
|
+
args.scriptDataAppender.setErrorNLP("GetCapabilityNames");
|
|
16
|
+
throw new Error("GetCapabilityNames action failed", { cause: error });
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getClipBoardTextInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getClipBoardText = async (args: getClipBoardTextInterface) => {
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
args.scriptDataAppender.add(async () => ({
|
|
7
|
+
nlpName: "GetClipBoardText",
|
|
8
|
+
stepInputs: [],
|
|
9
|
+
elementsData: []
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
} catch (error) {
|
|
13
|
+
args.scriptDataAppender.setErrorNLP("GetClipBoardText");
|
|
14
|
+
throw new Error("GetClipBoardText action failed", { cause: error })
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getCollectiveApiResponseTimeInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getCollectiveApiResponseTime = async (
|
|
4
|
+
args: getCollectiveApiResponseTimeInterface
|
|
5
|
+
) => {
|
|
6
|
+
try {
|
|
7
|
+
const targetUrl = args.value?.trim();
|
|
8
|
+
let responseTimes: string = "";
|
|
9
|
+
if (targetUrl) {
|
|
10
|
+
responseTimes = (await args.driver.execute((url) => {
|
|
11
|
+
return window.performance.getEntriesByType('resource')
|
|
12
|
+
.filter(e => e.name.includes(url))
|
|
13
|
+
.map(e => String(e.duration));
|
|
14
|
+
}, targetUrl)).join(",");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
args.scriptDataAppender.add(async () => ({
|
|
18
|
+
nlpName: "GetCollectiveApiResponseTime",
|
|
19
|
+
stepInputs: [responseTimes],
|
|
20
|
+
elementsData: []
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
} catch (error) {
|
|
24
|
+
args.scriptDataAppender.setErrorNLP("GetCollectiveApiResponseTime");
|
|
25
|
+
throw new Error("GetCollectiveApiResponseTime action failed", { cause: error });
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { getCollectiveApiStatusCodeInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getCollectiveApiStatusCode = async (
|
|
4
|
+
args: getCollectiveApiStatusCodeInterface
|
|
5
|
+
) => {
|
|
6
|
+
try {
|
|
7
|
+
const targetUrl = args.value?.trim();
|
|
8
|
+
|
|
9
|
+
let statusCodes: string = "";
|
|
10
|
+
if (targetUrl) {
|
|
11
|
+
|
|
12
|
+
const count = await args.driver.execute((url) => {
|
|
13
|
+
return window.performance.getEntriesByType('resource')
|
|
14
|
+
.filter(e => e.name.includes(url)).length;
|
|
15
|
+
}, targetUrl);
|
|
16
|
+
statusCodes = (Array(count).fill("200")).join(","); // Placeholder
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
args.scriptDataAppender.add(async () => ({
|
|
20
|
+
nlpName: "GetCollectiveApiStatusCode",
|
|
21
|
+
stepInputs: [statusCodes],
|
|
22
|
+
elementsData: []
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
} catch (error) {
|
|
26
|
+
args.scriptDataAppender.setErrorNLP("GetCollectiveApiStatusCode");
|
|
27
|
+
throw new Error("GetCollectiveApiStatusCode action failed", { cause: error });
|
|
28
|
+
}
|
|
29
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getCssValueInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getCssValue = async (
|
|
4
|
+
args: getCssValueInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
// stepInputs contains CSS property name
|
|
11
|
+
const cssPropertyName = args.value;
|
|
12
|
+
|
|
13
|
+
const _cssValue = await element.getCSSProperty(cssPropertyName);
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
args.scriptDataAppender.add(async () => {
|
|
18
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
19
|
+
args.pageDOM,
|
|
20
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
21
|
+
);
|
|
22
|
+
return {
|
|
23
|
+
nlpName: "GetCssValue",
|
|
24
|
+
stepInputs: [cssPropertyName],
|
|
25
|
+
elementsData: [{
|
|
26
|
+
name: args.elementName,
|
|
27
|
+
type: args.elementType,
|
|
28
|
+
locators: ffElement.locators,
|
|
29
|
+
platform: args.platform
|
|
30
|
+
}]
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
} catch (error) {
|
|
35
|
+
args.scriptDataAppender.setErrorNLP("GetCssValue");
|
|
36
|
+
throw new Error("GetCssValue action failed", { cause: error });
|
|
37
|
+
}
|
|
38
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getCurrentDayOfTheWeekInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getCurrentDayOfTheWeek = async (
|
|
4
|
+
args: getCurrentDayOfTheWeekInterface
|
|
5
|
+
) => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
args.scriptDataAppender.add(async () => ({
|
|
9
|
+
nlpName: "GetCurrentDayOfTheWeek",
|
|
10
|
+
stepInputs: [],
|
|
11
|
+
elementsData: []
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
} catch (error) {
|
|
15
|
+
args.scriptDataAppender.setErrorNLP("GetCurrentDayOfTheWeek");
|
|
16
|
+
throw new Error("GetCurrentDayOfTheWeek action failed", { cause: error });
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getCurrentSecondsFromCurrentSystemTimeInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getCurrentSecondsFromCurrentSystemTime = async (
|
|
4
|
+
args: getCurrentSecondsFromCurrentSystemTimeInterface
|
|
5
|
+
) => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
|
|
9
|
+
args.scriptDataAppender.add(async () => ({
|
|
10
|
+
nlpName: "GetCurrentSecondsFromCurrentSystemTime",
|
|
11
|
+
stepInputs: [],
|
|
12
|
+
elementsData: []
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
} catch (error) {
|
|
16
|
+
args.scriptDataAppender.setErrorNLP("GetCurrentSecondsFromCurrentSystemTime");
|
|
17
|
+
throw new Error("GetCurrentSecondsFromCurrentSystemTime action failed", { cause: error });
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getCurrentSystemDateInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getCurrentSystemDate = async (
|
|
4
|
+
args: getCurrentSystemDateInterface
|
|
5
|
+
) => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
args.scriptDataAppender.add(async () => ({
|
|
9
|
+
nlpName: "GetCurrentSystemDate",
|
|
10
|
+
stepInputs: [],
|
|
11
|
+
elementsData: []
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
} catch (error) {
|
|
15
|
+
args.scriptDataAppender.setErrorNLP("GetCurrentSystemDate");
|
|
16
|
+
throw new Error("GetCurrentSystemDate action failed", { cause: error })
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getCurrentSystemDayInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getCurrentSystemDay = async (args: getCurrentSystemDayInterface) => {
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
args.scriptDataAppender.add(async () => ({
|
|
7
|
+
nlpName: "GetCurrentSystemDay",
|
|
8
|
+
stepInputs: [],
|
|
9
|
+
elementsData: []
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
} catch (error) {
|
|
13
|
+
args.scriptDataAppender.setErrorNLP("GetCurrentSystemDay");
|
|
14
|
+
throw new Error("GetCurrentSystemDay action failed", { cause: error });
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getCurrentSystemMonthInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getCurrentSystemMonth = async (args: getCurrentSystemMonthInterface) => {
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
args.scriptDataAppender.add(async () => ({
|
|
7
|
+
nlpName: "GetCurrentSystemMonth",
|
|
8
|
+
stepInputs: [],
|
|
9
|
+
elementsData: []
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
} catch (error) {
|
|
13
|
+
args.scriptDataAppender.setErrorNLP("GetCurrentSystemMonth");
|
|
14
|
+
throw new Error("GetCurrentSystemMonth action failed", { cause: error });
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getCurrentSystemTimeInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getCurrentSystemTime = async (
|
|
4
|
+
args: getCurrentSystemTimeInterface
|
|
5
|
+
) => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
args.scriptDataAppender.add(async () => ({
|
|
9
|
+
nlpName: "GetCurrentSystemTime",
|
|
10
|
+
stepInputs: [],
|
|
11
|
+
elementsData: []
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
} catch (error) {
|
|
15
|
+
args.scriptDataAppender.setErrorNLP("GetCurrentSystemTime");
|
|
16
|
+
throw new Error("GetCurrentSystemTime action failed", { cause: error });
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getCurrentSystemYearInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getCurrentSystemYear = async (
|
|
4
|
+
args: getCurrentSystemYearInterface
|
|
5
|
+
) => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
args.scriptDataAppender.add(async () => ({
|
|
9
|
+
nlpName: "GetCurrentSystemYear",
|
|
10
|
+
stepInputs: [],
|
|
11
|
+
elementsData: []
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
} catch (error) {
|
|
15
|
+
args.scriptDataAppender.setErrorNLP("GetCurrentSystemYear");
|
|
16
|
+
throw new Error("GetCurrentSystemYear action failed", { cause: error });
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getCurrentWindowHandleInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getCurrentWindowHandle = async (
|
|
4
|
+
args: getCurrentWindowHandleInterface
|
|
5
|
+
) => {
|
|
6
|
+
switch (args.platform) {
|
|
7
|
+
case "android":
|
|
8
|
+
try {
|
|
9
|
+
args.scriptDataAppender.add(async () => ({
|
|
10
|
+
nlpName: "MOB_GetCurrentWindowHandle",
|
|
11
|
+
stepInputs: [],
|
|
12
|
+
elementsData: []
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
} catch (error) {
|
|
16
|
+
args.scriptDataAppender.setErrorNLP("MOB_GetCurrentWindowHandle");
|
|
17
|
+
throw new Error("GetCurrentWindowHandle action failed", { cause: error });
|
|
18
|
+
}
|
|
19
|
+
break;
|
|
20
|
+
case "web":
|
|
21
|
+
default:
|
|
22
|
+
try {
|
|
23
|
+
args.scriptDataAppender.add(async () => ({
|
|
24
|
+
nlpName: "GetCurrentWindowHandle",
|
|
25
|
+
stepInputs: [],
|
|
26
|
+
elementsData: []
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
} catch (error) {
|
|
30
|
+
args.scriptDataAppender.setErrorNLP("GetCurrentWindowHandle");
|
|
31
|
+
throw new Error("GetCurrentWindowHandle action failed", { cause: error });
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getDataFromApiRequestHeaderForJsonPathInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getDataFromApiRequestHeaderForJsonPath = async (
|
|
4
|
+
args: getDataFromApiRequestHeaderForJsonPathInterface
|
|
5
|
+
) => {
|
|
6
|
+
try {
|
|
7
|
+
// Logic: Extracting data from request headers requires CDP
|
|
8
|
+
const inputs = (args.value || "").split(",").map(v => v.trim());
|
|
9
|
+
const stepInputs = [inputs[0] || "", inputs[1] || "", inputs[2] || ""];
|
|
10
|
+
|
|
11
|
+
args.scriptDataAppender.add(async () => ({
|
|
12
|
+
nlpName: "GetDataFromApiRequestHeaderForJsonPath",
|
|
13
|
+
stepInputs: stepInputs,
|
|
14
|
+
elementsData: []
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
} catch (error) {
|
|
18
|
+
args.scriptDataAppender.setErrorNLP("GetDataFromApiRequestHeaderForJsonPath");
|
|
19
|
+
throw new Error("GetDataFromApiRequestHeaderForJsonPath action failed", { cause: error });
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getDataFromApiResponseForJsonPathInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getDataFromApiResponseForJsonPath = async (
|
|
4
|
+
args: getDataFromApiResponseForJsonPathInterface
|
|
5
|
+
) => {
|
|
6
|
+
try {
|
|
7
|
+
// Logic: Extracting data from response body via JSON path requires CDP
|
|
8
|
+
const inputs = (args.value || "").split(",").map(v => v.trim());
|
|
9
|
+
const stepInputs = [inputs[0] || "", inputs[1] || "", inputs[2] || ""];
|
|
10
|
+
|
|
11
|
+
args.scriptDataAppender.add(async () => ({
|
|
12
|
+
nlpName: "GetDataFromApiResponseForJsonPath",
|
|
13
|
+
stepInputs: stepInputs,
|
|
14
|
+
elementsData: []
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
} catch (error) {
|
|
18
|
+
args.scriptDataAppender.setErrorNLP("GetDataFromApiResponseForJsonPath");
|
|
19
|
+
throw new Error("GetDataFromApiResponseForJsonPath action failed", { cause: error });
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { getDateWithGivenFormatInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getDateWithGivenFormat = async (
|
|
4
|
+
args: getDateWithGivenFormatInterface
|
|
5
|
+
) => {
|
|
6
|
+
try {
|
|
7
|
+
const format = args.value || "dd-MM-yyyy";
|
|
8
|
+
const date = new Date();
|
|
9
|
+
|
|
10
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
11
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
12
|
+
const year = String(date.getFullYear());
|
|
13
|
+
const hours = String(date.getHours()).padStart(2, '0');
|
|
14
|
+
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
15
|
+
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
16
|
+
|
|
17
|
+
const formattedDate = format
|
|
18
|
+
.replace(/dd/gi, day)
|
|
19
|
+
.replace(/MM/g, month)
|
|
20
|
+
.replace(/yyyy/gi, year)
|
|
21
|
+
.replace(/HH/gi, hours)
|
|
22
|
+
.replace(/mm/g, minutes)
|
|
23
|
+
.replace(/ss/gi, seconds);
|
|
24
|
+
|
|
25
|
+
args.scriptDataAppender.add(async () => ({
|
|
26
|
+
nlpName: "GetDateWithGivenFormat",
|
|
27
|
+
stepInputs: [formattedDate],
|
|
28
|
+
elementsData: []
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
} catch (error) {
|
|
32
|
+
args.scriptDataAppender.setErrorNLP("GetDateWithGivenFormat");
|
|
33
|
+
throw new Error("GetDateWithGivenFormat action failed", { cause: error });
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { getDriverInstanceInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getDriverInstance = async (args: getDriverInstanceInterface) => {
|
|
4
|
+
switch (args.platform) {
|
|
5
|
+
case "android":
|
|
6
|
+
try {
|
|
7
|
+
args.scriptDataAppender.add(async () => ({
|
|
8
|
+
nlpName: "MOB_GetDriverInstance",
|
|
9
|
+
stepInputs: [],
|
|
10
|
+
elementsData: []
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
} catch (error) {
|
|
14
|
+
args.scriptDataAppender.setErrorNLP("MOB_GetDriverInstance");
|
|
15
|
+
throw new Error("GetDriverInstance action failed", { cause: error });
|
|
16
|
+
}
|
|
17
|
+
break;
|
|
18
|
+
case "web":
|
|
19
|
+
default:
|
|
20
|
+
try {
|
|
21
|
+
args.scriptDataAppender.add(async () => ({
|
|
22
|
+
nlpName: "GetDriverInstance",
|
|
23
|
+
stepInputs: [],
|
|
24
|
+
elementsData: []
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
} catch (error) {
|
|
28
|
+
args.scriptDataAppender.setErrorNLP("GetDriverInstance");
|
|
29
|
+
throw new Error("GetDriverInstance action failed", { cause: error });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getFirstContentfulPaintInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getFirstContentfulPaint = async (args: getFirstContentfulPaintInterface) => {
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
args.scriptDataAppender.add(async () => ({
|
|
7
|
+
nlpName: "GetFirstContentfulPaint",
|
|
8
|
+
stepInputs: [],
|
|
9
|
+
elementsData: []
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
} catch (error) {
|
|
13
|
+
args.scriptDataAppender.setErrorNLP("GetFirstContentfulPaint");
|
|
14
|
+
throw new Error("GetFirstContentfulPaint action failed", { cause: error })
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { getFirstSelectedOptionInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getFirstSelectedOption = async (
|
|
4
|
+
args: getFirstSelectedOptionInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const selectElement = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
const options = await selectElement.$$('option');
|
|
11
|
+
|
|
12
|
+
let _firstSelected = null;
|
|
13
|
+
|
|
14
|
+
for (const option of options) {
|
|
15
|
+
if (await option.isSelected()) {
|
|
16
|
+
_firstSelected = option;
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
args.scriptDataAppender.add(async () => {
|
|
24
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
25
|
+
args.pageDOM,
|
|
26
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
27
|
+
);
|
|
28
|
+
return {
|
|
29
|
+
nlpName: "GetFirstSelectedOption",
|
|
30
|
+
stepInputs: [],
|
|
31
|
+
elementsData: [{
|
|
32
|
+
name: args.elementName,
|
|
33
|
+
type: args.elementType,
|
|
34
|
+
locators: ffElement.locators,
|
|
35
|
+
platform: args.platform
|
|
36
|
+
}]
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
} catch (error) {
|
|
41
|
+
args.scriptDataAppender.setErrorNLP("GetFirstSelectedOption");
|
|
42
|
+
throw new Error("GetFirstSelectedOption action failed", { cause: error });
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getFullPaintTimeInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getFullPaintTime = async (args: getFullPaintTimeInterface) => {
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
args.scriptDataAppender.add(async () => ({
|
|
7
|
+
nlpName: "GetFullPaintTime",
|
|
8
|
+
stepInputs: [],
|
|
9
|
+
elementsData: []
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
} catch (error) {
|
|
13
|
+
args.scriptDataAppender.setErrorNLP("GetFullPaintTime");
|
|
14
|
+
throw new Error("GetFullPaintTime action failed", { cause: error })
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getHTMLCodeOfPageInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getHTMLCodeOfPage = async (
|
|
4
|
+
args: getHTMLCodeOfPageInterface
|
|
5
|
+
) => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
args.scriptDataAppender.add(async () => ({
|
|
9
|
+
nlpName: "GetHTMLCodeOfPage",
|
|
10
|
+
stepInputs: [],
|
|
11
|
+
elementsData: []
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
} catch (error) {
|
|
15
|
+
args.scriptDataAppender.setErrorNLP("GetHTMLCodeOfPage");
|
|
16
|
+
throw new Error("GetHTMLCodeOfPage action failed", { cause: error });
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getHeightOfBrowserWindowInterface } from "../../interface/getActionInterface.js"
|
|
2
|
+
|
|
3
|
+
export const getHeightOfBrowserWindow = async (
|
|
4
|
+
args: getHeightOfBrowserWindowInterface
|
|
5
|
+
) => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
args.scriptDataAppender.add(async () => ({
|
|
9
|
+
nlpName: "GetHeightOfBrowserWindow",
|
|
10
|
+
stepInputs: [],
|
|
11
|
+
elementsData: []
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
} catch (error) {
|
|
15
|
+
args.scriptDataAppender.setErrorNLP("GetHeightOfBrowserWindow");
|
|
16
|
+
throw new Error("GetHeightOfBrowserWindow action failed", { cause: error });
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getHeightOfWebElementInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getHeightOfWebElement = async (
|
|
4
|
+
args: getHeightOfWebElementInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
const _size = await element.getSize();
|
|
11
|
+
const _height = _size.height;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
args.scriptDataAppender.add(async () => {
|
|
16
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
17
|
+
args.pageDOM,
|
|
18
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
19
|
+
);
|
|
20
|
+
return {
|
|
21
|
+
nlpName: "GetHeightOfWebElement",
|
|
22
|
+
stepInputs: [],
|
|
23
|
+
elementsData: [{
|
|
24
|
+
name: args.elementName,
|
|
25
|
+
type: args.elementType,
|
|
26
|
+
locators: ffElement.locators,
|
|
27
|
+
platform: args.platform
|
|
28
|
+
}]
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
} catch (error) {
|
|
33
|
+
args.scriptDataAppender.setErrorNLP("GetHeightOfWebElement");
|
|
34
|
+
throw new Error("GetHeightOfWebElement action failed", { cause: error });
|
|
35
|
+
}
|
|
36
|
+
};
|