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,16 @@
|
|
|
1
|
+
import { getAllCookieValuesInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAllCookieValues = async (args: getAllCookieValuesInterface) => {
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
args.scriptDataAppender.add(async () => ({
|
|
7
|
+
nlpName: "GetAllCookieValues",
|
|
8
|
+
stepInputs: [],
|
|
9
|
+
elementsData: []
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
} catch (error) {
|
|
13
|
+
args.scriptDataAppender.setErrorNLP("GetAllCookieValues");
|
|
14
|
+
throw new Error("GetAllCookieValues action failed", { cause: error });
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { getAllSelectedOptionsInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAllSelectedOptions = async (
|
|
4
|
+
args: getAllSelectedOptionsInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const selectElement = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
const options = await selectElement.$$('option');
|
|
11
|
+
|
|
12
|
+
const _selectedOptions = [];
|
|
13
|
+
|
|
14
|
+
for (const option of options) {
|
|
15
|
+
if (await option.isSelected()) {
|
|
16
|
+
_selectedOptions.push(option);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
args.scriptDataAppender.add(async () => {
|
|
23
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
24
|
+
args.pageDOM,
|
|
25
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
26
|
+
);
|
|
27
|
+
return {
|
|
28
|
+
nlpName: "GetAllSelectedOptions",
|
|
29
|
+
stepInputs: [],
|
|
30
|
+
elementsData: [{
|
|
31
|
+
name: args.elementName,
|
|
32
|
+
type: args.elementType,
|
|
33
|
+
locators: ffElement.locators,
|
|
34
|
+
platform: args.platform
|
|
35
|
+
}]
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
} catch (error) {
|
|
40
|
+
args.scriptDataAppender.setErrorNLP("GetAllSelectedOptions");
|
|
41
|
+
throw new Error("GetAllSelectedOptions action failed", { cause: error });
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { getAllTheOptionsFromListBoxAsTextInterface }
|
|
2
|
+
from "../../interface/getActionInterface.js";
|
|
3
|
+
|
|
4
|
+
export const getAllTheOptionsFromListBoxAsText = async (
|
|
5
|
+
args: getAllTheOptionsFromListBoxAsTextInterface
|
|
6
|
+
): Promise<void> => {
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const selectElement = await args.driver.$(args.selector);
|
|
10
|
+
|
|
11
|
+
const options = await selectElement.$$('option');
|
|
12
|
+
|
|
13
|
+
const _texts: string[] = [];
|
|
14
|
+
|
|
15
|
+
for (const option of options) {
|
|
16
|
+
const text = await option.getText();
|
|
17
|
+
_texts.push(text.trim());
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
args.scriptDataAppender.add(async () => {
|
|
23
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
24
|
+
args.pageDOM,
|
|
25
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
26
|
+
);
|
|
27
|
+
return {
|
|
28
|
+
nlpName: "GetAllTheOptionsFromListBoxAsText",
|
|
29
|
+
stepInputs: [],
|
|
30
|
+
elementsData: [{
|
|
31
|
+
name: args.elementName,
|
|
32
|
+
type: args.elementType,
|
|
33
|
+
locators: ffElement.locators,
|
|
34
|
+
platform: args.platform
|
|
35
|
+
}]
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
} catch (error) {
|
|
40
|
+
args.scriptDataAppender.setErrorNLP("GetAllTheOptionsFromListBoxAsText");
|
|
41
|
+
throw new Error(
|
|
42
|
+
"GetAllTheOptionsFromListBoxAsText action failed",
|
|
43
|
+
{ cause: error }
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
};
|
package/src/automation/actions/interaction/get/getAllTheOptionsFromListBoxAsTextInSortedOrder.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { getAllTheOptionsFromListBoxAsTextInSortedOrderInterface }
|
|
2
|
+
from "../../interface/getActionInterface.js";
|
|
3
|
+
|
|
4
|
+
export const getAllTheOptionsFromListBoxAsTextInSortedOrder = async (
|
|
5
|
+
args: getAllTheOptionsFromListBoxAsTextInSortedOrderInterface
|
|
6
|
+
): Promise<void> => {
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const selectElement = await args.driver.$(args.selector);
|
|
10
|
+
|
|
11
|
+
const options = await selectElement.$$('option');
|
|
12
|
+
|
|
13
|
+
const _texts: string[] = [];
|
|
14
|
+
|
|
15
|
+
for (const option of options) {
|
|
16
|
+
const text = await option.getText();
|
|
17
|
+
_texts.push(text.trim());
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// value is strictly boolean now
|
|
21
|
+
const isAscending = args.value;
|
|
22
|
+
|
|
23
|
+
_texts.sort((a, b) => a.localeCompare(b));
|
|
24
|
+
|
|
25
|
+
if (!isAscending) {
|
|
26
|
+
_texts.reverse();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
args.scriptDataAppender.add(async () => {
|
|
31
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
32
|
+
args.pageDOM,
|
|
33
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
34
|
+
);
|
|
35
|
+
return {
|
|
36
|
+
nlpName: "GetAllTheOptionsFromListBoxAsTextInSortedOrder",
|
|
37
|
+
stepInputs: [args.value],
|
|
38
|
+
elementsData: [{
|
|
39
|
+
name: args.elementName,
|
|
40
|
+
type: args.elementType,
|
|
41
|
+
locators: ffElement.locators,
|
|
42
|
+
platform: args.platform
|
|
43
|
+
}]
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
} catch (error) {
|
|
48
|
+
args.scriptDataAppender.setErrorNLP("GetAllTheOptionsFromListBoxAsTextInSortedOrder");
|
|
49
|
+
throw new Error(
|
|
50
|
+
"GetAllTheOptionsFromListBoxAsTextInSortedOrder action failed",
|
|
51
|
+
{ cause: error }
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { getAllTheSelectedOptionsFromListBoxAsTextInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAllTheSelectedOptionsFromListBoxAsText = async (
|
|
4
|
+
args: getAllTheSelectedOptionsFromListBoxAsTextInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const selectElement = await args.driver.$(args.selector);
|
|
9
|
+
const options = await selectElement.$$('option');
|
|
10
|
+
|
|
11
|
+
const _selectedTexts: string[] = [];
|
|
12
|
+
|
|
13
|
+
for (const option of options) {
|
|
14
|
+
if (await option.isSelected()) {
|
|
15
|
+
const text = await option.getText();
|
|
16
|
+
_selectedTexts.push(text.trim());
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
args.scriptDataAppender.add(async () => {
|
|
23
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
24
|
+
args.pageDOM,
|
|
25
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
26
|
+
);
|
|
27
|
+
return {
|
|
28
|
+
nlpName: "GetAllTheSelectedOptionsFromListBoxAsText",
|
|
29
|
+
stepInputs: [],
|
|
30
|
+
elementsData: [{
|
|
31
|
+
name: args.elementName,
|
|
32
|
+
type: args.elementType,
|
|
33
|
+
locators: ffElement.locators,
|
|
34
|
+
platform: args.platform
|
|
35
|
+
}]
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
} catch (error) {
|
|
40
|
+
args.scriptDataAppender.setErrorNLP("GetAllTheSelectedOptionsFromListBoxAsText");
|
|
41
|
+
throw new Error("GetAllTheSelectedOptionsFromListBoxAsText action failed", { cause: error });
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getAllWindowHandlesInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAllWindowHandles = async (
|
|
4
|
+
args: getAllWindowHandlesInterface
|
|
5
|
+
) => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
args.scriptDataAppender.add(async () => ({
|
|
9
|
+
nlpName: "GetAllWindowHandles",
|
|
10
|
+
stepInputs: [],
|
|
11
|
+
elementsData: []
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
} catch (error) {
|
|
15
|
+
args.scriptDataAppender.setErrorNLP("GetAllWindowHandles");
|
|
16
|
+
throw new Error("GetAllWindowHandles action failed", { cause: error });
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { getAttributeInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
import { logger } from "../../../../utils/logger/logData.js";
|
|
3
|
+
|
|
4
|
+
export async function getAttribute(
|
|
5
|
+
args: getAttributeInterface
|
|
6
|
+
): Promise<void> {
|
|
7
|
+
switch (args.platform) {
|
|
8
|
+
case "android":
|
|
9
|
+
try {
|
|
10
|
+
|
|
11
|
+
const attributeName = args.value;
|
|
12
|
+
if (attributeName === "") {
|
|
13
|
+
throw new Error("For GetAttribute action Attributr is not Provided");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
logger.info("Attribute value in getAttribute:", {
|
|
18
|
+
attributeName
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
args.scriptDataAppender.add(async () => {
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
nlpName: "MOB_GetAttribute",
|
|
26
|
+
stepInputs: [attributeName],
|
|
27
|
+
elementsData: [{
|
|
28
|
+
name: args.elementName,
|
|
29
|
+
type: args.elementType,
|
|
30
|
+
locators: [{ "xpath": args.selector }],
|
|
31
|
+
platform: args.platform
|
|
32
|
+
}]
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
} catch (error: any) {
|
|
39
|
+
args.scriptDataAppender.setErrorNLP("MOB_GetAttribute");
|
|
40
|
+
throw new Error("GetAttribute action failed", { cause: error });
|
|
41
|
+
}
|
|
42
|
+
break;
|
|
43
|
+
case "web":
|
|
44
|
+
default:
|
|
45
|
+
try {
|
|
46
|
+
const attributeName = args.value;
|
|
47
|
+
if (attributeName === "") {
|
|
48
|
+
throw new Error("For GetAttribute action Attributr is not Provided");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
logger.info("Attribute value in getAttribute:", {
|
|
53
|
+
attributeName
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
args.scriptDataAppender.add(async () => {
|
|
58
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
59
|
+
args.pageDOM,
|
|
60
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
61
|
+
);
|
|
62
|
+
return {
|
|
63
|
+
nlpName: "GetAttribute",
|
|
64
|
+
stepInputs: [attributeName],
|
|
65
|
+
elementsData: [{
|
|
66
|
+
name: args.elementName,
|
|
67
|
+
type: args.elementType,
|
|
68
|
+
locators: ffElement.locators,
|
|
69
|
+
platform: args.platform
|
|
70
|
+
}]
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
} catch (error: any) {
|
|
77
|
+
args.scriptDataAppender.setErrorNLP("GetAttribute");
|
|
78
|
+
throw new Error("GetAttribute action failed", { cause: error });
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { getAudioCurrentPlaybackRateInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAudioCurrentPlaybackRate = async (
|
|
4
|
+
args: getAudioCurrentPlaybackRateInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
// playbackRate returns current speed (default is 1)
|
|
11
|
+
const _currentPlaybackRate = await element.getProperty("playbackRate");
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
args.scriptDataAppender.add(async () => {
|
|
15
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
16
|
+
args.pageDOM,
|
|
17
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
18
|
+
);
|
|
19
|
+
return {
|
|
20
|
+
nlpName: "GetAudioCurrentPlaybackRate",
|
|
21
|
+
stepInputs: [],
|
|
22
|
+
elementsData: [{
|
|
23
|
+
name: args.elementName,
|
|
24
|
+
type: args.elementType,
|
|
25
|
+
locators: ffElement.locators,
|
|
26
|
+
platform: args.platform
|
|
27
|
+
}]
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
} catch (error) {
|
|
32
|
+
args.scriptDataAppender.setErrorNLP("GetAudioCurrentPlaybackRate");
|
|
33
|
+
throw new Error("GetAudioCurrentPlaybackRate action failed", { cause: error });
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getAudioCurrentSeekTimeInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAudioCurrentSeekTime = async (
|
|
4
|
+
args: getAudioCurrentSeekTimeInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
// currentTime returns current playback position in seconds
|
|
11
|
+
const _currentSeekTime = await element.getProperty("currentTime");
|
|
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: "GetAudioCurrentSeekTime",
|
|
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("GetAudioCurrentSeekTime");
|
|
34
|
+
throw new Error("GetAudioCurrentSeekTime action failed", { cause: error });
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getAudioCurrentVolumeInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAudioCurrentVolume = async (
|
|
4
|
+
args: getAudioCurrentVolumeInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
// volume returns value between 0.0 and 1.0
|
|
11
|
+
const _currentVolume = await element.getProperty("volume");
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
args.scriptDataAppender.add(async () => {
|
|
15
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
16
|
+
args.pageDOM,
|
|
17
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
nlpName: "GetAudioCurrentVolume",
|
|
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("GetAudioCurrentVolume");
|
|
34
|
+
throw new Error("GetAudioCurrentVolume action failed", { cause: error });
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { getAudioDecodedByteInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAudioDecodedByte = async (
|
|
4
|
+
args: getAudioDecodedByteInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
// Get buffered duration (closest equivalent to decoded media)
|
|
11
|
+
const _decodedValue = await args.driver.execute((el: any) => {
|
|
12
|
+
|
|
13
|
+
if (el.buffered && el.buffered.length > 0) {
|
|
14
|
+
return el.buffered.end(0); // seconds buffered
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return 0;
|
|
18
|
+
|
|
19
|
+
}, element);
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
args.scriptDataAppender.add(async () => {
|
|
23
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
24
|
+
args.pageDOM,
|
|
25
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
26
|
+
);
|
|
27
|
+
return {
|
|
28
|
+
nlpName: "GetAudioDecodedByte",
|
|
29
|
+
stepInputs: [],
|
|
30
|
+
elementsData: [{
|
|
31
|
+
name: args.elementName,
|
|
32
|
+
type: args.elementType,
|
|
33
|
+
locators: ffElement.locators,
|
|
34
|
+
platform: args.platform
|
|
35
|
+
}]
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
} catch (error) {
|
|
40
|
+
args.scriptDataAppender.setErrorNLP("GetAudioDecodedByte");
|
|
41
|
+
throw new Error("GetAudioDecodedByte action failed", { cause: error });
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getAudioDefaultPlaybackRateInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAudioDefaultPlaybackRate = async (
|
|
4
|
+
args: getAudioDefaultPlaybackRateInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
// defaultPlaybackRate returns original playback speed (default = 1)
|
|
11
|
+
const _defaultPlaybackRate = await element.getProperty("defaultPlaybackRate");
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
args.scriptDataAppender.add(async () => {
|
|
15
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
16
|
+
args.pageDOM,
|
|
17
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
nlpName: "GetAudioDefaultPlaybackRate",
|
|
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("GetAudioDefaultPlaybackRate");
|
|
34
|
+
throw new Error("GetAudioDefaultPlaybackRate action failed", { cause: error });
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { getAudioDimensionInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAudioDimension = async (
|
|
4
|
+
args: getAudioDimensionInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
// Get rendered width and height
|
|
11
|
+
const size = await args.driver.execute((el: any) => {
|
|
12
|
+
return {
|
|
13
|
+
width: el.offsetWidth,
|
|
14
|
+
height: el.offsetHeight
|
|
15
|
+
};
|
|
16
|
+
}, element);
|
|
17
|
+
|
|
18
|
+
const _dimension = `${size.width} x ${size.height}`;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
args.scriptDataAppender.add(async () => {
|
|
23
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
24
|
+
args.pageDOM,
|
|
25
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
26
|
+
);
|
|
27
|
+
return {
|
|
28
|
+
nlpName: "GetAudioDimension",
|
|
29
|
+
stepInputs: [],
|
|
30
|
+
elementsData: [{
|
|
31
|
+
name: args.elementName,
|
|
32
|
+
type: args.elementType,
|
|
33
|
+
locators: ffElement.locators,
|
|
34
|
+
platform: args.platform
|
|
35
|
+
}]
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
} catch (error) {
|
|
40
|
+
args.scriptDataAppender.setErrorNLP("GetAudioDimension");
|
|
41
|
+
throw new Error("GetAudioDimension action failed", { cause: error });
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getAudioHeightInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAudioHeight = async (
|
|
4
|
+
args: getAudioHeightInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
// Get rendered height of the audio element
|
|
11
|
+
const _audioHeight = await args.driver.execute((el: any) => {
|
|
12
|
+
return el.offsetHeight;
|
|
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: "GetAudioHeight",
|
|
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("GetAudioHeight");
|
|
36
|
+
throw new Error("GetAudioHeight action failed", { cause: error });
|
|
37
|
+
}
|
|
38
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getAudioMediaLengthInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAudioMediaLength = async (
|
|
4
|
+
args: getAudioMediaLengthInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
// duration returns total audio length in seconds
|
|
11
|
+
const _audioDuration = await element.getProperty("duration");
|
|
12
|
+
|
|
13
|
+
args.scriptDataAppender.add(async () => {
|
|
14
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
15
|
+
args.pageDOM,
|
|
16
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
17
|
+
);
|
|
18
|
+
return {
|
|
19
|
+
nlpName: "GetAudioMediaLength",
|
|
20
|
+
stepInputs: [],
|
|
21
|
+
elementsData: [{
|
|
22
|
+
name: args.elementName,
|
|
23
|
+
type: args.elementType,
|
|
24
|
+
locators: ffElement.locators,
|
|
25
|
+
platform: args.platform
|
|
26
|
+
}]
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
} catch (error) {
|
|
31
|
+
args.scriptDataAppender.setErrorNLP("GetAudioMediaLength");
|
|
32
|
+
throw new Error("GetAudioMediaLength action failed", { cause: error });
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { getAudioMediaSourceInterface } from "../../interface/getActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export const getAudioMediaSource = async (
|
|
4
|
+
args: getAudioMediaSourceInterface
|
|
5
|
+
): Promise<void> => {
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
// ✅ Try direct src attribute first
|
|
11
|
+
let _audioSource = await element.getAttribute("src");
|
|
12
|
+
|
|
13
|
+
// ✅ If <source> tag is used inside <audio>
|
|
14
|
+
if (!_audioSource) {
|
|
15
|
+
const sourceElement = await element.$("source");
|
|
16
|
+
if (await sourceElement.isExisting()) {
|
|
17
|
+
_audioSource = await sourceElement.getAttribute("src");
|
|
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: "GetAudioMediaSource",
|
|
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("GetAudioMediaSource");
|
|
42
|
+
throw new Error("GetAudioMediaSource action failed", { cause: error });
|
|
43
|
+
}
|
|
44
|
+
};
|