@mablhq/playwright-tools 2.49.1
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/Globals.js +69 -0
- package/LICENSE.txt +29 -0
- package/README.md +219 -0
- package/api/ApiError.js +11 -0
- package/api/atlassian/bitBucketApiClient.js +81 -0
- package/api/atlassian/entities/CodeAnnotation.js +9 -0
- package/api/atlassian/entities/CodeReport.js +15 -0
- package/api/atlassian/entities/PullRequest.js +2 -0
- package/api/basicApiClient.js +293 -0
- package/api/entities/Browser.js +11 -0
- package/api/entities/Email.js +14 -0
- package/api/entities/FindStrategy.js +10 -0
- package/api/entities/Label.js +2 -0
- package/api/entities/VersionedObject.js +2 -0
- package/api/entities/Workspace.js +2 -0
- package/api/featureSet.js +44 -0
- package/api/mablApiClient.js +1070 -0
- package/api/mablApiClientFactory.js +79 -0
- package/api/types.js +10 -0
- package/auth/AuthClient.js +38 -0
- package/auth/OktaClient.js +97 -0
- package/browserEngines/browserEngine.js +41 -0
- package/browserEngines/browserEngines.js +14 -0
- package/browserEngines/chromiumBrowserEngine.js +177 -0
- package/browserEngines/firefoxBrowserEngine.js +134 -0
- package/browserEngines/unsupportedBrowserEngine.js +29 -0
- package/browserEngines/webkitBrowerEngine.js +50 -0
- package/browserLauncher/browser.js +2 -0
- package/browserLauncher/browserEvent.js +11 -0
- package/browserLauncher/browserLauncher.js +17 -0
- package/browserLauncher/browserLauncherEventEmitter.js +2 -0
- package/browserLauncher/browserLauncherFactory.js +30 -0
- package/browserLauncher/elementHandle.js +30 -0
- package/browserLauncher/errors.js +26 -0
- package/browserLauncher/frame.js +17 -0
- package/browserLauncher/frameBase.js +10 -0
- package/browserLauncher/httpRequest.js +2 -0
- package/browserLauncher/httpResponse.js +2 -0
- package/browserLauncher/jsHandle.js +2 -0
- package/browserLauncher/page.js +2 -0
- package/browserLauncher/pageEvent.js +17 -0
- package/browserLauncher/playwrightBrowserLauncher/browserDelegate.js +2 -0
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumBrowserDelegate.js +61 -0
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumElementHandleDelegate.js +129 -0
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumFrameDelegate.js +24 -0
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumPageDelegate.js +145 -0
- package/browserLauncher/playwrightBrowserLauncher/elementHandleDelegate.js +2 -0
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxBrowserDelegate.js +50 -0
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxElementHandleDelegate.js +11 -0
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxFrameDelegate.js +36 -0
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxPageDelegate.js +15 -0
- package/browserLauncher/playwrightBrowserLauncher/frameDelegate.js +2 -0
- package/browserLauncher/playwrightBrowserLauncher/internals.js +2 -0
- package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractBrowserDelegate.js +15 -0
- package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractElementHandleDelegate.js +73 -0
- package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractFrameDelegate.js +13 -0
- package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractPageDelegate.js +81 -0
- package/browserLauncher/playwrightBrowserLauncher/pageDelegate.js +2 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightApiResponse.js +18 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +259 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +97 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +319 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +265 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpRequest.js +76 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpResponse.js +26 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +377 -0
- package/browserLauncher/playwrightBrowserLauncher/simplePlaywrightLogger.js +36 -0
- package/browserLauncher/playwrightBrowserLauncher/webkit/webkitBrowserDelegate.js +50 -0
- package/browserLauncher/playwrightBrowserLauncher/webkit/webkitElementHandleDelegate.js +16 -0
- package/browserLauncher/playwrightBrowserLauncher/webkit/webkitFrameDelegate.js +19 -0
- package/browserLauncher/playwrightBrowserLauncher/webkit/webkitPageDelegate.js +15 -0
- package/browserLauncher/playwrightBrowserLauncher/wrappers.js +25 -0
- package/browserLauncher/types.js +28 -0
- package/browserLauncher/utils.js +9 -0
- package/cli.js +66 -0
- package/commands/applications/applications.js +5 -0
- package/commands/applications/applications_cmds/describe.js +21 -0
- package/commands/applications/applications_cmds/list.js +56 -0
- package/commands/auth/auth.js +5 -0
- package/commands/auth/auth_cmds/activate-key.js +38 -0
- package/commands/auth/auth_cmds/clear.js +10 -0
- package/commands/auth/auth_cmds/info.js +10 -0
- package/commands/auth/auth_cmds/login.js +10 -0
- package/commands/branches/branches.js +5 -0
- package/commands/branches/branches_cmds/create.js +56 -0
- package/commands/branches/branches_cmds/describe.js +50 -0
- package/commands/branches/branches_cmds/list.js +84 -0
- package/commands/branches/branches_cmds/merge.js +56 -0
- package/commands/browserTypes.js +20 -0
- package/commands/commandUtil/awaitCompletion.js +67 -0
- package/commands/commandUtil/branches.js +44 -0
- package/commands/commandUtil/codeInsights.js +181 -0
- package/commands/commandUtil/describe.js +32 -0
- package/commands/commandUtil/fileUtil.js +50 -0
- package/commands/commandUtil/interfaces.js +4 -0
- package/commands/commandUtil/list.js +70 -0
- package/commands/commandUtil/util.js +127 -0
- package/commands/commandUtil/versionUtil.js +33 -0
- package/commands/config/config.js +5 -0
- package/commands/config/config_cmds/configKeys.js +28 -0
- package/commands/config/config_cmds/delete.js +29 -0
- package/commands/config/config_cmds/get.js +52 -0
- package/commands/config/config_cmds/install.js +119 -0
- package/commands/config/config_cmds/list.js +39 -0
- package/commands/config/config_cmds/set.js +80 -0
- package/commands/constants.js +160 -0
- package/commands/credentials/credentials.js +5 -0
- package/commands/credentials/credentials_cmds/list.js +66 -0
- package/commands/datatables/datatables.js +5 -0
- package/commands/datatables/datatables_cmds/create.js +61 -0
- package/commands/datatables/datatables_cmds/describe.js +17 -0
- package/commands/datatables/datatables_cmds/export.js +86 -0
- package/commands/datatables/datatables_cmds/list.js +18 -0
- package/commands/datatables/datatables_cmds/scenarios.js +35 -0
- package/commands/datatables/datatables_cmds/update.js +120 -0
- package/commands/datatables/utils.js +145 -0
- package/commands/deploy/deploy.js +5 -0
- package/commands/deploy/deploy_cmds/awaitDeploymentCompletion.js +100 -0
- package/commands/deploy/deploy_cmds/create.js +342 -0
- package/commands/deploy/deploy_cmds/describe.js +54 -0
- package/commands/deploy/deploy_cmds/executionResultPresenter.js +117 -0
- package/commands/deploy/deploy_cmds/list.js +74 -0
- package/commands/deploy/deploy_cmds/watch.js +44 -0
- package/commands/environments/environments.js +5 -0
- package/commands/environments/environments_cmds/build-files.js +5 -0
- package/commands/environments/environments_cmds/build-files_cmds/add.js +73 -0
- package/commands/environments/environments_cmds/build-files_cmds/list.js +54 -0
- package/commands/environments/environments_cmds/build-files_cmds/update.js +71 -0
- package/commands/environments/environments_cmds/create.js +153 -0
- package/commands/environments/environments_cmds/delete.js +32 -0
- package/commands/environments/environments_cmds/describe.js +28 -0
- package/commands/environments/environments_cmds/list.js +56 -0
- package/commands/environments/environments_cmds/update.js +46 -0
- package/commands/environments/environments_cmds/urls.js +5 -0
- package/commands/environments/environments_cmds/urls_cmds/add.js +91 -0
- package/commands/environments/environments_cmds/urls_cmds/list.js +49 -0
- package/commands/flows/flows.js +5 -0
- package/commands/flows/flows_cmds/export.js +78 -0
- package/commands/flows/flows_cmds/list.js +64 -0
- package/commands/internal/internal.js +6 -0
- package/commands/link-agents/link-agents.js +5 -0
- package/commands/link-agents/link-agents_cmds/delete.js +38 -0
- package/commands/link-agents/link-agents_cmds/list.js +131 -0
- package/commands/link-agents/link-agents_cmds/terminate.js +31 -0
- package/commands/mobile-build-files/mobile-build-files.js +5 -0
- package/commands/mobile-build-files/mobile-build-files_cmds/delete.js +31 -0
- package/commands/mobile-build-files/mobile-build-files_cmds/download.js +50 -0
- package/commands/mobile-build-files/mobile-build-files_cmds/list.js +72 -0
- package/commands/mobile-build-files/mobile-build-files_cmds/upload.js +101 -0
- package/commands/plans/plans.js +5 -0
- package/commands/plans/plans_cmds/describe.js +23 -0
- package/commands/plans/plans_cmds/list.js +63 -0
- package/commands/test-runs/test-runs.js +5 -0
- package/commands/test-runs/test-runs_cmds/export.js +62 -0
- package/commands/tests/mobileEmulationUtil.js +46 -0
- package/commands/tests/tests.js +5 -0
- package/commands/tests/testsUtil.js +538 -0
- package/commands/tests/tests_cmds/create.js +130 -0
- package/commands/tests/tests_cmds/edit.js +111 -0
- package/commands/tests/tests_cmds/export.js +145 -0
- package/commands/tests/tests_cmds/import.js +5 -0
- package/commands/tests/tests_cmds/import_cmds/import_playwright.js +439 -0
- package/commands/tests/tests_cmds/import_cmds/import_selenium.js +295 -0
- package/commands/tests/tests_cmds/list.js +94 -0
- package/commands/tests/tests_cmds/run-cloud.js +314 -0
- package/commands/tests/tests_cmds/run-mobile.js +260 -0
- package/commands/tests/tests_cmds/run.js +314 -0
- package/commands/tests/tests_cmds/runUtils.js +60 -0
- package/commands/tests/tests_cmds/trainerUtil.js +12 -0
- package/commands/users/users.js +5 -0
- package/commands/users/users_cmds/list.js +58 -0
- package/commands/workspaces/workspace_cmds/copy.js +108 -0
- package/commands/workspaces/workspace_cmds/describe.js +21 -0
- package/commands/workspaces/workspace_cmds/list.js +67 -0
- package/commands/workspaces/workspaces.js +5 -0
- package/core/entityValidation/environmentsValidation.js +7 -0
- package/core/entityValidation/stepValidation.js +15 -0
- package/core/execution/ApiTestUtils.js +1060 -0
- package/core/execution/MailboxConstants.js +4 -0
- package/core/execution/PostmanUtils.js +53 -0
- package/core/execution/RunConfig.js +2 -0
- package/core/execution/TestResult.js +15 -0
- package/core/execution/VariableUtils.js +154 -0
- package/core/execution/VariablesSummary.js +2 -0
- package/core/execution/basic-types.js +2 -0
- package/core/execution/newman-types.js +42 -0
- package/core/messaging/actions/MobileTrainingActions.js +17 -0
- package/core/messaging/actions/pdfActions.js +27 -0
- package/core/messaging/actions/runnerActions.js +18 -0
- package/core/messaging/actions/trainingSessionActions.js +38 -0
- package/core/messaging/logLineMessaging.js +50 -0
- package/core/messaging/messaging.js +130 -0
- package/core/messaging/pageMessaging.js +9 -0
- package/core/trainer/openUtils.js +47 -0
- package/core/trainer/trainingSessions-types.js +35 -0
- package/core/trainer/trainingSessions.js +151 -0
- package/core/util.js +52 -0
- package/coreWebVitals/index.js +77 -0
- package/domUtil/index.js +1 -0
- package/env/defaultEnv.js +17 -0
- package/env/dev.js +17 -0
- package/env/env.js +76 -0
- package/env/local.js +17 -0
- package/env/prod.js +17 -0
- package/execution/index.js +8 -0
- package/execution/index.js.LICENSE.txt +254 -0
- package/execution/runAppiumServer.js +145 -0
- package/functions/apiTest/utils.js +47 -0
- package/functions/types.js +2 -0
- package/functions/utils.js +12 -0
- package/http/MablHttpAgent.js +73 -0
- package/http/RequestFilteringHttpAgent.js +119 -0
- package/http/RequestSecurityError.js +13 -0
- package/http/axiosProxyConfig.js +101 -0
- package/http/httpUtil.js +73 -0
- package/http/requestInterceptor.js +206 -0
- package/index.d.ts +241 -0
- package/index.js +14 -0
- package/mablApi/index.js +1 -0
- package/mablscript/MablAction.js +102 -0
- package/mablscript/MablStep.js +191 -0
- package/mablscript/MablStepV2.js +73 -0
- package/mablscript/MablSymbol.js +35 -0
- package/mablscript/actions/AwaitDownloadAction.js +14 -0
- package/mablscript/actions/AwaitPDFDownloadAction.js +19 -0
- package/mablscript/actions/ConditionAction.js +123 -0
- package/mablscript/actions/CountAction.js +16 -0
- package/mablscript/actions/ExtractAction.js +71 -0
- package/mablscript/actions/FindAction.js +301 -0
- package/mablscript/actions/GenerateEmailAddressAction.js +14 -0
- package/mablscript/actions/GenerateRandomStringAction.js +20 -0
- package/mablscript/actions/GetUrlAction.js +22 -0
- package/mablscript/actions/GetVariableValue.js +31 -0
- package/mablscript/actions/GetViewportAction.js +17 -0
- package/mablscript/actions/JavaScriptAction.js +219 -0
- package/mablscript/diffing/diffingUtil.js +229 -0
- package/mablscript/importer.js +576 -0
- package/mablscript/mobile/steps/CreateVariableMobileStep.js +53 -0
- package/mablscript/mobile/steps/EnterTextStep.js +45 -0
- package/mablscript/mobile/steps/HideKeyboardStep.js +20 -0
- package/mablscript/mobile/steps/InstallAppStep.js +22 -0
- package/mablscript/mobile/steps/NavigateBackStep.js +20 -0
- package/mablscript/mobile/steps/NavigateHomeStep.js +21 -0
- package/mablscript/mobile/steps/OpenAppStep.js +22 -0
- package/mablscript/mobile/steps/OpenLinkStep.js +19 -0
- package/mablscript/mobile/steps/PrepareSessionStep.js +19 -0
- package/mablscript/mobile/steps/PushFileStep.js +27 -0
- package/mablscript/mobile/steps/ScrollStep.js +87 -0
- package/mablscript/mobile/steps/SetOrientationStep.js +20 -0
- package/mablscript/mobile/steps/TapStep.js +37 -0
- package/mablscript/mobile/steps/UninstallAppStep.js +22 -0
- package/mablscript/mobile/steps/actions/MobileFindAction.js +23 -0
- package/mablscript/mobile/steps/stepUtil.js +113 -0
- package/mablscript/mobile/tests/StepTestsUtil.js +20 -0
- package/mablscript/mobile/tests/TestMobileFindDescriptors.js +282 -0
- package/mablscript/mobile/tests/steps/CreateVariableMobileStep.mobiletest.js +298 -0
- package/mablscript/mobile/tests/steps/EnterTextStep.mobiletest.js +79 -0
- package/mablscript/mobile/tests/steps/GeneralHumanization.mobiletest.js +304 -0
- package/mablscript/mobile/tests/steps/HideKeyboardStep.mobiletest.js +27 -0
- package/mablscript/mobile/tests/steps/InstallAppStep.mobiletest.js +20 -0
- package/mablscript/mobile/tests/steps/NavigateBackStep.mobiletest.js +27 -0
- package/mablscript/mobile/tests/steps/NavigateHomeStep.mobiletest.js +27 -0
- package/mablscript/mobile/tests/steps/OpenLinkStep.mobiletest.js +20 -0
- package/mablscript/mobile/tests/steps/PushFileStep.mobiletest.js +55 -0
- package/mablscript/mobile/tests/steps/ScrollStep.mobiletest.js +386 -0
- package/mablscript/mobile/tests/steps/SetOrientationStep.mobiletest.js +32 -0
- package/mablscript/mobile/tests/steps/TapStep.mobiletest.js +57 -0
- package/mablscript/mobile/tests/steps/UninstallAppStep.mobiletest.js +20 -0
- package/mablscript/steps/AbstractAssertionsAndVariablesStep.js +52 -0
- package/mablscript/steps/AccessibilityCheck.js +108 -0
- package/mablscript/steps/ActionsUtils.js +18 -0
- package/mablscript/steps/AssertStep.js +318 -0
- package/mablscript/steps/AssertStepOld.js +159 -0
- package/mablscript/steps/AwaitTabStep.js +69 -0
- package/mablscript/steps/AwaitUploadsStep.js +26 -0
- package/mablscript/steps/ClearCookiesStep.js +26 -0
- package/mablscript/steps/ClickAndHoldStep.js +76 -0
- package/mablscript/steps/ClickStep.js +58 -0
- package/mablscript/steps/CookieUtils.js +54 -0
- package/mablscript/steps/CreateVariableStep.js +236 -0
- package/mablscript/steps/DatabaseQueryStep.js +28 -0
- package/mablscript/steps/DoubleClickStep.js +64 -0
- package/mablscript/steps/DownloadStep.js +96 -0
- package/mablscript/steps/EchoStep.js +34 -0
- package/mablscript/steps/ElseIfConditionStep.js +32 -0
- package/mablscript/steps/ElseStep.js +27 -0
- package/mablscript/steps/EndStep.js +27 -0
- package/mablscript/steps/EnterAuthCodeStep.js +59 -0
- package/mablscript/steps/EnterTextStep.js +96 -0
- package/mablscript/steps/EvaluateFlowStep.js +51 -0
- package/mablscript/steps/EvaluateJavaScriptStep.js +50 -0
- package/mablscript/steps/HoverStep.js +63 -0
- package/mablscript/steps/IfConditionStep.js +191 -0
- package/mablscript/steps/NavigateStep.js +30 -0
- package/mablscript/steps/OpenEmailStep.js +46 -0
- package/mablscript/steps/ReleaseStep.js +76 -0
- package/mablscript/steps/RemoveCookieStep.js +36 -0
- package/mablscript/steps/RightClickStep.js +58 -0
- package/mablscript/steps/SelectStep.js +82 -0
- package/mablscript/steps/SendHttpRequestStep.js +48 -0
- package/mablscript/steps/SendKeyStep.js +84 -0
- package/mablscript/steps/SetCookieStep.js +70 -0
- package/mablscript/steps/SetFilesStep.js +71 -0
- package/mablscript/steps/SetViewportStep.js +38 -0
- package/mablscript/steps/SwitchContextStep.js +122 -0
- package/mablscript/steps/SyntheticStep.js +20 -0
- package/mablscript/steps/VisitUrlStep.js +68 -0
- package/mablscript/steps/WaitStep.js +37 -0
- package/mablscript/steps/WaitUntilStep.js +46 -0
- package/mablscript/types/AccessibilityCheckStepDescriptor.js +2 -0
- package/mablscript/types/AccessibilityCheckTypes.js +9 -0
- package/mablscript/types/AssertionsAndVariablesStepDescriptor.js +2 -0
- package/mablscript/types/AwaitTabDescriptor.js +2 -0
- package/mablscript/types/AwaitUploadStepDescriptor.js +2 -0
- package/mablscript/types/ClearCookiesStepDescriptor.js +2 -0
- package/mablscript/types/ClickAndHoldStepDescriptor.js +2 -0
- package/mablscript/types/ClickStepDescriptor.js +2 -0
- package/mablscript/types/ConditionDescriptor.js +133 -0
- package/mablscript/types/CountDescriptor.js +2 -0
- package/mablscript/types/CreateVariableStepDescriptor.js +12 -0
- package/mablscript/types/DownloadStepDescriptor.js +2 -0
- package/mablscript/types/EchoStepDescriptor.js +2 -0
- package/mablscript/types/EnterTextStepDescriptor.js +2 -0
- package/mablscript/types/EvaluateFlowStepDescriptor.js +2 -0
- package/mablscript/types/EvaluateJavaScriptStepDescriptor.js +2 -0
- package/mablscript/types/ExtractDescriptor.js +21 -0
- package/mablscript/types/GetCurrentLocationDescriptor.js +12 -0
- package/mablscript/types/GetVariableDescriptor.js +16 -0
- package/mablscript/types/GetViewportDescriptor.js +12 -0
- package/mablscript/types/HoverStepDescriptor.js +2 -0
- package/mablscript/types/NavigateStepDescriptor.js +7 -0
- package/mablscript/types/OpenEmailStepDescriptor.js +2 -0
- package/mablscript/types/OperatingSystemDescriptor.js +45 -0
- package/mablscript/types/ReleaseStepDescriptor.js +7 -0
- package/mablscript/types/RemoveCookieStepDescriptor.js +2 -0
- package/mablscript/types/SelectStepDescriptor.js +2 -0
- package/mablscript/types/SendHttpRequestTypes.js +2 -0
- package/mablscript/types/SendKeyStepDescriptor.js +30 -0
- package/mablscript/types/SetCookieStepDescriptor.js +2 -0
- package/mablscript/types/SetFilesStepDescriptor.js +2 -0
- package/mablscript/types/SetViewportStepDescriptor.js +2 -0
- package/mablscript/types/SnippetsDescriptor.js +36 -0
- package/mablscript/types/StepDescriptor.js +2 -0
- package/mablscript/types/SwitchContextStepDescriptor.js +15 -0
- package/mablscript/types/VariableNamespace.js +17 -0
- package/mablscript/types/VisitUrlStepDescriptor.js +2 -0
- package/mablscript/types/WaitStepDescriptor.js +2 -0
- package/mablscript/types/WaitUntilStepDescriptor.js +2 -0
- package/mablscript/types/mobile/CreateVariableMobileStepDescriptor.js +9 -0
- package/mablscript/types/mobile/EnterTextStepDescriptor.js +2 -0
- package/mablscript/types/mobile/HideKeyboardStepDescriptor.js +2 -0
- package/mablscript/types/mobile/InstallAppStepDescriptor.js +2 -0
- package/mablscript/types/mobile/NavigateBackStepDescriptor.js +2 -0
- package/mablscript/types/mobile/NavigateHomeStepDescriptor.js +2 -0
- package/mablscript/types/mobile/OpenAppStepDescriptor.js +2 -0
- package/mablscript/types/mobile/OpenLinkStepDescriptor.js +2 -0
- package/mablscript/types/mobile/PrepareSessionStepDescriptor.js +2 -0
- package/mablscript/types/mobile/PushFileDescriptor.js +2 -0
- package/mablscript/types/mobile/ScrollStepDescriptor.js +32 -0
- package/mablscript/types/mobile/SetOrientationStepDescriptor.js +8 -0
- package/mablscript/types/mobile/StepWithMobileFindDescriptor.js +8 -0
- package/mablscript/types/mobile/TapStepDescriptor.js +8 -0
- package/mablscript/types/mobile/UninstallAppStepDescriptor.js +2 -0
- package/mablscriptFind/index.js +2 -0
- package/mablscriptFind/index.js.LICENSE.txt +25 -0
- package/middleware.js +42 -0
- package/mobile/index.js +2 -0
- package/mobile/types.js +8 -0
- package/observers/ObserverBase.js +11 -0
- package/observers/mockObserver.js +47 -0
- package/package.json +107 -0
- package/popupDismissal/candidate.js +2 -0
- package/popupDismissal/index.js +255 -0
- package/providers/authenticationProvider.js +254 -0
- package/providers/cliConfigProvider.js +271 -0
- package/providers/exportRequestProvider.js +196 -0
- package/providers/logging/loggingProvider.js +90 -0
- package/providers/scmContextInterfaces.js +14 -0
- package/providers/scmContextProvider.js +335 -0
- package/providers/scmContextProviderV2.js +122 -0
- package/providers/types.js +9 -0
- package/proxy/index.js +2 -0
- package/proxy/index.js.LICENSE.txt +12 -0
- package/proxy/lib/xpath.js +1 -0
- package/reporters/__tests__/resources/sampleData.js +162 -0
- package/reporters/mochAwesome/interfaces.js +2 -0
- package/reporters/mochAwesome/mochAwesomeReporter.js +227 -0
- package/reporters/reporter.js +46 -0
- package/resources/actionabilityCheck.js +160 -0
- package/resources/coreWebVitals.js +1 -0
- package/resources/mablFind.js +2 -0
- package/resources/media/mabl_test_audio.wav +0 -0
- package/resources/media/mabl_test_pattern.y4m +3 -0
- package/resources/pdf-viewer/EmbeddedPdfHandler.js +1 -0
- package/resources/pdf-viewer/embeddedPdfDetection.js +225 -0
- package/resources/pdf-viewer/index.html +1 -0
- package/resources/pdf-viewer/index.js +2 -0
- package/resources/pdf-viewer/libEmbeddedPdfHandler.js +279 -0
- package/resources/pdf-viewer/libmablPdfViewer.js +21909 -0
- package/resources/pdf-viewer/mabl_attention_move.gif +0 -0
- package/resources/pdf-viewer/mabl_error_artwork_Unplugged.gif +0 -0
- package/resources/pdf-viewer/pdf.worker.9251738a897f697389be.js +2 -0
- package/resources/pdf-viewer/pdf.worker.9e2021092643447a5b9f.js +81 -0
- package/resources/popupDismissal.js +1 -0
- package/resources/webdriver.js +19 -0
- package/socketTunnel/index.js +2 -0
- package/socketTunnel/index.js.LICENSE.txt +68 -0
- package/upload/index.js +2 -0
- package/upload/index.js.LICENSE.txt +27 -0
- package/util/CloudStorageWriter.js +45 -0
- package/util/FileCache.js +180 -0
- package/util/IdentifierUtil.js +57 -0
- package/util/InternalMetricsTrackingSingleton.js +36 -0
- package/util/Lazy.js +90 -0
- package/util/MobileAppFileCache.js +103 -0
- package/util/RichPromise.js +53 -0
- package/util/TestOutputWriter.js +104 -0
- package/util/actionabilityUtil.js +165 -0
- package/util/analytics-events.js +14 -0
- package/util/analytics.js +176 -0
- package/util/asyncUtil.js +61 -0
- package/util/browserTestUtils.js +17 -0
- package/util/clickUtil.js +68 -0
- package/util/downloadUtil.js +87 -0
- package/util/encodingUtil.js +50 -0
- package/util/fileUploadUtil.js +146 -0
- package/util/javaScriptStepMigration.js +115 -0
- package/util/jestUtil.js +21 -0
- package/util/logUtils.js +131 -0
- package/util/markdownUtil.js +125 -0
- package/util/postInstallMessage.js +14 -0
- package/util/pureUtil.js +175 -0
- package/util/resourceUtil.js +90 -0
- package/util/timeUtil.js +31 -0
- package/utilities.js +7 -0
- package/webdriver/index.js +44 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssertStep = exports.assertStepYamlMablscriptNames = exports.OnFailure = void 0;
|
|
4
|
+
const ConditionAction_1 = require("../actions/ConditionAction");
|
|
5
|
+
const FindAction_1 = require("../actions/FindAction");
|
|
6
|
+
const MablStep_1 = require("../MablStep");
|
|
7
|
+
const MablAction_1 = require("../MablAction");
|
|
8
|
+
const ExtractAction_1 = require("../actions/ExtractAction");
|
|
9
|
+
const domUtil_1 = require("../../domUtil");
|
|
10
|
+
const ConditionDescriptor_1 = require("../types/ConditionDescriptor");
|
|
11
|
+
const GetUrlAction_1 = require("../actions/GetUrlAction");
|
|
12
|
+
const GetCurrentLocationDescriptor_1 = require("../types/GetCurrentLocationDescriptor");
|
|
13
|
+
const GetVariableValue_1 = require("../actions/GetVariableValue");
|
|
14
|
+
const GetVariableDescriptor_1 = require("../types/GetVariableDescriptor");
|
|
15
|
+
const CountAction_1 = require("../actions/CountAction");
|
|
16
|
+
const MobileFindAction_1 = require("../mobile/steps/actions/MobileFindAction");
|
|
17
|
+
const GetViewportDescriptor_1 = require("../types/GetViewportDescriptor");
|
|
18
|
+
const GetViewportAction_1 = require("../actions/GetViewportAction");
|
|
19
|
+
var OnFailure;
|
|
20
|
+
(function (OnFailure) {
|
|
21
|
+
OnFailure["ContinueWithWarning"] = "continue";
|
|
22
|
+
OnFailure["FailImmediately"] = "terminate";
|
|
23
|
+
OnFailure["FailTestAtEnd"] = "failAtEnd";
|
|
24
|
+
})(OnFailure || (exports.OnFailure = OnFailure = {}));
|
|
25
|
+
const assertStepYamlMablscriptNames = () => {
|
|
26
|
+
const assertionNames = Object.keys(ConditionDescriptor_1.AssertionStepNameToField);
|
|
27
|
+
assertionNames.push('WaitUntil');
|
|
28
|
+
return assertionNames;
|
|
29
|
+
};
|
|
30
|
+
exports.assertStepYamlMablscriptNames = assertStepYamlMablscriptNames;
|
|
31
|
+
class AssertStep extends MablStep_1.MablStep {
|
|
32
|
+
constructor(name, args, actions) {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
super(name, args, actions, 'assert');
|
|
35
|
+
const firstAction = actions[0];
|
|
36
|
+
if (firstAction instanceof FindAction_1.FindAction ||
|
|
37
|
+
firstAction instanceof MobileFindAction_1.MobileFindAction ||
|
|
38
|
+
firstAction instanceof GetUrlAction_1.GetUrlAction ||
|
|
39
|
+
firstAction instanceof GetVariableValue_1.GetVariableValue ||
|
|
40
|
+
firstAction instanceof GetViewportAction_1.GetViewportAction) {
|
|
41
|
+
this.primaryAction = firstAction;
|
|
42
|
+
}
|
|
43
|
+
else if (firstAction instanceof ConditionAction_1.ConditionAction &&
|
|
44
|
+
(0, ConditionDescriptor_1.isAIPromptCondition)(firstAction.conditionDescriptor)) {
|
|
45
|
+
this.primaryAction = new GetViewportAction_1.GetViewportAction();
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
throw new Error(`Unexpected action type. Expected FindAction|MobileFindAction|GetUrlAction|GetVariableValue but got: ${firstAction.constructor.name}`);
|
|
49
|
+
}
|
|
50
|
+
if (actions.length === 3) {
|
|
51
|
+
if (actions[1] instanceof CountAction_1.CountAction) {
|
|
52
|
+
this.countAction = actions[1];
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
this.extractAction = actions[1];
|
|
56
|
+
}
|
|
57
|
+
this.conditionAction = actions[2];
|
|
58
|
+
}
|
|
59
|
+
else if (firstAction instanceof ConditionAction_1.ConditionAction) {
|
|
60
|
+
this.conditionAction = firstAction;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
this.conditionAction = actions[1];
|
|
64
|
+
}
|
|
65
|
+
this.aiPrompt = (0, ConditionDescriptor_1.isAIPromptCondition)(this.conditionAction.conditionDescriptor)
|
|
66
|
+
? {
|
|
67
|
+
userPrompt: this.conditionAction.conditionDescriptor.userPrompt,
|
|
68
|
+
metaPrompt: this.conditionAction.conditionDescriptor.metaPrompt,
|
|
69
|
+
criteria: this.conditionAction.conditionDescriptor.criteria,
|
|
70
|
+
}
|
|
71
|
+
: undefined;
|
|
72
|
+
this.assertionType = (0, ConditionDescriptor_1.getAssertionConditionFieldFromDescriptor)(this.conditionAction.conditionDescriptor);
|
|
73
|
+
this.assertionValue = (0, ConditionDescriptor_1.getOptionalComparatorValue)(this.conditionAction.conditionDescriptor);
|
|
74
|
+
this.isWaitUntilStep = this.determineIfWaitUntilStep();
|
|
75
|
+
this.assertArguments =
|
|
76
|
+
args[0] && typeof args[0] === 'object'
|
|
77
|
+
? args[0]
|
|
78
|
+
: undefined;
|
|
79
|
+
this.onFailure =
|
|
80
|
+
((_a = this.assertArguments) === null || _a === void 0 ? void 0 : _a.onFailure) ||
|
|
81
|
+
OnFailure.FailImmediately;
|
|
82
|
+
this.observationScope = (_b = this.assertArguments) === null || _b === void 0 ? void 0 : _b.observationScope;
|
|
83
|
+
}
|
|
84
|
+
canContinueOnFailure() {
|
|
85
|
+
return this.onFailure !== OnFailure.FailImmediately;
|
|
86
|
+
}
|
|
87
|
+
canFailAtEnd() {
|
|
88
|
+
return this.onFailure === OnFailure.FailTestAtEnd;
|
|
89
|
+
}
|
|
90
|
+
validate() {
|
|
91
|
+
if (!(this.actions.length === 2 || this.actions.length === 3) &&
|
|
92
|
+
!(this.actions[0] instanceof FindAction_1.FindAction) &&
|
|
93
|
+
!(this.actions[this.actions.length - 1] instanceof ConditionAction_1.ConditionAction)) {
|
|
94
|
+
throw new Error('Invalid assertion step');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
determineIfWaitUntilStep() {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
const find = this.primaryAction.toDescriptor();
|
|
100
|
+
if (ConditionDescriptor_1.AssertionConditionFieldToStepName[this.assertionType] ===
|
|
101
|
+
'AssertPresent' &&
|
|
102
|
+
(0, domUtil_1.isFindElementDescriptor)(find)) {
|
|
103
|
+
if ((_b = (_a = find.findOptions) === null || _a === void 0 ? void 0 : _a.waitUntil) === null || _b === void 0 ? void 0 : _b.timeoutSeconds) {
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
getStepName() {
|
|
110
|
+
if (this.isWaitUntilStep) {
|
|
111
|
+
return 'WaitUntil';
|
|
112
|
+
}
|
|
113
|
+
return ConditionDescriptor_1.AssertionConditionFieldToStepName[this.assertionType];
|
|
114
|
+
}
|
|
115
|
+
toStepDescriptor() {
|
|
116
|
+
var _a, _b;
|
|
117
|
+
const find = this.primaryAction.toDescriptor();
|
|
118
|
+
const descriptorToActionMap = new Map()
|
|
119
|
+
.set(find, this.primaryAction)
|
|
120
|
+
.set(this.conditionAction.conditionDescriptor, this.conditionAction);
|
|
121
|
+
if (this.extractAction) {
|
|
122
|
+
descriptorToActionMap.set(this.extractAction.extractDescriptor, this.extractAction);
|
|
123
|
+
}
|
|
124
|
+
if (this.countAction) {
|
|
125
|
+
descriptorToActionMap.set(this.countAction.countDescriptor, this.countAction);
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
find,
|
|
129
|
+
extractDescriptor: (_a = this.extractAction) === null || _a === void 0 ? void 0 : _a.extractDescriptor,
|
|
130
|
+
conditionDescriptor: this.conditionAction.conditionDescriptor,
|
|
131
|
+
countDescriptor: (_b = this.countAction) === null || _b === void 0 ? void 0 : _b.countDescriptor,
|
|
132
|
+
onFailure: this.onFailure,
|
|
133
|
+
observationScope: this.observationScope,
|
|
134
|
+
descriptorToActionMap,
|
|
135
|
+
actionCode: this.actionCode,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
getFormattedStep(_fullLocatorsOn) {
|
|
139
|
+
var _a, _b;
|
|
140
|
+
const result = {};
|
|
141
|
+
result[this.getStepName()] = { ...this.annotationsAsYml() };
|
|
142
|
+
const formatted = result[this.getStepName()];
|
|
143
|
+
if (this.extractAction) {
|
|
144
|
+
formatted.attribute = this.extractAction.extractionAttribute;
|
|
145
|
+
formatted.extractType =
|
|
146
|
+
ExtractAction_1.ExtractAction.mablscriptToYamlType[this.extractAction.extractionType];
|
|
147
|
+
}
|
|
148
|
+
if (this.countAction) {
|
|
149
|
+
formatted.attribute = 'count';
|
|
150
|
+
}
|
|
151
|
+
if (this.assertionValue !== undefined) {
|
|
152
|
+
formatted.assertionValue = this.assertionValue;
|
|
153
|
+
}
|
|
154
|
+
if (this.aiPrompt !== undefined) {
|
|
155
|
+
formatted.aiPrompt = this.aiPrompt;
|
|
156
|
+
}
|
|
157
|
+
const targetDescriptor = this.primaryAction.toDescriptor();
|
|
158
|
+
if ((0, GetVariableDescriptor_1.isGetVariableDescriptor)(targetDescriptor)) {
|
|
159
|
+
formatted.target = (0, GetVariableDescriptor_1.convertGetVariableDescriptorToYaml)(targetDescriptor);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
formatted.target = targetDescriptor;
|
|
163
|
+
}
|
|
164
|
+
if (this.conditionAction.hasOptionsAtInstantiation) {
|
|
165
|
+
formatted.conditionOptions = (0, ConditionDescriptor_1.getOptionalConditionOptions)(this.conditionAction.conditionDescriptor);
|
|
166
|
+
}
|
|
167
|
+
if (!!((_a = this.assertArguments) === null || _a === void 0 ? void 0 : _a.observationScope) ||
|
|
168
|
+
!!((_b = this.assertArguments) === null || _b === void 0 ? void 0 : _b.onFailure)) {
|
|
169
|
+
formatted.assertArguments = this.assertArguments;
|
|
170
|
+
}
|
|
171
|
+
result[this.getStepName()] =
|
|
172
|
+
MablStep_1.MablStep.cloneAndRemoveUndefinedEntriesFromObject(formatted);
|
|
173
|
+
if (this.stepId()) {
|
|
174
|
+
result[this.getStepName()].id = this.stepId();
|
|
175
|
+
}
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
178
|
+
static fromYaml(stepName, stepArgs) {
|
|
179
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
180
|
+
const actions = [];
|
|
181
|
+
const assertionType = ConditionDescriptor_1.AssertionStepNameToField[stepName];
|
|
182
|
+
const assertionValue = stepArgs.assertionValue;
|
|
183
|
+
const conditionOptions = stepArgs.conditionOptions;
|
|
184
|
+
let primaryAction;
|
|
185
|
+
if (((_a = stepArgs.target) === null || _a === void 0 ? void 0 : _a.kind) === GetCurrentLocationDescriptor_1.GET_CURRENT_LOCATION_KIND) {
|
|
186
|
+
primaryAction = new GetUrlAction_1.GetUrlAction(GetUrlAction_1.GetUrlAction.mablScriptStepNames[0], []);
|
|
187
|
+
}
|
|
188
|
+
else if (((_b = stepArgs.target) === null || _b === void 0 ? void 0 : _b.kind) === GetVariableDescriptor_1.GET_VARIABLE_VALUE) {
|
|
189
|
+
primaryAction = new GetVariableValue_1.GetVariableValue(GetVariableValue_1.GetVariableValue.mablScriptStepNames[0], [(_c = stepArgs.target) === null || _c === void 0 ? void 0 : _c.variable]);
|
|
190
|
+
}
|
|
191
|
+
else if ((0, GetViewportDescriptor_1.isGetViewportDescriptor)(stepArgs.target)) {
|
|
192
|
+
primaryAction = new GetViewportAction_1.GetViewportAction();
|
|
193
|
+
}
|
|
194
|
+
else if ((0, domUtil_1.isNormalizedFindEmailDescriptor)((_d = stepArgs.target) === null || _d === void 0 ? void 0 : _d.findTarget) ||
|
|
195
|
+
(0, domUtil_1.isCookieSelector)((_e = stepArgs.target) === null || _e === void 0 ? void 0 : _e.findTarget) ||
|
|
196
|
+
(0, domUtil_1.isTabSelector)((_f = stepArgs.target) === null || _f === void 0 ? void 0 : _f.findTarget)) {
|
|
197
|
+
const { findTarget, findType } = stepArgs.target;
|
|
198
|
+
primaryAction = new FindAction_1.FindAction(findType, [findTarget]);
|
|
199
|
+
}
|
|
200
|
+
else if ((0, domUtil_1.isMobileFindDescriptor)(stepArgs.target)) {
|
|
201
|
+
primaryAction = MobileFindAction_1.MobileFindAction.fromDescriptor(stepArgs.target);
|
|
202
|
+
}
|
|
203
|
+
else if ((0, domUtil_1.isFindElementDescriptor)(stepArgs.target)) {
|
|
204
|
+
const { findOptions, findTarget, findType } = stepArgs.target;
|
|
205
|
+
if (findType === domUtil_1.FindType.FIND_ONE) {
|
|
206
|
+
primaryAction = new FindAction_1.FindAction(findType, [findTarget, findOptions]);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
primaryAction = new FindAction_1.FindAction(findType, [findTarget, findOptions]);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
throw new Error(`Error parsing [${stepName}] with incompatible step arguments`);
|
|
214
|
+
}
|
|
215
|
+
actions.push(primaryAction);
|
|
216
|
+
if (assertionType === 'ai_prompt') {
|
|
217
|
+
actions.push(new ConditionAction_1.ConditionAction('evaluate_ai_prompt', [
|
|
218
|
+
(_h = (_g = stepArgs.aiPrompt) === null || _g === void 0 ? void 0 : _g.userPrompt) !== null && _h !== void 0 ? _h : stepArgs.userPrompt,
|
|
219
|
+
{
|
|
220
|
+
metaPrompt: (_k = (_j = stepArgs.aiPrompt) === null || _j === void 0 ? void 0 : _j.metaPrompt) !== null && _k !== void 0 ? _k : stepArgs.metaPrompt,
|
|
221
|
+
criteria: (_l = stepArgs.aiPrompt) === null || _l === void 0 ? void 0 : _l.criteria,
|
|
222
|
+
},
|
|
223
|
+
]));
|
|
224
|
+
}
|
|
225
|
+
else if (assertionType === 'present' || assertionType === 'not_present') {
|
|
226
|
+
actions.push(new ConditionAction_1.ConditionAction('evaluate_presence', [assertionType]));
|
|
227
|
+
}
|
|
228
|
+
else if (stepName === 'WaitUntil') {
|
|
229
|
+
actions.push(new ConditionAction_1.ConditionAction('evaluate_presence', ['present']));
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
if (stepArgs.attribute === 'count') {
|
|
233
|
+
actions.push(new CountAction_1.CountAction('count', [stepArgs.attribute]));
|
|
234
|
+
}
|
|
235
|
+
else if (((_m = stepArgs.target) === null || _m === void 0 ? void 0 : _m.kind) !== GetVariableDescriptor_1.GET_VARIABLE_VALUE) {
|
|
236
|
+
actions.push(new ExtractAction_1.ExtractAction(ExtractAction_1.ExtractAction.mablScriptTypeFromYamlType(stepArgs.extractType), [stepArgs.attribute]));
|
|
237
|
+
}
|
|
238
|
+
actions.push(new ConditionAction_1.ConditionAction('evaluate_condition', [
|
|
239
|
+
assertionType,
|
|
240
|
+
assertionValue,
|
|
241
|
+
conditionOptions,
|
|
242
|
+
]));
|
|
243
|
+
}
|
|
244
|
+
const assertStep = new AssertStep('assert', [stepArgs.assertArguments], actions);
|
|
245
|
+
if (stepArgs.annotation) {
|
|
246
|
+
assertStep.setAnnotation(stepArgs.annotation);
|
|
247
|
+
}
|
|
248
|
+
assertStep.setStepId(stepArgs.id);
|
|
249
|
+
return assertStep;
|
|
250
|
+
}
|
|
251
|
+
toMablscript() {
|
|
252
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
253
|
+
if (this.primaryAction instanceof MobileFindAction_1.MobileFindAction) {
|
|
254
|
+
throw new Error('Mobile steps do not generate mablscript');
|
|
255
|
+
}
|
|
256
|
+
let primaryActionMablscriptPrefix = this.primaryAction.toMablscript();
|
|
257
|
+
if (primaryActionMablscriptPrefix.length > 0) {
|
|
258
|
+
primaryActionMablscriptPrefix += '.';
|
|
259
|
+
}
|
|
260
|
+
let primaryActionFindMablscriptPrefix = this.primaryAction.generateFindMablscript();
|
|
261
|
+
if (primaryActionFindMablscriptPrefix.length > 0) {
|
|
262
|
+
primaryActionFindMablscriptPrefix += '.';
|
|
263
|
+
}
|
|
264
|
+
const assertAction = `.assert(${!!(((_a = this.assertArguments) === null || _a === void 0 ? void 0 : _a.onFailure) ||
|
|
265
|
+
((_b = this.assertArguments) === null || _b === void 0 ? void 0 : _b.observationScope))
|
|
266
|
+
? (0, MablAction_1.convertObjectToMablscriptArgs)({
|
|
267
|
+
...this.assertArguments,
|
|
268
|
+
onFailure: ((_c = this.assertArguments) === null || _c === void 0 ? void 0 : _c.onFailure) === OnFailure.FailImmediately
|
|
269
|
+
? undefined
|
|
270
|
+
: (_d = this.assertArguments) === null || _d === void 0 ? void 0 : _d.onFailure,
|
|
271
|
+
})
|
|
272
|
+
: ''})`;
|
|
273
|
+
if (this.countAction) {
|
|
274
|
+
return `${primaryActionMablscriptPrefix}${this.countAction.toMablscript()}.${this.conditionAction.toMablscript()}${assertAction}`;
|
|
275
|
+
}
|
|
276
|
+
if (this.extractAction) {
|
|
277
|
+
return `${primaryActionMablscriptPrefix}${this.extractAction.toMablscript()}.${this.conditionAction.toMablscript()}${assertAction}`;
|
|
278
|
+
}
|
|
279
|
+
if (this.assertionType === 'present' ||
|
|
280
|
+
this.assertionType === 'not_present') {
|
|
281
|
+
return `${primaryActionFindMablscriptPrefix}evaluate_presence("${this.assertionType}")${assertAction}`;
|
|
282
|
+
}
|
|
283
|
+
if (this.assertionType === 'ai_prompt') {
|
|
284
|
+
const aiOptions = {};
|
|
285
|
+
if ((_e = this.aiPrompt) === null || _e === void 0 ? void 0 : _e.metaPrompt) {
|
|
286
|
+
aiOptions.metaPrompt = this.aiPrompt.metaPrompt;
|
|
287
|
+
}
|
|
288
|
+
if (((_f = this.aiPrompt) === null || _f === void 0 ? void 0 : _f.criteria) && this.aiPrompt.criteria.length > 0) {
|
|
289
|
+
aiOptions.criteria = (_g = this.aiPrompt) === null || _g === void 0 ? void 0 : _g.criteria;
|
|
290
|
+
}
|
|
291
|
+
return `${primaryActionFindMablscriptPrefix}evaluate_ai_prompt("${(_h = this.aiPrompt) === null || _h === void 0 ? void 0 : _h.userPrompt}", ${JSON.stringify(aiOptions)})${assertAction}`;
|
|
292
|
+
}
|
|
293
|
+
return `${primaryActionMablscriptPrefix}${this.conditionAction.toMablscript()}${assertAction}`;
|
|
294
|
+
}
|
|
295
|
+
toLineDiffFormat() {
|
|
296
|
+
if (this.primaryAction instanceof MobileFindAction_1.MobileFindAction) {
|
|
297
|
+
const lineDiffProperties = {
|
|
298
|
+
annotation: this.annotation,
|
|
299
|
+
disabled: this.isDisabled(),
|
|
300
|
+
descriptor: this.toStepDescriptor(),
|
|
301
|
+
};
|
|
302
|
+
return this.stringify(lineDiffProperties);
|
|
303
|
+
}
|
|
304
|
+
return super.toLineDiffFormat();
|
|
305
|
+
}
|
|
306
|
+
getInputVariables() {
|
|
307
|
+
var _a, _b, _c, _d;
|
|
308
|
+
return (0, MablAction_1.distinctStrings)([
|
|
309
|
+
...this.primaryAction.getInputVariables(),
|
|
310
|
+
...((_b = (_a = this.countAction) === null || _a === void 0 ? void 0 : _a.getInputVariables()) !== null && _b !== void 0 ? _b : []),
|
|
311
|
+
...this.conditionAction.getInputVariables(),
|
|
312
|
+
...((_d = (_c = this.extractAction) === null || _c === void 0 ? void 0 : _c.getInputVariables()) !== null && _d !== void 0 ? _d : []),
|
|
313
|
+
]);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
exports.AssertStep = AssertStep;
|
|
317
|
+
AssertStep.mablScriptStepNames = ['assert'];
|
|
318
|
+
AssertStep.yamlMablScriptNames = (0, exports.assertStepYamlMablscriptNames)();
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssertStepOld = void 0;
|
|
4
|
+
const ExtractAction_1 = require("../actions/ExtractAction");
|
|
5
|
+
const MablStep_1 = require("../MablStep");
|
|
6
|
+
const FindAction_1 = require("../actions/FindAction");
|
|
7
|
+
const domUtil_1 = require("../../domUtil");
|
|
8
|
+
const importer_1 = require("../importer");
|
|
9
|
+
const GetCurrentLocationDescriptor_1 = require("../types/GetCurrentLocationDescriptor");
|
|
10
|
+
const GetVariableDescriptor_1 = require("../types/GetVariableDescriptor");
|
|
11
|
+
const GetViewportDescriptor_1 = require("../types/GetViewportDescriptor");
|
|
12
|
+
const oldToNewAssertionTypes = {
|
|
13
|
+
assert_contains: 'AssertContains',
|
|
14
|
+
assert_does_not_contain: 'AssertDoesNotContain',
|
|
15
|
+
assert_does_not_equal: 'AssertDoesNotEqual',
|
|
16
|
+
assert_download: 'AssertDownload',
|
|
17
|
+
assert_equals: 'AssertEquals',
|
|
18
|
+
assert_greater_than: 'AssertGreaterThan',
|
|
19
|
+
assert_greater_than_or_equals: 'AssertGreaterThanOrEquals',
|
|
20
|
+
assert_less_than: 'AssertLessThan',
|
|
21
|
+
assert_less_than_or_equals: 'AssertLessThanOrEquals',
|
|
22
|
+
assert_not_present: 'AssertNotPresent',
|
|
23
|
+
assert_present: 'AssertPresent',
|
|
24
|
+
assert_starts_with: 'AssertStartsWith',
|
|
25
|
+
assert_starts_without: 'AssertStartsWithout',
|
|
26
|
+
assert_ends_with: 'AssertEndsWith',
|
|
27
|
+
assert_ends_without: 'AssertEndsWithout',
|
|
28
|
+
};
|
|
29
|
+
class AssertStepOld extends MablStep_1.MablStep {
|
|
30
|
+
constructor(name, args, actions) {
|
|
31
|
+
super(name, args, actions, name);
|
|
32
|
+
this.assertionType = '';
|
|
33
|
+
this.assertAttribute = '';
|
|
34
|
+
this.validate();
|
|
35
|
+
this.setAssertAttribute();
|
|
36
|
+
this.assertionType = this.name;
|
|
37
|
+
this.primaryAction = actions[0];
|
|
38
|
+
this.extractAction = actions[1];
|
|
39
|
+
if (args.length === 1) {
|
|
40
|
+
this.onFailure = args[0].onFailure;
|
|
41
|
+
this.observationScope = args[0].observationScope;
|
|
42
|
+
}
|
|
43
|
+
else if (args.length === 2) {
|
|
44
|
+
this.onFailure = args[1].onFailure;
|
|
45
|
+
this.observationScope = args[1].observationScope;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
validate() {
|
|
49
|
+
if (this.actions.length !== 2 &&
|
|
50
|
+
!(this.actions[0] instanceof FindAction_1.FindAction) &&
|
|
51
|
+
!(this.actions[1] instanceof ExtractAction_1.ExtractAction)) {
|
|
52
|
+
throw new Error('Legacy assert steps should have exactly two sub action: a find and an extract');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
setAssertAttribute() {
|
|
56
|
+
this.assertAttribute = this.getActionArgs()[0];
|
|
57
|
+
}
|
|
58
|
+
getStepName() {
|
|
59
|
+
return oldToNewAssertionTypes[this.getAssertionType()];
|
|
60
|
+
}
|
|
61
|
+
getAssertionType() {
|
|
62
|
+
return this.assertionType;
|
|
63
|
+
}
|
|
64
|
+
toStepDescriptor() {
|
|
65
|
+
const formatted = {};
|
|
66
|
+
if (this.assertionType !== 'assert_present' &&
|
|
67
|
+
this.assertionType !== 'assert_not_present') {
|
|
68
|
+
formatted.assertionValue = this.assertAttribute;
|
|
69
|
+
}
|
|
70
|
+
if (this.extractAction) {
|
|
71
|
+
formatted.extractType =
|
|
72
|
+
ExtractAction_1.ExtractAction.mablscriptToYamlType[this.extractAction.extractionType];
|
|
73
|
+
formatted.attribute = this.extractAction.extractionAttribute;
|
|
74
|
+
}
|
|
75
|
+
const find = this.primaryAction.toDescriptor();
|
|
76
|
+
formatted.findOptions = find.selectorFindOption;
|
|
77
|
+
if ((0, GetCurrentLocationDescriptor_1.isGetCurrentLocationDescriptor)(find) ||
|
|
78
|
+
(0, GetVariableDescriptor_1.isGetVariableDescriptor)(find) ||
|
|
79
|
+
(0, GetViewportDescriptor_1.isGetViewportDescriptor)(find)) {
|
|
80
|
+
formatted.kind = find.kind;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
switch (find.findType) {
|
|
84
|
+
case domUtil_1.FindType.FIND_COOKIE:
|
|
85
|
+
case domUtil_1.FindType.FIND_EMAIL:
|
|
86
|
+
formatted.findType = FindAction_1.findTypesToFormattedType[find.findType];
|
|
87
|
+
formatted.selector = find.findTarget;
|
|
88
|
+
break;
|
|
89
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
90
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
91
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
92
|
+
case domUtil_1.FindType.FIND_ALL:
|
|
93
|
+
formatted.findType = FindAction_1.findTypesToFormattedType[find.findType];
|
|
94
|
+
formatted.selector = find.findTarget;
|
|
95
|
+
break;
|
|
96
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
97
|
+
formatted.selector = find.findTarget.selector;
|
|
98
|
+
break;
|
|
99
|
+
default:
|
|
100
|
+
throw new Error(`Error generating step descriptor for ${this.getStepName()}: Unexpected find type ${find.findType}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
formatted.assertArguments = {
|
|
104
|
+
onFailure: this.onFailure,
|
|
105
|
+
observationScope: this.observationScope,
|
|
106
|
+
};
|
|
107
|
+
return formatted;
|
|
108
|
+
}
|
|
109
|
+
getFormattedStep(_fullLocatorsOn) {
|
|
110
|
+
const result = {};
|
|
111
|
+
result[this.getStepName()] = { ...this.annotationsAsYml() };
|
|
112
|
+
const formatted = result[this.getStepName()];
|
|
113
|
+
if (this.extractAction) {
|
|
114
|
+
formatted.attribute = this.extractAction.extractionAttribute;
|
|
115
|
+
formatted.extractType =
|
|
116
|
+
ExtractAction_1.ExtractAction.mablscriptToYamlType[this.extractAction.extractionType];
|
|
117
|
+
}
|
|
118
|
+
if (this.assertionType !== 'assert_present' &&
|
|
119
|
+
this.assertionType !== 'assert_not_present') {
|
|
120
|
+
formatted.assertionValue = this.assertAttribute;
|
|
121
|
+
}
|
|
122
|
+
const targetDescriptor = this.primaryAction.toDescriptor();
|
|
123
|
+
if ((0, GetVariableDescriptor_1.isGetVariableDescriptor)(targetDescriptor)) {
|
|
124
|
+
formatted.target = (0, GetVariableDescriptor_1.convertGetVariableDescriptorToYaml)(targetDescriptor);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
formatted.target = targetDescriptor;
|
|
128
|
+
}
|
|
129
|
+
formatted.assertArguments = {
|
|
130
|
+
onFailure: this.onFailure,
|
|
131
|
+
observationScope: this.observationScope,
|
|
132
|
+
};
|
|
133
|
+
if (this.stepId()) {
|
|
134
|
+
formatted.id = this.stepId();
|
|
135
|
+
}
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
138
|
+
getNewAssertionStep() {
|
|
139
|
+
const yamlified = (0, importer_1.yamlifyTheLoadedSteps)([this]);
|
|
140
|
+
const reloadedSteps = (0, importer_1.loadYamlSteps)(yamlified);
|
|
141
|
+
const result = reloadedSteps[0];
|
|
142
|
+
if (this.stepSourceIndexInFlow !== undefined) {
|
|
143
|
+
result.setStepSourceIndexInFlow(this.stepSourceIndexInFlow);
|
|
144
|
+
}
|
|
145
|
+
this.actions.forEach((_oldAction, actionIndex) => {
|
|
146
|
+
result.actions[actionIndex].setActionSourceIndexInStep(actionIndex);
|
|
147
|
+
});
|
|
148
|
+
if (this.actionSourceIndexInStep !== undefined) {
|
|
149
|
+
result.setActionSourceIndexInStep(this.actionSourceIndexInStep);
|
|
150
|
+
}
|
|
151
|
+
return result;
|
|
152
|
+
}
|
|
153
|
+
static fromYaml(stepName, _stepArgs) {
|
|
154
|
+
return new MablStep_1.MablStep(stepName, [], [], 'assert');
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
exports.AssertStepOld = AssertStepOld;
|
|
158
|
+
AssertStepOld.mablScriptStepNames = Object.keys(oldToNewAssertionTypes);
|
|
159
|
+
AssertStepOld.yamlMablScriptNames = [];
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasCustomFindOptions = exports.AwaitTabStep = void 0;
|
|
4
|
+
const domUtil_1 = require("../../domUtil");
|
|
5
|
+
const MablStep_1 = require("../MablStep");
|
|
6
|
+
class AwaitTabStep extends MablStep_1.MablStep {
|
|
7
|
+
constructor(name, args, actions) {
|
|
8
|
+
super(name, args, actions, 'await_tab');
|
|
9
|
+
this.tab = this.getActionArgs()[0];
|
|
10
|
+
}
|
|
11
|
+
getStepName() {
|
|
12
|
+
return 'AwaitTab';
|
|
13
|
+
}
|
|
14
|
+
toStepDescriptor() {
|
|
15
|
+
return {
|
|
16
|
+
tab: this.tab,
|
|
17
|
+
actionCode: this.actionCode,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static fromYaml(_stepName, stepArgs) {
|
|
21
|
+
const step = new AwaitTabStep('await_tab', [stepArgs.tab], []);
|
|
22
|
+
step.setStepId(stepArgs.id);
|
|
23
|
+
return step;
|
|
24
|
+
}
|
|
25
|
+
toMablscript() {
|
|
26
|
+
return `await_tab(${AwaitTabStep.getMablscriptSelectorFromTabFindAction(this.tab)})`;
|
|
27
|
+
}
|
|
28
|
+
static hasCustomFindOptions(tab) {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
return Object.keys((_b = (_a = tab.configuration) === null || _a === void 0 ? void 0 : _a.propertyPreferences) !== null && _b !== void 0 ? _b : {}).length > 0;
|
|
31
|
+
}
|
|
32
|
+
static getMablscriptSelectorFromTabFindAction(tab) {
|
|
33
|
+
const mablscriptSelectorChunks = ['selector_type: "tab"'];
|
|
34
|
+
if (tab.title !== undefined) {
|
|
35
|
+
mablscriptSelectorChunks.push(`title: "${(0, domUtil_1.escapeMablscriptString)(tab.title)}"`);
|
|
36
|
+
}
|
|
37
|
+
if (tab.url !== undefined) {
|
|
38
|
+
mablscriptSelectorChunks.push(`url: "${(0, domUtil_1.escapeMablscriptString)(tab.url)}"`);
|
|
39
|
+
}
|
|
40
|
+
if (tab.uuid !== undefined) {
|
|
41
|
+
mablscriptSelectorChunks.push(`uuid: "${(0, domUtil_1.escapeMablscriptString)(tab.uuid)}"`);
|
|
42
|
+
}
|
|
43
|
+
let descriptor = mablscriptSelectorChunks.join(', ');
|
|
44
|
+
if (tab.configuration) {
|
|
45
|
+
descriptor = `${descriptor}, ${AwaitTabStep.getConfigurationString(tab)}`;
|
|
46
|
+
}
|
|
47
|
+
return `{${descriptor}}`;
|
|
48
|
+
}
|
|
49
|
+
static getConfigurationString(tabSelector) {
|
|
50
|
+
let configString;
|
|
51
|
+
if (hasCustomFindOptions(tabSelector)) {
|
|
52
|
+
configString = (0, domUtil_1.buildStepArgumentString)({
|
|
53
|
+
params: { ...tabSelector.configuration },
|
|
54
|
+
legacy: true,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (configString) {
|
|
58
|
+
return `configuration: ${configString}`;
|
|
59
|
+
}
|
|
60
|
+
return '';
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.AwaitTabStep = AwaitTabStep;
|
|
64
|
+
AwaitTabStep.mablScriptStepNames = ['await_tab'];
|
|
65
|
+
AwaitTabStep.yamlMablScriptNames = ['AwaitTab'];
|
|
66
|
+
function hasCustomFindOptions(tab) {
|
|
67
|
+
return AwaitTabStep.hasCustomFindOptions(tab);
|
|
68
|
+
}
|
|
69
|
+
exports.hasCustomFindOptions = hasCustomFindOptions;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AwaitUploadsStep = void 0;
|
|
4
|
+
const MablStep_1 = require("../MablStep");
|
|
5
|
+
class AwaitUploadsStep extends MablStep_1.MablStep {
|
|
6
|
+
constructor(name, args, actions) {
|
|
7
|
+
super(name, args, actions, 'await_uploads');
|
|
8
|
+
}
|
|
9
|
+
getStepName() {
|
|
10
|
+
return 'AwaitUploads';
|
|
11
|
+
}
|
|
12
|
+
toStepDescriptor() {
|
|
13
|
+
return { actionCode: this.actionCode };
|
|
14
|
+
}
|
|
15
|
+
static fromYaml(_stepName, stepArgs) {
|
|
16
|
+
const step = new AwaitUploadsStep('await_uploads', [], []);
|
|
17
|
+
step.setStepId(stepArgs.id);
|
|
18
|
+
return step;
|
|
19
|
+
}
|
|
20
|
+
toMablscript() {
|
|
21
|
+
return `await_uploads()`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.AwaitUploadsStep = AwaitUploadsStep;
|
|
25
|
+
AwaitUploadsStep.mablScriptStepNames = ['await_uploads'];
|
|
26
|
+
AwaitUploadsStep.yamlMablScriptNames = ['AwaitUploads'];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClearCookiesStep = void 0;
|
|
4
|
+
const MablStep_1 = require("../MablStep");
|
|
5
|
+
class ClearCookiesStep extends MablStep_1.MablStep {
|
|
6
|
+
constructor(name, args, actions) {
|
|
7
|
+
super(name, args, actions, 'clear_cookies');
|
|
8
|
+
}
|
|
9
|
+
getStepName() {
|
|
10
|
+
return 'ClearCookies';
|
|
11
|
+
}
|
|
12
|
+
toStepDescriptor() {
|
|
13
|
+
return { actionCode: this.actionCode };
|
|
14
|
+
}
|
|
15
|
+
static fromYaml(_stepName, stepArgs) {
|
|
16
|
+
const step = new ClearCookiesStep('clear_cookies', [], []);
|
|
17
|
+
step.setStepId(stepArgs.id);
|
|
18
|
+
return step;
|
|
19
|
+
}
|
|
20
|
+
toMablscript() {
|
|
21
|
+
return `clear_cookies()`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.ClearCookiesStep = ClearCookiesStep;
|
|
25
|
+
ClearCookiesStep.mablScriptStepNames = ['clear_cookies'];
|
|
26
|
+
ClearCookiesStep.yamlMablScriptNames = ['ClearCookies'];
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClickAndHoldStep = void 0;
|
|
4
|
+
const FindAction_1 = require("../actions/FindAction");
|
|
5
|
+
const MablStep_1 = require("../MablStep");
|
|
6
|
+
const domUtil_1 = require("../../domUtil");
|
|
7
|
+
const ActionsUtils_1 = require("./ActionsUtils");
|
|
8
|
+
class ClickAndHoldStep extends MablStep_1.MablStep {
|
|
9
|
+
constructor(name, args, actions) {
|
|
10
|
+
var _a;
|
|
11
|
+
super(name, args, actions, 'click_and_hold');
|
|
12
|
+
this.findAction = ActionsUtils_1.ActionsUtils.validateSingleFindAction(this.actions);
|
|
13
|
+
this.clickArgs = (_a = this.parseArgs(args)) !== null && _a !== void 0 ? _a : { isHtml5: false };
|
|
14
|
+
}
|
|
15
|
+
parseArgs(args) {
|
|
16
|
+
if (args.length === 0) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
if (args.length !== 1) {
|
|
20
|
+
throw new Error(`Unexpected number of arguments to ${this.getStepName()} step.`);
|
|
21
|
+
}
|
|
22
|
+
if (!isClickAndHoldArgs(args[0])) {
|
|
23
|
+
throw new Error(`Invalid argument passed to ${this.getStepName()} step.`);
|
|
24
|
+
}
|
|
25
|
+
return args[0];
|
|
26
|
+
}
|
|
27
|
+
getStepName() {
|
|
28
|
+
return 'ClickAndHold';
|
|
29
|
+
}
|
|
30
|
+
toStepDescriptor() {
|
|
31
|
+
const find = this.findAction.toDescriptor();
|
|
32
|
+
switch (find.findType) {
|
|
33
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
34
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
35
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
36
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
37
|
+
return {
|
|
38
|
+
find,
|
|
39
|
+
isHtml5: this.clickArgs.isHtml5,
|
|
40
|
+
descriptorToActionMap: new Map().set(find, this.findAction),
|
|
41
|
+
actionCode: this.actionCode,
|
|
42
|
+
};
|
|
43
|
+
default:
|
|
44
|
+
throw new Error(`Error generating step descriptor for ${this.getStepName()}: Unexpected find type ${find.findType}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
getFormattedStep(_fullLocatorsOn) {
|
|
48
|
+
const step = {
|
|
49
|
+
ClickAndHold: {
|
|
50
|
+
...super.annotationsAsYml(),
|
|
51
|
+
...this.findAction.toYaml(),
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
if (this.stepId()) {
|
|
55
|
+
step.ClickAndHold.id = this.stepId();
|
|
56
|
+
}
|
|
57
|
+
return step;
|
|
58
|
+
}
|
|
59
|
+
static fromYaml(_stepName, stepArgs) {
|
|
60
|
+
const step = new ClickAndHoldStep('click_and_hold', [], [FindAction_1.FindAction.findActionFromStepArgs(stepArgs)]);
|
|
61
|
+
step.setStepId(stepArgs.id);
|
|
62
|
+
return step;
|
|
63
|
+
}
|
|
64
|
+
toMablscript() {
|
|
65
|
+
return `${this.findAction.toMablscript()}.click_and_hold({isHtml5:${this.clickArgs.isHtml5}})`;
|
|
66
|
+
}
|
|
67
|
+
getInputVariables() {
|
|
68
|
+
return this.findAction.getInputVariables();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.ClickAndHoldStep = ClickAndHoldStep;
|
|
72
|
+
ClickAndHoldStep.mablScriptStepNames = ['click_and_hold'];
|
|
73
|
+
ClickAndHoldStep.yamlMablScriptNames = ['ClickAndHold'];
|
|
74
|
+
function isClickAndHoldArgs(value) {
|
|
75
|
+
return value.isHtml5 !== undefined;
|
|
76
|
+
}
|