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,66 @@
|
|
|
1
|
+
import { VerifyLighthouseScoreInterface } from "../../interface/verifyActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export async function verifyPwaScore(
|
|
4
|
+
args: VerifyLighthouseScoreInterface
|
|
5
|
+
): Promise<void> {
|
|
6
|
+
try {
|
|
7
|
+
const inputs = args.value.split(',');
|
|
8
|
+
const url = inputs[0];
|
|
9
|
+
const device = inputs[1];
|
|
10
|
+
const minScore = parseFloat(inputs[2]);
|
|
11
|
+
|
|
12
|
+
if (!args.value) {
|
|
13
|
+
throw new Error("Input value is missing");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Navigate only if URL is provided
|
|
17
|
+
if (url && url.startsWith("http")) {
|
|
18
|
+
await args.driver.url(url);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const checks = await args.driver.execute(() => {
|
|
22
|
+
|
|
23
|
+
const https = window.location.href.startsWith("https");
|
|
24
|
+
|
|
25
|
+
const service_worker_supported =
|
|
26
|
+
'serviceWorker' in navigator;
|
|
27
|
+
|
|
28
|
+
const service_worker_registered =
|
|
29
|
+
navigator.serviceWorker &&
|
|
30
|
+
navigator.serviceWorker.controller !== null;
|
|
31
|
+
|
|
32
|
+
const manifest_present =
|
|
33
|
+
!!document.querySelector('link[rel="manifest"]');
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
https,
|
|
37
|
+
service_worker_supported,
|
|
38
|
+
service_worker_registered,
|
|
39
|
+
manifest_present
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const values = Object.values(checks as Record<string, boolean>);
|
|
44
|
+
const passed = values.filter(v => v).length;
|
|
45
|
+
const total = values.length;
|
|
46
|
+
|
|
47
|
+
const actualScore = Math.floor((passed / total) * 100);
|
|
48
|
+
|
|
49
|
+
if (actualScore < minScore) {
|
|
50
|
+
throw new Error(
|
|
51
|
+
`PWA score ${actualScore} is less than expected ${minScore}`
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
args.scriptDataAppender.add(async () => ({
|
|
56
|
+
nlpName: 'VerifyPwaScore',
|
|
57
|
+
stepInputs: [url, device, minScore.toString()],
|
|
58
|
+
elementsData: []
|
|
59
|
+
}));
|
|
60
|
+
|
|
61
|
+
} catch (error: any) {
|
|
62
|
+
args.scriptDataAppender.setErrorNLP("VerifyPwaScore")
|
|
63
|
+
throw new Error(`VerifyPwaScore action failed `, { cause: error });
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { VerifyRadioButtonIsNotSelectedInterface } from "../../interface/verifyActionInterface.js";
|
|
2
|
+
import { logger } from "../../../../utils/logger/logData.js";
|
|
3
|
+
export async function verifyRadioButtonIsNotSelected(
|
|
4
|
+
args: VerifyRadioButtonIsNotSelectedInterface
|
|
5
|
+
): Promise<void> {
|
|
6
|
+
try {
|
|
7
|
+
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
const isSelected = await element.isSelected();
|
|
11
|
+
const isMatched = !isSelected;
|
|
12
|
+
|
|
13
|
+
logger.info("Radio button NOT selected verification result:", {
|
|
14
|
+
isMatched,
|
|
15
|
+
isSelected
|
|
16
|
+
});
|
|
17
|
+
if (isMatched === false) {
|
|
18
|
+
throw new Error(`Radio button is selected. Expected: not selected, Actual: selected`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
args.scriptDataAppender.add(async () => {
|
|
22
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
23
|
+
args.pageDOM,
|
|
24
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
25
|
+
);
|
|
26
|
+
return {
|
|
27
|
+
nlpName: 'VerifyRadioButtonIsNotSelected',
|
|
28
|
+
stepInputs: [],
|
|
29
|
+
elementsData: [{
|
|
30
|
+
name: args.elementName,
|
|
31
|
+
type: args.elementType,
|
|
32
|
+
locators: ffElement.locators,
|
|
33
|
+
platform: args.platform
|
|
34
|
+
}]
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
} catch (error: any) {
|
|
39
|
+
args.scriptDataAppender.setErrorNLP("VerifyRadioButtonIsNotSelected");
|
|
40
|
+
throw new Error(`VerifyRadioButtonIsNotSelected action failed`, { cause: error });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { VerifyRadioButtonIsSelectedInterface } from "../../interface/verifyActionInterface.js";
|
|
2
|
+
import { logger } from "../../../../utils/logger/logData.js";
|
|
3
|
+
export async function verifyRadioButtonIsSelected(
|
|
4
|
+
args: VerifyRadioButtonIsSelectedInterface
|
|
5
|
+
): Promise<void> {
|
|
6
|
+
try {
|
|
7
|
+
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const isSelected = await element.isSelected();
|
|
12
|
+
|
|
13
|
+
logger.info("Radio button selected verification result:", {
|
|
14
|
+
isSelected
|
|
15
|
+
});
|
|
16
|
+
if (isSelected === false) {
|
|
17
|
+
throw new Error(`Radio button is not selected. Expected: selected, Actual: not selected`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
args.scriptDataAppender.add(async () => {
|
|
21
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
22
|
+
args.pageDOM,
|
|
23
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
24
|
+
);
|
|
25
|
+
return {
|
|
26
|
+
nlpName: 'VerifyRadioButtonIsSelected',
|
|
27
|
+
stepInputs: [],
|
|
28
|
+
elementsData: [{
|
|
29
|
+
name: args.elementName,
|
|
30
|
+
type: args.elementType,
|
|
31
|
+
locators: ffElement.locators,
|
|
32
|
+
platform: args.platform
|
|
33
|
+
}]
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
} catch (error: any) {
|
|
39
|
+
args.scriptDataAppender.setErrorNLP("VerifyRadioButtonIsSelected");
|
|
40
|
+
throw new Error(`VerifyRadioButtonIsSelected action failed`, { cause: error });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { VerifyLighthouseScoreInterface } from "../../interface/verifyActionInterface.js";
|
|
2
|
+
|
|
3
|
+
export async function verifySeoScore(
|
|
4
|
+
args: VerifyLighthouseScoreInterface
|
|
5
|
+
): Promise<void> {
|
|
6
|
+
try {
|
|
7
|
+
const inputs = args.value.split(',');
|
|
8
|
+
const url = inputs[0];
|
|
9
|
+
const device = inputs[1];
|
|
10
|
+
const minScore = parseFloat(inputs[2]);
|
|
11
|
+
|
|
12
|
+
if (!args.value) {
|
|
13
|
+
throw new Error("Input value is missing");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Navigate only if URL is provided
|
|
17
|
+
if (url && url.startsWith("http")) {
|
|
18
|
+
await args.driver.url(url);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const checks = await args.driver.execute(() => {
|
|
22
|
+
|
|
23
|
+
const https =
|
|
24
|
+
window.location.href.startsWith("https");
|
|
25
|
+
|
|
26
|
+
const title_present =
|
|
27
|
+
document.title && document.title.trim().length > 0;
|
|
28
|
+
|
|
29
|
+
const meta_description = (() => {
|
|
30
|
+
const m = document.querySelector('meta[name="description"]') as HTMLMetaElement | null;
|
|
31
|
+
return m && m.content && m.content.trim().length > 0;
|
|
32
|
+
})();
|
|
33
|
+
|
|
34
|
+
const canonical =
|
|
35
|
+
!!document.querySelector('link[rel="canonical"]');
|
|
36
|
+
|
|
37
|
+
const indexable = (() => {
|
|
38
|
+
const r = document.querySelector('meta[name="robots"]') as HTMLMetaElement | null;
|
|
39
|
+
return !r || !/noindex/i.test(r.content);
|
|
40
|
+
})();
|
|
41
|
+
|
|
42
|
+
const h1_present =
|
|
43
|
+
document.querySelectorAll('h1').length > 0;
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
https,
|
|
47
|
+
title_present,
|
|
48
|
+
meta_description,
|
|
49
|
+
canonical,
|
|
50
|
+
indexable,
|
|
51
|
+
h1_present
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const values = Object.values(checks as Record<string, boolean>);
|
|
56
|
+
const passed = values.filter(v => v).length;
|
|
57
|
+
const total = values.length;
|
|
58
|
+
|
|
59
|
+
const actualScore = Math.floor((passed / total) * 100);
|
|
60
|
+
|
|
61
|
+
if (actualScore < minScore) {
|
|
62
|
+
throw new Error(
|
|
63
|
+
`SEO score ${actualScore} is less than expected ${minScore}`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
args.scriptDataAppender.add(async () => ({
|
|
68
|
+
nlpName: 'VerifySeoScore',
|
|
69
|
+
stepInputs: [url, device, minScore.toString()],
|
|
70
|
+
elementsData: []
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
} catch (error: any) {
|
|
74
|
+
args.scriptDataAppender.setErrorNLP("VerifySeoScore")
|
|
75
|
+
throw new Error(`VerifySeoScore action failed `, { cause: error });
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { VerifyTagNameInterface } from "../../interface/verifyActionInterface.js";
|
|
2
|
+
import { logger } from "../../../../utils/logger/logData.js";
|
|
3
|
+
export async function verifyTagName(
|
|
4
|
+
args: VerifyTagNameInterface
|
|
5
|
+
): Promise<void> {
|
|
6
|
+
try {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const element = await args.driver.$(args.selector);
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const expectedTag = args.value.trim().toLowerCase();
|
|
14
|
+
const actualTag = (await element.getTagName()).toLowerCase();
|
|
15
|
+
const isMatched = actualTag === expectedTag;
|
|
16
|
+
|
|
17
|
+
logger.info("Tag name verification result:", { isMatched, actualTag, expectedTag });
|
|
18
|
+
if (isMatched === false) {
|
|
19
|
+
throw new Error(`Element tag name does not match expected. Expected: "${expectedTag}", Actual: "${actualTag}"`);
|
|
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: 'VerifyTagName',
|
|
29
|
+
stepInputs: [expectedTag],
|
|
30
|
+
elementsData: [{
|
|
31
|
+
name: args.elementName,
|
|
32
|
+
type: args.elementType,
|
|
33
|
+
locators: ffElement.locators,
|
|
34
|
+
platform: args.platform
|
|
35
|
+
}]
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
} catch (error: any) {
|
|
41
|
+
args.scriptDataAppender.setErrorNLP("VerifyTagName")
|
|
42
|
+
throw new Error(`VerifyTagName action failed `, { cause: error });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { VerifyThatSpecifiedOptionIsNotSelectedInterface } from "../../interface/verifyActionInterface.js";
|
|
2
|
+
import { logger } from "../../../../utils/logger/logData.js";
|
|
3
|
+
export async function verifyThatSpecifiedOptionIsNotSelected(
|
|
4
|
+
args: VerifyThatSpecifiedOptionIsNotSelectedInterface
|
|
5
|
+
): Promise<void> {
|
|
6
|
+
try {
|
|
7
|
+
let result = false;
|
|
8
|
+
let parts = (args.value ?? "").split(",");
|
|
9
|
+
|
|
10
|
+
if (parts.length === 1) {
|
|
11
|
+
parts = [parts[0], "false"];
|
|
12
|
+
}
|
|
13
|
+
const expectedText = parts[0].trim();
|
|
14
|
+
const caseSensitive = parts[1].trim();
|
|
15
|
+
|
|
16
|
+
const element = await args.driver.$(args.selector);
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
const options = await element.$$("option");
|
|
20
|
+
|
|
21
|
+
for (const option of options) {
|
|
22
|
+
|
|
23
|
+
if (!(await option.isSelected())) continue;
|
|
24
|
+
|
|
25
|
+
const optionText = await option.getText();
|
|
26
|
+
|
|
27
|
+
if (caseSensitive) {
|
|
28
|
+
if (optionText === expectedText) {
|
|
29
|
+
result = true
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
} else {
|
|
33
|
+
if (optionText.toLowerCase() === expectedText.toLowerCase()) {
|
|
34
|
+
result = true
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
logger.info("Option selection verification result:", {
|
|
40
|
+
expectedText,
|
|
41
|
+
result
|
|
42
|
+
});
|
|
43
|
+
if (result === true) {
|
|
44
|
+
throw new Error(`A selected option matching the expected text was found. Expected no selected option with text: "${expectedText}"`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
args.scriptDataAppender.add(async () => {
|
|
48
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
49
|
+
args.pageDOM,
|
|
50
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
51
|
+
);
|
|
52
|
+
return {
|
|
53
|
+
nlpName: 'VerifyThatSpecifiedOptionIsNotSelected',
|
|
54
|
+
stepInputs: [expectedText, caseSensitive],
|
|
55
|
+
elementsData: [{
|
|
56
|
+
name: args.elementName,
|
|
57
|
+
type: args.elementType,
|
|
58
|
+
locators: ffElement.locators,
|
|
59
|
+
platform: args.platform
|
|
60
|
+
}]
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
} catch (error: any) {
|
|
65
|
+
args.scriptDataAppender?.setErrorNLP(
|
|
66
|
+
"VerifyThatSpecifiedOptionIsNotSelected"
|
|
67
|
+
);
|
|
68
|
+
throw new Error(
|
|
69
|
+
"VerifyThatSpecifiedOptionIsNotSelected failed",
|
|
70
|
+
{ cause: error }
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { VerifyTitleInAllPageInterface } from "../../interface/verifyActionInterface.js";
|
|
2
|
+
import { logger } from "../../../../utils/logger/logData.js";
|
|
3
|
+
|
|
4
|
+
export async function verifyTitleInAllPage(
|
|
5
|
+
args: VerifyTitleInAllPageInterface
|
|
6
|
+
): Promise<void> {
|
|
7
|
+
try {
|
|
8
|
+
let result = false
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const expectedTitle = args.value.trim().toLowerCase();
|
|
13
|
+
const caseSensitive = false
|
|
14
|
+
|
|
15
|
+
const currentHandle = await args.driver.getWindowHandle();
|
|
16
|
+
const handles = await args.driver.getWindowHandles();
|
|
17
|
+
|
|
18
|
+
for (const handle of handles) {
|
|
19
|
+
|
|
20
|
+
await args.driver.switchToWindow(handle);
|
|
21
|
+
const actualTitle = (await args.driver.getTitle()).toLowerCase();
|
|
22
|
+
|
|
23
|
+
if (actualTitle === expectedTitle) {
|
|
24
|
+
await args.driver.switchToWindow(currentHandle);
|
|
25
|
+
result = true
|
|
26
|
+
break;
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
await args.driver.switchToWindow(currentHandle);
|
|
32
|
+
logger.info("Title verification across all pages result: All pages have the expected title", {
|
|
33
|
+
expectedTitle,
|
|
34
|
+
pageCount: handles.length,
|
|
35
|
+
result
|
|
36
|
+
});
|
|
37
|
+
if (result === false) {
|
|
38
|
+
throw new Error(`Not all pages have the expected title. Expected: "${expectedTitle}"`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
args.scriptDataAppender.add(async () => ({
|
|
42
|
+
nlpName: 'VerifyTitleInAllPage',
|
|
43
|
+
stepInputs: [expectedTitle, caseSensitive],
|
|
44
|
+
elementsData: []
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
} catch (error: any) {
|
|
48
|
+
args.scriptDataAppender?.setErrorNLP("VerifyTitleInAllPage");
|
|
49
|
+
throw new Error("VerifyTitleInAllPage failed", { cause: error });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { VerifyTitleOfCurrentPageInterface } from "../../interface/verifyActionInterface.js";
|
|
2
|
+
import { logger } from "../../../../utils/logger/logData.js";
|
|
3
|
+
export async function verifyTitleOfCurrentPage(
|
|
4
|
+
args: VerifyTitleOfCurrentPageInterface
|
|
5
|
+
): Promise<void> {
|
|
6
|
+
try {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const expectedTitle = args.value.trim();
|
|
11
|
+
const actualTitle = await args.driver.getTitle();
|
|
12
|
+
const isMatched = actualTitle.trim() === expectedTitle;
|
|
13
|
+
const caseSensitive = false;
|
|
14
|
+
const time = 2000;
|
|
15
|
+
|
|
16
|
+
logger.info("Title verification result:", { isMatched, actualTitle, expectedTitle });
|
|
17
|
+
if (isMatched === false) {
|
|
18
|
+
throw new Error(`Page title does not match expected. Expected: "${expectedTitle}", Actual: "${actualTitle}"`);
|
|
19
|
+
}
|
|
20
|
+
args.scriptDataAppender.add(async () => ({
|
|
21
|
+
nlpName: 'VerifyTitleOfCurrentPage',
|
|
22
|
+
stepInputs: [expectedTitle, caseSensitive, time],
|
|
23
|
+
elementsData: []
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
} catch (error: any) {
|
|
27
|
+
args.scriptDataAppender.setErrorNLP("VerifyTitleOfCurrentPage")
|
|
28
|
+
throw new Error(`VerifyTitleOfCurrentPage action failed `, { cause: error });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { VerifyValueOfElementContainsStringInterface } from "../../interface/verifyActionInterface.js";
|
|
2
|
+
import { logger } from "../../../../utils/logger/logData.js";
|
|
3
|
+
export async function verifyValueOfElementContainsString(
|
|
4
|
+
args: VerifyValueOfElementContainsStringInterface
|
|
5
|
+
): Promise<void> {
|
|
6
|
+
try {
|
|
7
|
+
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
const expectedText = args.value;
|
|
10
|
+
|
|
11
|
+
const actualValue =
|
|
12
|
+
(await element.getAttribute("value")) ||
|
|
13
|
+
(await element.getText()) ||
|
|
14
|
+
"";
|
|
15
|
+
|
|
16
|
+
const isMatched = actualValue
|
|
17
|
+
.toLowerCase()
|
|
18
|
+
.includes(expectedText.toLowerCase());
|
|
19
|
+
|
|
20
|
+
logger.info("Contains value verification result:", {
|
|
21
|
+
isMatched,
|
|
22
|
+
actualValue,
|
|
23
|
+
expectedText
|
|
24
|
+
});
|
|
25
|
+
const caseSensitive = false;
|
|
26
|
+
if (isMatched === false) {
|
|
27
|
+
throw new Error(`Element value does not contain expected text. Expected to contain: "${expectedText}", Actual: "${actualValue}"`);
|
|
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: 'VerifyValueOfElementContainsString',
|
|
37
|
+
stepInputs: [args.value, caseSensitive],
|
|
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: any) {
|
|
48
|
+
args.scriptDataAppender.setErrorNLP("VerifyValueOfElementContainsString");
|
|
49
|
+
throw new Error(`VerifyValueOfElementContainsString action failed`, { cause: error });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { VerifyValueOfElementIsClearedInterface } from "../../interface/verifyActionInterface.js";
|
|
2
|
+
import { logger } from "../../../../utils/logger/logData.js";
|
|
3
|
+
export async function verifyValueOfElementIsCleared(
|
|
4
|
+
args: VerifyValueOfElementIsClearedInterface
|
|
5
|
+
): Promise<void> {
|
|
6
|
+
try {
|
|
7
|
+
|
|
8
|
+
const element = await args.driver.$(args.selector);
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const actualValue =
|
|
12
|
+
(await element.getAttribute("value")) || "";
|
|
13
|
+
|
|
14
|
+
const isMatched = actualValue.trim().length === 0;
|
|
15
|
+
|
|
16
|
+
logger.info("Cleared value verification result:", {
|
|
17
|
+
isMatched,
|
|
18
|
+
actualValue
|
|
19
|
+
});
|
|
20
|
+
if (isMatched === false) {
|
|
21
|
+
throw new Error(`Element value is not cleared. Actual value: "${actualValue}"`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
args.scriptDataAppender.add(async () => {
|
|
25
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
26
|
+
args.pageDOM,
|
|
27
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
28
|
+
);
|
|
29
|
+
return {
|
|
30
|
+
nlpName: 'VerifyValueOfElementIsCleared',
|
|
31
|
+
stepInputs: [],
|
|
32
|
+
elementsData: [{
|
|
33
|
+
name: args.elementName,
|
|
34
|
+
type: args.elementType,
|
|
35
|
+
locators: ffElement.locators,
|
|
36
|
+
platform: args.platform
|
|
37
|
+
}]
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
} catch (error: any) {
|
|
42
|
+
args.scriptDataAppender.setErrorNLP("VerifyValueOfElementIsCleared");
|
|
43
|
+
throw new Error(`VerifyValueOfElementIsCleared action failed`, { cause: error });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { VerifyValueOfElementIsStringInterface } from "../../interface/verifyActionInterface.js";
|
|
2
|
+
import { logger } from "../../../../utils/logger/logData.js";
|
|
3
|
+
export async function verifyValueOfElementIsString(
|
|
4
|
+
args: VerifyValueOfElementIsStringInterface
|
|
5
|
+
): Promise<void> {
|
|
6
|
+
try {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const element = await args.driver.$(args.selector);
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const expectedValue = args.value;
|
|
14
|
+
|
|
15
|
+
const actualValue =
|
|
16
|
+
(await element.getAttribute("value")) ||
|
|
17
|
+
(await element.getText()) ||
|
|
18
|
+
"";
|
|
19
|
+
|
|
20
|
+
const isMatched =
|
|
21
|
+
actualValue.toLowerCase() === expectedValue.toLowerCase();
|
|
22
|
+
|
|
23
|
+
logger.info("Exact value verification result:", {
|
|
24
|
+
isMatched,
|
|
25
|
+
actualValue,
|
|
26
|
+
expectedValue
|
|
27
|
+
});
|
|
28
|
+
const caseSensitive = false;
|
|
29
|
+
if (isMatched === false) {
|
|
30
|
+
throw new Error(`Element value does not match expected. Expected: "${expectedValue}", Actual: "${actualValue}"`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
args.scriptDataAppender.add(async () => {
|
|
34
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
35
|
+
args.pageDOM,
|
|
36
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
37
|
+
);
|
|
38
|
+
return {
|
|
39
|
+
nlpName: 'VerifyValueOfElementIsString',
|
|
40
|
+
stepInputs: [args.value, caseSensitive],
|
|
41
|
+
elementsData: [{
|
|
42
|
+
name: args.elementName,
|
|
43
|
+
type: args.elementType,
|
|
44
|
+
locators: ffElement.locators,
|
|
45
|
+
platform: args.platform
|
|
46
|
+
}]
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
} catch (error: any) {
|
|
51
|
+
args.scriptDataAppender.setErrorNLP("VerifyValueOfElementIsString");
|
|
52
|
+
throw new Error(`VerifyValueOfElementIsString action failed`, { cause: error });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { VerifyWidthOfElementInterface } from "../../interface/verifyActionInterface.js";
|
|
2
|
+
import { logger } from "../../../../utils/logger/logData.js";
|
|
3
|
+
export async function verifyWidthOfElement(
|
|
4
|
+
args: VerifyWidthOfElementInterface
|
|
5
|
+
): Promise<void> {
|
|
6
|
+
switch (args.platform) {
|
|
7
|
+
case "android":
|
|
8
|
+
try {
|
|
9
|
+
|
|
10
|
+
const element = await args.driver.$(args.selector);
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const expectedWidth = parseInt(args.value, 10);
|
|
14
|
+
const size = await element.getSize();
|
|
15
|
+
|
|
16
|
+
const isMatched = size.width === expectedWidth;
|
|
17
|
+
|
|
18
|
+
logger.info("Width verification result:", {
|
|
19
|
+
isMatched,
|
|
20
|
+
actualWidth: size.width,
|
|
21
|
+
expectedWidth
|
|
22
|
+
});
|
|
23
|
+
if (isMatched === false) {
|
|
24
|
+
throw new Error(`Element width does not match expected. Expected: ${expectedWidth}px, Actual: ${size.width}px`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
args.scriptDataAppender.add(async () => {
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
nlpName: 'MOB_VerifyWidthOfElement',
|
|
31
|
+
stepInputs: [args.value],
|
|
32
|
+
elementsData: [{
|
|
33
|
+
name: args.elementName,
|
|
34
|
+
type: args.elementType,
|
|
35
|
+
locators: [{ "xpath": args.selector }],
|
|
36
|
+
platform: args.platform
|
|
37
|
+
}]
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
} catch (error: any) {
|
|
42
|
+
args.scriptDataAppender.setErrorNLP("MOB_VerifyWidthOfElement");
|
|
43
|
+
throw new Error(`VerifyWidthOfElement action failed`, { cause: error });
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
case "web":
|
|
47
|
+
default:
|
|
48
|
+
try {
|
|
49
|
+
|
|
50
|
+
const element = await args.driver.$(args.selector);
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
const expectedWidth = parseInt(args.value, 10);
|
|
54
|
+
const size = await element.getSize();
|
|
55
|
+
|
|
56
|
+
const isMatched = size.width === expectedWidth;
|
|
57
|
+
|
|
58
|
+
logger.info("Width verification result:", {
|
|
59
|
+
isMatched,
|
|
60
|
+
actualWidth: size.width,
|
|
61
|
+
expectedWidth
|
|
62
|
+
});
|
|
63
|
+
if (isMatched === false) {
|
|
64
|
+
throw new Error(`Element width does not match expected. Expected: ${expectedWidth}px, Actual: ${size.width}px`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
args.scriptDataAppender.add(async () => {
|
|
68
|
+
const ffElement: any = await args.elementGetter.getFireFlinkElement(
|
|
69
|
+
args.pageDOM,
|
|
70
|
+
`[ff-inspect="${args.fireflinkIndex}"]`
|
|
71
|
+
);
|
|
72
|
+
return {
|
|
73
|
+
nlpName: 'VerifyWidthOfElement',
|
|
74
|
+
stepInputs: [args.value],
|
|
75
|
+
elementsData: [{
|
|
76
|
+
name: args.elementName,
|
|
77
|
+
type: args.elementType,
|
|
78
|
+
locators: ffElement.locators,
|
|
79
|
+
platform: args.platform
|
|
80
|
+
}]
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
} catch (error: any) {
|
|
85
|
+
args.scriptDataAppender.setErrorNLP("VerifyWidthOfElement");
|
|
86
|
+
throw new Error(`VerifyWidthOfElement action failed`, { cause: error });
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
}
|