@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,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClickStep = 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 ClickStep extends MablStep_1.MablStep {
|
|
9
|
+
constructor(name, args, actions) {
|
|
10
|
+
super(name, args, actions, 'click');
|
|
11
|
+
this.findAction = ActionsUtils_1.ActionsUtils.validateSingleFindAction(this.actions);
|
|
12
|
+
}
|
|
13
|
+
getStepName() {
|
|
14
|
+
return 'Click';
|
|
15
|
+
}
|
|
16
|
+
toStepDescriptor() {
|
|
17
|
+
const find = this.findAction.toDescriptor();
|
|
18
|
+
switch (find.findType) {
|
|
19
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
20
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
21
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
22
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
23
|
+
return {
|
|
24
|
+
find,
|
|
25
|
+
descriptorToActionMap: new Map().set(find, this.findAction),
|
|
26
|
+
actionCode: this.actionCode,
|
|
27
|
+
};
|
|
28
|
+
default:
|
|
29
|
+
throw new Error(`Error generating step descriptor for ${this.getStepName()}: Unexpected find type ${find.findType}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
getFormattedStep(_fullLocatorsOn) {
|
|
33
|
+
const step = {
|
|
34
|
+
Click: {
|
|
35
|
+
...super.annotationsAsYml(),
|
|
36
|
+
...this.findAction.toYaml(),
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
if (this.stepId()) {
|
|
40
|
+
step.Click.id = this.stepId();
|
|
41
|
+
}
|
|
42
|
+
return step;
|
|
43
|
+
}
|
|
44
|
+
static fromYaml(_stepName, stepArgs) {
|
|
45
|
+
const step = new ClickStep('click', [], [FindAction_1.FindAction.findActionFromStepArgs(stepArgs)]);
|
|
46
|
+
step.setStepId(stepArgs.id);
|
|
47
|
+
return step;
|
|
48
|
+
}
|
|
49
|
+
toMablscript() {
|
|
50
|
+
return `${this.findAction.toMablscript()}.click()`;
|
|
51
|
+
}
|
|
52
|
+
getInputVariables() {
|
|
53
|
+
return this.findAction.getInputVariables();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.ClickStep = ClickStep;
|
|
57
|
+
ClickStep.mablScriptStepNames = ['click'];
|
|
58
|
+
ClickStep.yamlMablScriptNames = ['Click'];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CookieUtils = void 0;
|
|
4
|
+
var CookieUtils;
|
|
5
|
+
(function (CookieUtils) {
|
|
6
|
+
CookieUtils.validCookieNameCharacterRange = /^[\x21-\x7E]*$/;
|
|
7
|
+
CookieUtils.invalidCookieNameCharaters = /[()<>@,;:\\"\\/\[\]?={}]/;
|
|
8
|
+
CookieUtils.validCookieValueCharacters = /^(!|[\x23-\x2B]|[\x2D-\x3A]|[\x3C-\x5B]|[\x5D-\x7E])*$/;
|
|
9
|
+
function validateCookieName(name) {
|
|
10
|
+
const trimmed = name.trim();
|
|
11
|
+
if ('' === trimmed) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
if (!CookieUtils.validCookieNameCharacterRange.test(trimmed) ||
|
|
15
|
+
CookieUtils.invalidCookieNameCharaters.test(trimmed)) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
CookieUtils.validateCookieName = validateCookieName;
|
|
21
|
+
function normalizeName(name) {
|
|
22
|
+
const trimmed = name.trim();
|
|
23
|
+
if ('' === trimmed) {
|
|
24
|
+
throw new Error('Cookie name cannot be empty or include only whitespace characters');
|
|
25
|
+
}
|
|
26
|
+
return trimmed;
|
|
27
|
+
}
|
|
28
|
+
CookieUtils.normalizeName = normalizeName;
|
|
29
|
+
function validateCookieValue(value) {
|
|
30
|
+
const trimmed = value.trim();
|
|
31
|
+
if ('' === trimmed) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
if (!CookieUtils.validCookieValueCharacters.test(trimmed)) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
CookieUtils.validateCookieValue = validateCookieValue;
|
|
40
|
+
function normalizeValue(value) {
|
|
41
|
+
if (!value) {
|
|
42
|
+
throw new Error('Cookie value cannot be empty');
|
|
43
|
+
}
|
|
44
|
+
const trimmed = value.trim();
|
|
45
|
+
const bareValue = trimmed.startsWith('"') && trimmed.endsWith('"')
|
|
46
|
+
? trimmed.substring(1, trimmed.length - 1)
|
|
47
|
+
: trimmed;
|
|
48
|
+
if ('' === bareValue) {
|
|
49
|
+
throw new Error('Cookie value cannot be empty or include only whitespace characters');
|
|
50
|
+
}
|
|
51
|
+
return trimmed;
|
|
52
|
+
}
|
|
53
|
+
CookieUtils.normalizeValue = normalizeValue;
|
|
54
|
+
})(CookieUtils || (exports.CookieUtils = CookieUtils = {}));
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isCreateVariableStep = exports.CreateVariableStep = void 0;
|
|
4
|
+
const domUtil_1 = require("../../domUtil");
|
|
5
|
+
const CountAction_1 = require("../actions/CountAction");
|
|
6
|
+
const ExtractAction_1 = require("../actions/ExtractAction");
|
|
7
|
+
const FindAction_1 = require("../actions/FindAction");
|
|
8
|
+
const GenerateEmailAddressAction_1 = require("../actions/GenerateEmailAddressAction");
|
|
9
|
+
const GenerateRandomStringAction_1 = require("../actions/GenerateRandomStringAction");
|
|
10
|
+
const JavaScriptAction_1 = require("../actions/JavaScriptAction");
|
|
11
|
+
const MablStep_1 = require("../MablStep");
|
|
12
|
+
const CreateVariableStepDescriptor_1 = require("../types/CreateVariableStepDescriptor");
|
|
13
|
+
class CreateVariableStep extends MablStep_1.MablStep {
|
|
14
|
+
constructor(name, args, actions) {
|
|
15
|
+
super(name, args, actions, 'as');
|
|
16
|
+
this.variableName = this.getActionArgs()[0];
|
|
17
|
+
this.generationType = this.calculateGenerationType();
|
|
18
|
+
}
|
|
19
|
+
getStepName() {
|
|
20
|
+
return CreateVariableStep.stepName;
|
|
21
|
+
}
|
|
22
|
+
calculateGenerationType() {
|
|
23
|
+
if (this.actions.length === 2 && this.actions[0] instanceof FindAction_1.FindAction) {
|
|
24
|
+
if (this.actions[0].findDescriptor.findType === domUtil_1.FindType.FIND_COOKIE) {
|
|
25
|
+
return CreateVariableStepDescriptor_1.VariableGenerator.COOKIE_ATTRIBUTE;
|
|
26
|
+
}
|
|
27
|
+
if (this.actions[1] instanceof ExtractAction_1.ExtractAction) {
|
|
28
|
+
return CreateVariableStepDescriptor_1.VariableGenerator.ATTRIBUTE;
|
|
29
|
+
}
|
|
30
|
+
else if (this.actions[1] instanceof CountAction_1.CountAction) {
|
|
31
|
+
return CreateVariableStepDescriptor_1.VariableGenerator.ELEMENT_COUNT;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
else if (this.actions.length === 1 &&
|
|
35
|
+
this.actions[0] instanceof GenerateEmailAddressAction_1.GenerateEmailAddressAction) {
|
|
36
|
+
return CreateVariableStepDescriptor_1.VariableGenerator.EMAIL;
|
|
37
|
+
}
|
|
38
|
+
else if (this.actions.length === 1 &&
|
|
39
|
+
this.actions[0] instanceof JavaScriptAction_1.JavaScriptAction) {
|
|
40
|
+
return CreateVariableStepDescriptor_1.VariableGenerator.JAVASCRIPT;
|
|
41
|
+
}
|
|
42
|
+
else if (this.actions.length === 1 &&
|
|
43
|
+
this.actions[0] instanceof GenerateRandomStringAction_1.GenerateRandomStringAction) {
|
|
44
|
+
return CreateVariableStepDescriptor_1.VariableGenerator.PATTERN;
|
|
45
|
+
}
|
|
46
|
+
throw new Error('Unsupported variable generation type');
|
|
47
|
+
}
|
|
48
|
+
toStepDescriptor() {
|
|
49
|
+
let step;
|
|
50
|
+
switch (this.generationType) {
|
|
51
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.COOKIE_ATTRIBUTE:
|
|
52
|
+
const cookieFindAction = this.actions[0];
|
|
53
|
+
const cookieFind = cookieFindAction.toDescriptor();
|
|
54
|
+
step = {
|
|
55
|
+
name: this.variableName,
|
|
56
|
+
generator: {
|
|
57
|
+
type: CreateVariableStepDescriptor_1.VariableGenerator.COOKIE_ATTRIBUTE,
|
|
58
|
+
cookieSelector: cookieFind.findTarget,
|
|
59
|
+
attribute: this.actions[1].extractionAttribute,
|
|
60
|
+
},
|
|
61
|
+
find: cookieFind,
|
|
62
|
+
descriptorToActionMap: new Map().set(cookieFind, cookieFindAction),
|
|
63
|
+
actionCode: this.actionCode,
|
|
64
|
+
};
|
|
65
|
+
break;
|
|
66
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.ATTRIBUTE:
|
|
67
|
+
const findAction = this.actions[0];
|
|
68
|
+
const find = findAction.toDescriptor();
|
|
69
|
+
step = {
|
|
70
|
+
name: this.variableName,
|
|
71
|
+
generator: {
|
|
72
|
+
type: CreateVariableStepDescriptor_1.VariableGenerator.ATTRIBUTE,
|
|
73
|
+
attribute: this.actions[1].extractionAttribute,
|
|
74
|
+
find,
|
|
75
|
+
},
|
|
76
|
+
find,
|
|
77
|
+
descriptorToActionMap: new Map().set(find, findAction),
|
|
78
|
+
actionCode: this.actionCode,
|
|
79
|
+
};
|
|
80
|
+
break;
|
|
81
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.EMAIL:
|
|
82
|
+
step = {
|
|
83
|
+
name: this.variableName,
|
|
84
|
+
generator: { type: CreateVariableStepDescriptor_1.VariableGenerator.EMAIL },
|
|
85
|
+
actionCode: this.actionCode,
|
|
86
|
+
};
|
|
87
|
+
break;
|
|
88
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.JAVASCRIPT:
|
|
89
|
+
step = {
|
|
90
|
+
name: this.variableName,
|
|
91
|
+
generator: {
|
|
92
|
+
type: CreateVariableStepDescriptor_1.VariableGenerator.JAVASCRIPT,
|
|
93
|
+
javaScript: this.actions[0].javaScript,
|
|
94
|
+
},
|
|
95
|
+
actionCode: this.actionCode,
|
|
96
|
+
};
|
|
97
|
+
break;
|
|
98
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.PATTERN:
|
|
99
|
+
step = {
|
|
100
|
+
name: this.variableName,
|
|
101
|
+
generator: {
|
|
102
|
+
type: CreateVariableStepDescriptor_1.VariableGenerator.PATTERN,
|
|
103
|
+
pattern: this.actions[0]
|
|
104
|
+
.generateString,
|
|
105
|
+
},
|
|
106
|
+
actionCode: this.actionCode,
|
|
107
|
+
};
|
|
108
|
+
break;
|
|
109
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.ELEMENT_COUNT:
|
|
110
|
+
const countFindAction = this.actions[0];
|
|
111
|
+
const countFind = countFindAction.toDescriptor();
|
|
112
|
+
step = {
|
|
113
|
+
find: countFind,
|
|
114
|
+
name: this.variableName,
|
|
115
|
+
generator: {
|
|
116
|
+
type: CreateVariableStepDescriptor_1.VariableGenerator.ELEMENT_COUNT,
|
|
117
|
+
find: countFind,
|
|
118
|
+
},
|
|
119
|
+
descriptorToActionMap: new Map().set(countFind, countFindAction),
|
|
120
|
+
actionCode: this.actionCode,
|
|
121
|
+
};
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
return step;
|
|
125
|
+
}
|
|
126
|
+
getFormattedStep() {
|
|
127
|
+
var _a;
|
|
128
|
+
const step = this.toStepDescriptor();
|
|
129
|
+
const stepName = this.getStepName();
|
|
130
|
+
const formatted = {
|
|
131
|
+
[stepName]: {},
|
|
132
|
+
};
|
|
133
|
+
if (this.annotationsOnStep()) {
|
|
134
|
+
formatted[stepName].annotation = this.annotation;
|
|
135
|
+
}
|
|
136
|
+
if (this.description) {
|
|
137
|
+
formatted[stepName].description = this.description;
|
|
138
|
+
}
|
|
139
|
+
switch (step.generator.type) {
|
|
140
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.ELEMENT_COUNT:
|
|
141
|
+
formatted[stepName] = {
|
|
142
|
+
...formatted[stepName],
|
|
143
|
+
generator: step.generator,
|
|
144
|
+
name: this.variableName,
|
|
145
|
+
selector: step.generator.find.findTarget,
|
|
146
|
+
};
|
|
147
|
+
break;
|
|
148
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.ATTRIBUTE:
|
|
149
|
+
formatted[stepName] = {
|
|
150
|
+
...formatted[stepName],
|
|
151
|
+
generator: step.generator,
|
|
152
|
+
name: this.variableName,
|
|
153
|
+
selector: step.generator.find.findTarget.selector,
|
|
154
|
+
selectorAncestors: ((_a = step.generator.find.findTarget.auxiliaryDescriptors) !== null && _a !== void 0 ? _a : []).map((descriptor) => descriptor.selector),
|
|
155
|
+
};
|
|
156
|
+
break;
|
|
157
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.JAVASCRIPT:
|
|
158
|
+
formatted[stepName] = {
|
|
159
|
+
...formatted[stepName],
|
|
160
|
+
generator: {
|
|
161
|
+
type: CreateVariableStepDescriptor_1.VariableGenerator.JAVASCRIPT,
|
|
162
|
+
javaScript: this.actions[0].toYaml(),
|
|
163
|
+
},
|
|
164
|
+
name: this.variableName,
|
|
165
|
+
};
|
|
166
|
+
break;
|
|
167
|
+
default:
|
|
168
|
+
formatted[stepName] = {
|
|
169
|
+
...formatted[stepName],
|
|
170
|
+
generator: step.generator,
|
|
171
|
+
name: this.variableName,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (this.stepId()) {
|
|
175
|
+
formatted[stepName].id = this.stepId();
|
|
176
|
+
}
|
|
177
|
+
return formatted;
|
|
178
|
+
}
|
|
179
|
+
static fromYaml(_stepName, stepArgs) {
|
|
180
|
+
const variableName = stepArgs.name;
|
|
181
|
+
const generator = stepArgs.generator;
|
|
182
|
+
const generationType = generator.type;
|
|
183
|
+
const actions = [];
|
|
184
|
+
switch (generationType) {
|
|
185
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.ATTRIBUTE:
|
|
186
|
+
actions.push(FindAction_1.FindAction.findActionFromStepArgs(stepArgs));
|
|
187
|
+
const extractArgs = generator.metadata
|
|
188
|
+
? [generator.attribute, generator.metadata]
|
|
189
|
+
: [generator.attribute];
|
|
190
|
+
actions.push(new ExtractAction_1.ExtractAction('extract_attribute', extractArgs));
|
|
191
|
+
break;
|
|
192
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.ELEMENT_COUNT:
|
|
193
|
+
actions.push(FindAction_1.FindAction.findActionFromStepArgs(stepArgs, domUtil_1.FindType.FIND_ALL));
|
|
194
|
+
actions.push(new CountAction_1.CountAction('count', []));
|
|
195
|
+
break;
|
|
196
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.EMAIL:
|
|
197
|
+
actions.push(new GenerateEmailAddressAction_1.GenerateEmailAddressAction('generate_email_address', []));
|
|
198
|
+
break;
|
|
199
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.JAVASCRIPT:
|
|
200
|
+
actions.push(JavaScriptAction_1.JavaScriptAction.fromYaml(generator.javaScript));
|
|
201
|
+
break;
|
|
202
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.PATTERN:
|
|
203
|
+
actions.push(new GenerateRandomStringAction_1.GenerateRandomStringAction('generate_random_string', [
|
|
204
|
+
generator.pattern,
|
|
205
|
+
]));
|
|
206
|
+
break;
|
|
207
|
+
case CreateVariableStepDescriptor_1.VariableGenerator.COOKIE_ATTRIBUTE:
|
|
208
|
+
actions.push(new FindAction_1.FindAction('find_cookie', [generator.cookieSelector]));
|
|
209
|
+
const extractCookieArgs = [generator.attribute];
|
|
210
|
+
actions.push(new ExtractAction_1.ExtractAction('extract_attribute', extractCookieArgs));
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
const step = new CreateVariableStep('as', [variableName], actions);
|
|
214
|
+
step.setStepId(stepArgs.id);
|
|
215
|
+
return step;
|
|
216
|
+
}
|
|
217
|
+
toMablscript() {
|
|
218
|
+
return `${this.actions.reduce((mablscript, action) => `${mablscript}${action.toMablscript()}.`, '')}as("${this.variableName}")`;
|
|
219
|
+
}
|
|
220
|
+
getInputVariables() {
|
|
221
|
+
return this.actions[0].getInputVariables();
|
|
222
|
+
}
|
|
223
|
+
getOutputVariables() {
|
|
224
|
+
return [this.variableName];
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
exports.CreateVariableStep = CreateVariableStep;
|
|
228
|
+
CreateVariableStep.stepName = 'CreateVariable';
|
|
229
|
+
CreateVariableStep.mablScriptStepNames = ['as'];
|
|
230
|
+
CreateVariableStep.yamlMablScriptNames = ['CreateVariable', 'GenerateEmailAddress'];
|
|
231
|
+
function isCreateVariableStep(value) {
|
|
232
|
+
return ((value === null || value === void 0 ? void 0 : value.getStepName) &&
|
|
233
|
+
value.getStepName() === CreateVariableStep.stepName &&
|
|
234
|
+
!!value.generationType);
|
|
235
|
+
}
|
|
236
|
+
exports.isCreateVariableStep = isCreateVariableStep;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDatabaseQueryStep = exports.DatabaseQueryVariableSource = exports.DatabaseQueryStep = void 0;
|
|
4
|
+
const AbstractAssertionsAndVariablesStep_1 = require("./AbstractAssertionsAndVariablesStep");
|
|
5
|
+
class DatabaseQueryStep extends AbstractAssertionsAndVariablesStep_1.AbstractAssertionsAndVariablesStep {
|
|
6
|
+
constructor(name, args, actions) {
|
|
7
|
+
super(name, args, actions, DatabaseQueryStep.mablScriptStepNames[0], DatabaseQueryStep.stepName, args[0]);
|
|
8
|
+
}
|
|
9
|
+
static fromYaml(_stepName, stepArgs) {
|
|
10
|
+
const formatted = stepArgs;
|
|
11
|
+
const step = new DatabaseQueryStep(DatabaseQueryStep.stepName, [formatted], []);
|
|
12
|
+
step.setStepId(stepArgs.id);
|
|
13
|
+
return step;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.DatabaseQueryStep = DatabaseQueryStep;
|
|
17
|
+
DatabaseQueryStep.stepName = 'DatabaseQuery';
|
|
18
|
+
DatabaseQueryStep.mablScriptStepNames = ['database_query'];
|
|
19
|
+
DatabaseQueryStep.yamlMablScriptNames = [DatabaseQueryStep.stepName];
|
|
20
|
+
var DatabaseQueryVariableSource;
|
|
21
|
+
(function (DatabaseQueryVariableSource) {
|
|
22
|
+
DatabaseQueryVariableSource["Metadata"] = "metadata";
|
|
23
|
+
DatabaseQueryVariableSource["Result"] = "result";
|
|
24
|
+
})(DatabaseQueryVariableSource || (exports.DatabaseQueryVariableSource = DatabaseQueryVariableSource = {}));
|
|
25
|
+
function isDatabaseQueryStep(step) {
|
|
26
|
+
return step.getStepName() === DatabaseQueryStep.stepName;
|
|
27
|
+
}
|
|
28
|
+
exports.isDatabaseQueryStep = isDatabaseQueryStep;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DoubleClickStep = void 0;
|
|
4
|
+
const MablStep_1 = require("../MablStep");
|
|
5
|
+
const FindAction_1 = require("../actions/FindAction");
|
|
6
|
+
const domUtil_1 = require("../../domUtil");
|
|
7
|
+
class DoubleClickStep extends MablStep_1.MablStep {
|
|
8
|
+
constructor(name, args, actions) {
|
|
9
|
+
super(name, args, actions, 'double_click');
|
|
10
|
+
this.validate();
|
|
11
|
+
this.findAction = this.actions[0];
|
|
12
|
+
}
|
|
13
|
+
validate() {
|
|
14
|
+
if (this.actions.length !== 1 && !(this.actions[0] instanceof FindAction_1.FindAction)) {
|
|
15
|
+
throw new Error('Double click steps should have exactly on sub action and it should be a find');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
getStepName() {
|
|
19
|
+
return 'DoubleClick';
|
|
20
|
+
}
|
|
21
|
+
toStepDescriptor() {
|
|
22
|
+
const find = this.findAction.toDescriptor();
|
|
23
|
+
switch (find.findType) {
|
|
24
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
25
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
26
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
27
|
+
case domUtil_1.FindType.FIND_ALL:
|
|
28
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
29
|
+
return {
|
|
30
|
+
find,
|
|
31
|
+
descriptorToActionMap: new Map().set(find, this.findAction),
|
|
32
|
+
actionCode: this.actionCode,
|
|
33
|
+
};
|
|
34
|
+
default:
|
|
35
|
+
throw new Error(`Error generating step descriptor for ${this.getStepName()}: Unexpected find type ${find.findType}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
getFormattedStep(_fullLocatorsOn) {
|
|
39
|
+
const step = {
|
|
40
|
+
DoubleClick: {
|
|
41
|
+
...super.annotationsAsYml(),
|
|
42
|
+
...this.findAction.toYaml(),
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
if (this.stepId()) {
|
|
46
|
+
step.DoubleClick.id = this.stepId();
|
|
47
|
+
}
|
|
48
|
+
return step;
|
|
49
|
+
}
|
|
50
|
+
static fromYaml(_stepName, stepArgs) {
|
|
51
|
+
const step = new DoubleClickStep('double_click', [], [FindAction_1.FindAction.findActionFromStepArgs(stepArgs)]);
|
|
52
|
+
step.setStepId(stepArgs.id);
|
|
53
|
+
return step;
|
|
54
|
+
}
|
|
55
|
+
toMablscript() {
|
|
56
|
+
return `${this.findAction.toMablscript()}.double_click()`;
|
|
57
|
+
}
|
|
58
|
+
getInputVariables() {
|
|
59
|
+
return this.findAction.getInputVariables();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.DoubleClickStep = DoubleClickStep;
|
|
63
|
+
DoubleClickStep.mablScriptStepNames = ['double_click'];
|
|
64
|
+
DoubleClickStep.yamlMablScriptNames = ['DoubleClick'];
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DownloadStep = void 0;
|
|
4
|
+
const MablStep_1 = require("../MablStep");
|
|
5
|
+
const MablAction_1 = require("../MablAction");
|
|
6
|
+
const AwaitDownloadAction_1 = require("../actions/AwaitDownloadAction");
|
|
7
|
+
const AwaitPDFDownloadAction_1 = require("../actions/AwaitPDFDownloadAction");
|
|
8
|
+
const domUtil_1 = require("../../domUtil");
|
|
9
|
+
class DownloadStep extends MablStep_1.MablStep {
|
|
10
|
+
constructor(name, args, actions) {
|
|
11
|
+
var _a;
|
|
12
|
+
super(name, args, actions, 'assert_download');
|
|
13
|
+
this.validate();
|
|
14
|
+
this.fileAttributes = ((_a = this.getActionArgs()[0]) !== null && _a !== void 0 ? _a : {});
|
|
15
|
+
this.awaitDownloadAction = this.actions[0];
|
|
16
|
+
}
|
|
17
|
+
validate() {
|
|
18
|
+
if (this.actions.length !== 1 &&
|
|
19
|
+
!(this.actions[0] instanceof AwaitDownloadAction_1.AwaitDownloadAction)) {
|
|
20
|
+
throw new Error('Download step should contain an await download sub action');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
getStepName() {
|
|
24
|
+
if (this.isPDFDownload()) {
|
|
25
|
+
return 'DownloadPdfStep';
|
|
26
|
+
}
|
|
27
|
+
return 'DownloadStep';
|
|
28
|
+
}
|
|
29
|
+
isPDFDownload() {
|
|
30
|
+
return this.awaitDownloadAction instanceof AwaitPDFDownloadAction_1.AwaitPDFDownloadAction;
|
|
31
|
+
}
|
|
32
|
+
toStepDescriptor() {
|
|
33
|
+
const formatted = {};
|
|
34
|
+
if (this.isPDFDownload()) {
|
|
35
|
+
formatted.tabIdentifier = this.actions[0].pdfUUID;
|
|
36
|
+
}
|
|
37
|
+
if (this.fileAttributes.file_name !== undefined) {
|
|
38
|
+
formatted.fileName = this.fileAttributes.file_name;
|
|
39
|
+
}
|
|
40
|
+
if (this.fileAttributes.file_mime_type !== undefined) {
|
|
41
|
+
formatted.mimeType = this.fileAttributes.file_mime_type;
|
|
42
|
+
}
|
|
43
|
+
if (this.fileAttributes.file_md5 !== undefined) {
|
|
44
|
+
formatted.fileMd5 = this.fileAttributes.file_md5;
|
|
45
|
+
}
|
|
46
|
+
if (this.fileAttributes.file_sha256 !== undefined) {
|
|
47
|
+
formatted.fileSha256 = this.fileAttributes.file_sha256;
|
|
48
|
+
}
|
|
49
|
+
if (this.fileAttributes.file_size_bytes !== undefined) {
|
|
50
|
+
formatted.sizeBytes = this.fileAttributes.file_size_bytes;
|
|
51
|
+
}
|
|
52
|
+
if (this.fileAttributes.file_size_bytes_max !== undefined) {
|
|
53
|
+
formatted.sizeBytesMax = this.fileAttributes.file_size_bytes_max;
|
|
54
|
+
}
|
|
55
|
+
if (this.fileAttributes.file_size_bytes_min !== undefined) {
|
|
56
|
+
formatted.sizeBytesMin = this.fileAttributes.file_size_bytes_min;
|
|
57
|
+
}
|
|
58
|
+
return formatted;
|
|
59
|
+
}
|
|
60
|
+
static fromYaml(_stepName, stepArgs) {
|
|
61
|
+
const fileAttributes = {};
|
|
62
|
+
const assertDownload = stepArgs;
|
|
63
|
+
fileAttributes.file_name = assertDownload.fileName;
|
|
64
|
+
fileAttributes.file_mime_type = assertDownload.mimeType;
|
|
65
|
+
fileAttributes.file_md5 = assertDownload.fileMd5;
|
|
66
|
+
fileAttributes.file_sha256 = assertDownload.fileSha256;
|
|
67
|
+
fileAttributes.file_size_bytes = assertDownload.sizeBytes;
|
|
68
|
+
fileAttributes.file_size_bytes_max = assertDownload.sizeBytesMax;
|
|
69
|
+
fileAttributes.file_size_bytes_min = assertDownload.sizeBytesMin;
|
|
70
|
+
let awaitDownloadAction;
|
|
71
|
+
if (assertDownload.tabIdentifier) {
|
|
72
|
+
awaitDownloadAction = new AwaitPDFDownloadAction_1.AwaitPDFDownloadAction('await_pdf', [
|
|
73
|
+
{ uuid: assertDownload.tabIdentifier },
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
awaitDownloadAction = new AwaitDownloadAction_1.AwaitDownloadAction('await_download', []);
|
|
78
|
+
}
|
|
79
|
+
const step = new DownloadStep('assert_download', [fileAttributes], [awaitDownloadAction]);
|
|
80
|
+
step.setStepId(stepArgs.id);
|
|
81
|
+
return step;
|
|
82
|
+
}
|
|
83
|
+
toMablscript() {
|
|
84
|
+
const mablArgs = (0, domUtil_1.buildStepArgumentString)({
|
|
85
|
+
params: { ...this.fileAttributes },
|
|
86
|
+
legacy: true,
|
|
87
|
+
});
|
|
88
|
+
return `${this.awaitDownloadAction.toMablscript()}.assert_download(${mablArgs ? mablArgs : ''})`;
|
|
89
|
+
}
|
|
90
|
+
getInputVariables() {
|
|
91
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.fileAttributes);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.DownloadStep = DownloadStep;
|
|
95
|
+
DownloadStep.mablScriptStepNames = ['assert_download'];
|
|
96
|
+
DownloadStep.yamlMablScriptNames = ['DownloadStep', 'DownloadPdfStep'];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EchoStep = void 0;
|
|
4
|
+
const MablStep_1 = require("../MablStep");
|
|
5
|
+
const domUtil_1 = require("../../domUtil");
|
|
6
|
+
const MablAction_1 = require("../MablAction");
|
|
7
|
+
class EchoStep extends MablStep_1.MablStep {
|
|
8
|
+
constructor(name, args, actions) {
|
|
9
|
+
super(name, args, actions, 'echo');
|
|
10
|
+
this.echoValue = (0, MablAction_1.parseArgument)(this.getActionArgs()[0]);
|
|
11
|
+
}
|
|
12
|
+
getStepName() {
|
|
13
|
+
return EchoStep.stepName;
|
|
14
|
+
}
|
|
15
|
+
toStepDescriptor() {
|
|
16
|
+
return { value: this.echoValue.toString(), actionCode: this.actionCode };
|
|
17
|
+
}
|
|
18
|
+
static fromYaml(_stepName, stepArgs) {
|
|
19
|
+
const step = new EchoStep(EchoStep.stepName, [stepArgs.value], []);
|
|
20
|
+
step.setStepId(stepArgs.id);
|
|
21
|
+
return step;
|
|
22
|
+
}
|
|
23
|
+
toMablscript() {
|
|
24
|
+
const stringEchoValue = `${this.echoValue}`;
|
|
25
|
+
return `echo("${(0, domUtil_1.escapeMablscriptString)(stringEchoValue)}")`;
|
|
26
|
+
}
|
|
27
|
+
getInputVariables() {
|
|
28
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.echoValue);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.EchoStep = EchoStep;
|
|
32
|
+
EchoStep.stepName = 'Echo';
|
|
33
|
+
EchoStep.mablScriptStepNames = ['echo'];
|
|
34
|
+
EchoStep.yamlMablScriptNames = [EchoStep.stepName];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isElseIfConditionStep = exports.ElseIfConditionStep = void 0;
|
|
4
|
+
const MablAction_1 = require("../MablAction");
|
|
5
|
+
const IfConditionStep_1 = require("./IfConditionStep");
|
|
6
|
+
class ElseIfConditionStep extends IfConditionStep_1.IfConditionStep {
|
|
7
|
+
getStepName() {
|
|
8
|
+
return 'ElseIf';
|
|
9
|
+
}
|
|
10
|
+
static fromYaml(_stepName, stepArgs) {
|
|
11
|
+
const actions = [
|
|
12
|
+
new MablAction_1.MablAction('conditional_else', 'conditional_else_if', []),
|
|
13
|
+
];
|
|
14
|
+
actions.push(...IfConditionStep_1.IfConditionStep.getActionsFromYamlForCondition(stepArgs));
|
|
15
|
+
const step = new ElseIfConditionStep('conditional_else_if', [], actions);
|
|
16
|
+
step.setStepId(stepArgs.id);
|
|
17
|
+
return step;
|
|
18
|
+
}
|
|
19
|
+
toMablscript() {
|
|
20
|
+
const actions = this.actions.reduce((mablscript, action) => `${mablscript}${action.toMablscript()}.`, '');
|
|
21
|
+
return `conditional_else()${actions}conditional_else_if()`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.ElseIfConditionStep = ElseIfConditionStep;
|
|
25
|
+
ElseIfConditionStep.stepName = 'conditional_else_if';
|
|
26
|
+
ElseIfConditionStep.mablScriptStepNames = [ElseIfConditionStep.stepName];
|
|
27
|
+
ElseIfConditionStep.yamlMablScriptNames = ['ElseIf'];
|
|
28
|
+
function isElseIfConditionStep(value) {
|
|
29
|
+
return ((value === null || value === void 0 ? void 0 : value.getStepName) &&
|
|
30
|
+
(value === null || value === void 0 ? void 0 : value.getStepName()) === ElseIfConditionStep.yamlMablScriptNames[0]);
|
|
31
|
+
}
|
|
32
|
+
exports.isElseIfConditionStep = isElseIfConditionStep;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ElseStep = void 0;
|
|
4
|
+
const MablStep_1 = require("../MablStep");
|
|
5
|
+
class ElseStep extends MablStep_1.MablStep {
|
|
6
|
+
constructor(name, args, actions) {
|
|
7
|
+
super(name, args, actions, 'conditional_else');
|
|
8
|
+
}
|
|
9
|
+
getStepName() {
|
|
10
|
+
return 'Else';
|
|
11
|
+
}
|
|
12
|
+
toStepDescriptor() {
|
|
13
|
+
return { actionCode: this.actionCode };
|
|
14
|
+
}
|
|
15
|
+
static fromYaml(_stepName, stepArgs) {
|
|
16
|
+
const step = new ElseStep('conditional_else', [], []);
|
|
17
|
+
step.setStepId(stepArgs.id);
|
|
18
|
+
return step;
|
|
19
|
+
}
|
|
20
|
+
toMablscript() {
|
|
21
|
+
return `conditional_else()`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.ElseStep = ElseStep;
|
|
25
|
+
ElseStep.stepName = 'conditional_else';
|
|
26
|
+
ElseStep.mablScriptStepNames = [ElseStep.stepName];
|
|
27
|
+
ElseStep.yamlMablScriptNames = ['Else'];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EndStep = void 0;
|
|
4
|
+
const MablStep_1 = require("../MablStep");
|
|
5
|
+
class EndStep extends MablStep_1.MablStep {
|
|
6
|
+
constructor(name, args, actions) {
|
|
7
|
+
super(name, args, actions, 'conditional_end');
|
|
8
|
+
}
|
|
9
|
+
getStepName() {
|
|
10
|
+
return 'End';
|
|
11
|
+
}
|
|
12
|
+
toStepDescriptor() {
|
|
13
|
+
return { actionCode: this.actionCode };
|
|
14
|
+
}
|
|
15
|
+
static fromYaml(_stepName, stepArgs) {
|
|
16
|
+
const step = new EndStep('conditional_end', [], []);
|
|
17
|
+
step.setStepId(stepArgs.id);
|
|
18
|
+
return step;
|
|
19
|
+
}
|
|
20
|
+
toMablscript() {
|
|
21
|
+
return `conditional_end()`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.EndStep = EndStep;
|
|
25
|
+
EndStep.stepName = 'conditional_end';
|
|
26
|
+
EndStep.mablScriptStepNames = [EndStep.stepName];
|
|
27
|
+
EndStep.yamlMablScriptNames = ['End'];
|