@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,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const js_yaml_1 = require("js-yaml");
|
|
7
|
+
const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
|
|
8
|
+
const util_1 = require("../../commandUtil/util");
|
|
9
|
+
const cli_table3_1 = __importDefault(require("cli-table3"));
|
|
10
|
+
const moment = require("moment");
|
|
11
|
+
const list_1 = require("../../commandUtil/list");
|
|
12
|
+
const loggingProvider_1 = require("../../../providers/logging/loggingProvider");
|
|
13
|
+
const constants_1 = require("../../constants");
|
|
14
|
+
exports.command = 'list';
|
|
15
|
+
exports.describe = 'List your applications';
|
|
16
|
+
exports.builder = (0, list_1.getListBuilderOptions)('applications');
|
|
17
|
+
exports.handler = (0, util_1.failWrapper)(listApplications);
|
|
18
|
+
async function listApplications(parsed) {
|
|
19
|
+
const output = parsed.output;
|
|
20
|
+
const limit = parsed.limit;
|
|
21
|
+
const workspaceId = await (0, util_1.getWorkspaceId)(parsed);
|
|
22
|
+
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
23
|
+
const applications = await apiClient.getApplications(workspaceId, limit);
|
|
24
|
+
printApplications(applications, output);
|
|
25
|
+
return applications.length;
|
|
26
|
+
}
|
|
27
|
+
function printApplications(applications, output) {
|
|
28
|
+
switch (output) {
|
|
29
|
+
case 'json':
|
|
30
|
+
loggingProvider_1.logger.info(JSON.stringify(applications, null, 2));
|
|
31
|
+
break;
|
|
32
|
+
case 'yaml':
|
|
33
|
+
loggingProvider_1.logger.info((0, js_yaml_1.dump)(applications));
|
|
34
|
+
break;
|
|
35
|
+
default:
|
|
36
|
+
const table = new cli_table3_1.default({
|
|
37
|
+
head: ['ID', 'Name', 'Created time'],
|
|
38
|
+
wordWrap: true,
|
|
39
|
+
});
|
|
40
|
+
applications.forEach((application) => {
|
|
41
|
+
table.push([
|
|
42
|
+
{ rowSpan: 1, content: application.id, vAlign: 'center' },
|
|
43
|
+
{ rowSpan: 1, content: application.name, vAlign: 'center' },
|
|
44
|
+
{
|
|
45
|
+
rowSpan: 1,
|
|
46
|
+
content: moment
|
|
47
|
+
.utc(application.created_time)
|
|
48
|
+
.format(constants_1.ListTimeFormat),
|
|
49
|
+
vAlign: 'center',
|
|
50
|
+
},
|
|
51
|
+
]);
|
|
52
|
+
});
|
|
53
|
+
loggingProvider_1.logger.info(table.toString());
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const authenticationProvider_1 = require("../../../providers/authenticationProvider");
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
|
|
6
|
+
const cliConfigProvider_1 = require("../../../providers/cliConfigProvider");
|
|
7
|
+
const util_1 = require("../../commandUtil/util");
|
|
8
|
+
exports.command = `activate-key <${constants_1.CommandArgApiKey}>`;
|
|
9
|
+
exports.describe = 'Activate auth by api key';
|
|
10
|
+
exports.builder = {};
|
|
11
|
+
exports.builder = (yargs) => {
|
|
12
|
+
yargs
|
|
13
|
+
.positional(constants_1.CommandArgApiKey, {
|
|
14
|
+
describe: 'API key (escape leading dashes with "\\" (e.g. "\\-yourKey")',
|
|
15
|
+
type: 'string',
|
|
16
|
+
nargs: 1,
|
|
17
|
+
demand: 'API key argument required',
|
|
18
|
+
})
|
|
19
|
+
.option('skip-workspace', {
|
|
20
|
+
describe: 'Set to skip validating and setting the workspace',
|
|
21
|
+
default: false,
|
|
22
|
+
hidden: true,
|
|
23
|
+
type: 'boolean',
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
exports.handler = (0, util_1.failWrapper)(activateApiKey);
|
|
27
|
+
async function activateApiKey(parsed) {
|
|
28
|
+
const auth = new authenticationProvider_1.AuthenticationProvider();
|
|
29
|
+
const apiKey = parsed['api-key'];
|
|
30
|
+
const cleanApiKey = apiKey.replace(/^\\+/, '');
|
|
31
|
+
const mablApi = await mablApiClientFactory_1.MablApiClientFactory.createApiClientFromApiKey(cleanApiKey);
|
|
32
|
+
const apiKeyDetails = await mablApi.getApiKeyDetails();
|
|
33
|
+
if (!parsed['skip-workspace']) {
|
|
34
|
+
const apiKeyWorkspace = await mablApi.getWorkspace(apiKeyDetails.workspace_id);
|
|
35
|
+
await cliConfigProvider_1.CliConfigProvider.setWorkspace(apiKeyWorkspace);
|
|
36
|
+
}
|
|
37
|
+
return auth.activateApiKey(cleanApiKey);
|
|
38
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const authenticationProvider_1 = require("../../../providers/authenticationProvider");
|
|
4
|
+
exports.command = 'clear';
|
|
5
|
+
exports.describe = 'Clear logged in user';
|
|
6
|
+
exports.builder = {};
|
|
7
|
+
exports.handler = exports.handler = () => {
|
|
8
|
+
const auth = new authenticationProvider_1.AuthenticationProvider();
|
|
9
|
+
return auth.clearAuthentication();
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const authenticationProvider_1 = require("../../../providers/authenticationProvider");
|
|
4
|
+
exports.command = 'info';
|
|
5
|
+
exports.describe = 'Display logged in user';
|
|
6
|
+
exports.builder = {};
|
|
7
|
+
exports.handler = () => {
|
|
8
|
+
const auth = new authenticationProvider_1.AuthenticationProvider();
|
|
9
|
+
return auth.displayInfo();
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const authenticationProvider_1 = require("../../../providers/authenticationProvider");
|
|
4
|
+
exports.command = 'login';
|
|
5
|
+
exports.describe = 'Authenticate the mabl CLI';
|
|
6
|
+
exports.builder = {};
|
|
7
|
+
exports.handler = exports.handler = () => {
|
|
8
|
+
const auth = new authenticationProvider_1.AuthenticationProvider();
|
|
9
|
+
return auth.authenticate();
|
|
10
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
|
|
4
|
+
const util_1 = require("../../commandUtil/util");
|
|
5
|
+
const branches_1 = require("../../commandUtil/branches");
|
|
6
|
+
const describe_1 = require("../../commandUtil/describe");
|
|
7
|
+
const ApiError_1 = require("../../../api/ApiError");
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const loggingProvider_1 = require("../../../providers/logging/loggingProvider");
|
|
10
|
+
exports.command = 'create <name>';
|
|
11
|
+
exports.describe = 'Create a new mabl branch';
|
|
12
|
+
exports.builder = (yargs) => {
|
|
13
|
+
yargs
|
|
14
|
+
.positional(constants_1.CommandArgName, {
|
|
15
|
+
describe: 'Name of the mabl branch to create',
|
|
16
|
+
nargs: 1,
|
|
17
|
+
type: 'string',
|
|
18
|
+
demand: 'branch name is required',
|
|
19
|
+
})
|
|
20
|
+
.option(constants_1.CommandArgOutput, {
|
|
21
|
+
alias: constants_1.CommandArgAliases.OutputType,
|
|
22
|
+
describe: 'Specify an output type for the branch data',
|
|
23
|
+
choices: constants_1.DefaultOutputFormatChoices,
|
|
24
|
+
})
|
|
25
|
+
.option(constants_1.CommandArgWorkspaceId, {
|
|
26
|
+
alias: constants_1.CommandArgAliases.WorkspaceId,
|
|
27
|
+
describe: 'The workspace ID to create a new branch',
|
|
28
|
+
nargs: 1,
|
|
29
|
+
type: 'string',
|
|
30
|
+
})
|
|
31
|
+
.check((argv) => {
|
|
32
|
+
const branchName = argv[constants_1.CommandArgName];
|
|
33
|
+
if (!(0, branches_1.isValidMablBranchName)(branchName)) {
|
|
34
|
+
throw new Error(`[${branchName}] is not a valid mabl branch name. Please specify a valid name`);
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
exports.handler = (0, util_1.failWrapper)(createBranch);
|
|
40
|
+
async function createBranch(parsed) {
|
|
41
|
+
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
42
|
+
const workspaceId = await (0, util_1.getWorkspaceId)(parsed);
|
|
43
|
+
const branchName = parsed.name;
|
|
44
|
+
loggingProvider_1.logger.info(`Creating Branch [${branchName}]`);
|
|
45
|
+
try {
|
|
46
|
+
const branch = await apiClient.createBranch(workspaceId, branchName);
|
|
47
|
+
(0, describe_1.outputEntity)(branch, parsed.output);
|
|
48
|
+
return branch.id;
|
|
49
|
+
}
|
|
50
|
+
catch (creationError) {
|
|
51
|
+
if (creationError instanceof ApiError_1.ApiError && creationError.statusCode === 400) {
|
|
52
|
+
throw new Error(`mabl branch with [${branchName}] may already exist in workspace [${workspaceId}]`);
|
|
53
|
+
}
|
|
54
|
+
throw creationError;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
|
|
4
|
+
const util_1 = require("../../commandUtil/util");
|
|
5
|
+
const describe_1 = require("../../commandUtil/describe");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
exports.command = 'describe <identifier>';
|
|
8
|
+
exports.describe = 'Describe a specific mabl branch by id or name';
|
|
9
|
+
exports.builder = (yargs) => {
|
|
10
|
+
yargs
|
|
11
|
+
.positional('identifier', {
|
|
12
|
+
describe: 'The branch ID or NAME to describe',
|
|
13
|
+
type: 'string',
|
|
14
|
+
nargs: 1,
|
|
15
|
+
demand: 'Branch identifier is required',
|
|
16
|
+
})
|
|
17
|
+
.option(constants_1.CommandArgName, {
|
|
18
|
+
alias: constants_1.CommandArgAliases.Name,
|
|
19
|
+
describe: 'Use identifier as Get branch based on name',
|
|
20
|
+
type: 'boolean',
|
|
21
|
+
default: false,
|
|
22
|
+
})
|
|
23
|
+
.option(constants_1.CommandArgOutput, {
|
|
24
|
+
alias: constants_1.CommandArgAliases.OutputType,
|
|
25
|
+
describe: 'Specify an output type for the branch data',
|
|
26
|
+
choices: constants_1.DefaultOutputFormatChoices,
|
|
27
|
+
})
|
|
28
|
+
.option(constants_1.CommandArgWorkspaceId, {
|
|
29
|
+
alias: constants_1.CommandArgAliases.WorkspaceId,
|
|
30
|
+
describe: 'The workspace ID to create a new branch',
|
|
31
|
+
nargs: 1,
|
|
32
|
+
type: 'string',
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
exports.handler = (0, util_1.failWrapper)(getBranch);
|
|
36
|
+
async function getBranch(parsed) {
|
|
37
|
+
const branchIdentifier = parsed.identifier;
|
|
38
|
+
const lookupByName = parsed.name;
|
|
39
|
+
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
40
|
+
let branch;
|
|
41
|
+
if (lookupByName) {
|
|
42
|
+
const workspaceId = await (0, util_1.getWorkspaceId)(parsed);
|
|
43
|
+
branch = await apiClient.getBranchByName(workspaceId, branchIdentifier);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
branch = await apiClient.getBranchById(branchIdentifier);
|
|
47
|
+
}
|
|
48
|
+
(0, describe_1.outputEntity)(branch, parsed.output);
|
|
49
|
+
return branch.id;
|
|
50
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const js_yaml_1 = require("js-yaml");
|
|
7
|
+
const cli_table3_1 = __importDefault(require("cli-table3"));
|
|
8
|
+
const moment = require("moment");
|
|
9
|
+
const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
|
|
10
|
+
const util_1 = require("../../commandUtil/util");
|
|
11
|
+
const interfaces_1 = require("../../commandUtil/interfaces");
|
|
12
|
+
const constants_1 = require("../../constants");
|
|
13
|
+
const loggingProvider_1 = require("../../../providers/logging/loggingProvider");
|
|
14
|
+
exports.command = 'list';
|
|
15
|
+
exports.describe = 'List mabl branches';
|
|
16
|
+
exports.builder = {
|
|
17
|
+
[constants_1.CommandArgLimitOutput]: {
|
|
18
|
+
alias: constants_1.CommandArgAliases.LimitOutput,
|
|
19
|
+
describe: 'Item return limit',
|
|
20
|
+
nargs: 1,
|
|
21
|
+
default: interfaces_1.DEFAULT_LISTING_RESULT_LIMIT,
|
|
22
|
+
},
|
|
23
|
+
[constants_1.CommandArgOutput]: {
|
|
24
|
+
alias: constants_1.CommandArgAliases.OutputType,
|
|
25
|
+
describe: 'Specify result output format',
|
|
26
|
+
choices: constants_1.DefaultOutputFormatChoices,
|
|
27
|
+
nargs: 1,
|
|
28
|
+
},
|
|
29
|
+
status: {
|
|
30
|
+
alias: constants_1.CommandArgAliases.Status,
|
|
31
|
+
describe: 'filter results by status',
|
|
32
|
+
choices: ['open', 'merged'],
|
|
33
|
+
nargs: 1,
|
|
34
|
+
},
|
|
35
|
+
[constants_1.CommandArgWorkspaceId]: {
|
|
36
|
+
alias: constants_1.CommandArgAliases.WorkspaceId,
|
|
37
|
+
describe: 'The workspace ID to list branches for',
|
|
38
|
+
nargs: 1,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
exports.handler = (0, util_1.failWrapper)(listBranches);
|
|
42
|
+
async function listBranches(parsed) {
|
|
43
|
+
const output = parsed.output;
|
|
44
|
+
const limit = parsed.limit;
|
|
45
|
+
const statusFilter = parsed.status;
|
|
46
|
+
const workspaceId = await (0, util_1.getWorkspaceId)(parsed);
|
|
47
|
+
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
48
|
+
const branches = await apiClient.getBranches(workspaceId, limit, statusFilter);
|
|
49
|
+
printBranches(branches, output);
|
|
50
|
+
return branches.length;
|
|
51
|
+
}
|
|
52
|
+
function printBranches(branches, output) {
|
|
53
|
+
switch (output) {
|
|
54
|
+
case 'json':
|
|
55
|
+
loggingProvider_1.logger.info(JSON.stringify(branches, null, 2));
|
|
56
|
+
break;
|
|
57
|
+
case 'yaml':
|
|
58
|
+
loggingProvider_1.logger.info((0, js_yaml_1.dump)(branches));
|
|
59
|
+
break;
|
|
60
|
+
default:
|
|
61
|
+
const table = new cli_table3_1.default({
|
|
62
|
+
head: ['ID', 'Name', 'Status', 'Created'],
|
|
63
|
+
});
|
|
64
|
+
branches.forEach((branch) => {
|
|
65
|
+
table.push([
|
|
66
|
+
{ rowSpan: 1, content: branch.id, vAlign: 'center' },
|
|
67
|
+
{ rowSpan: 1, content: branch.name, vAlign: 'center' },
|
|
68
|
+
{
|
|
69
|
+
rowSpan: 1,
|
|
70
|
+
content: branch.status,
|
|
71
|
+
vAlign: 'center',
|
|
72
|
+
hAlign: 'center',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
rowSpan: 1,
|
|
76
|
+
content: moment.utc(branch.created_time).format(constants_1.ListTimeFormat),
|
|
77
|
+
vAlign: 'center',
|
|
78
|
+
},
|
|
79
|
+
]);
|
|
80
|
+
});
|
|
81
|
+
loggingProvider_1.logger.info(table.toString());
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
|
|
4
|
+
const util_1 = require("../../commandUtil/util");
|
|
5
|
+
const branches_1 = require("../../commandUtil/branches");
|
|
6
|
+
const describe_1 = require("../../commandUtil/describe");
|
|
7
|
+
const constants_1 = require("../../constants");
|
|
8
|
+
const CommandArgFrom = 'from';
|
|
9
|
+
const CommandArgTo = 'to';
|
|
10
|
+
exports.command = 'merge';
|
|
11
|
+
exports.describe = 'Merge mabl branches';
|
|
12
|
+
exports.builder = (yargs) => {
|
|
13
|
+
yargs
|
|
14
|
+
.option(CommandArgFrom, {
|
|
15
|
+
alias: constants_1.CommandArgAliases.BranchFrom,
|
|
16
|
+
describe: 'Name of the mabl branch to merge from',
|
|
17
|
+
type: 'string',
|
|
18
|
+
demand: `a mabl from branch [--${CommandArgFrom}] is required`,
|
|
19
|
+
nargs: 1,
|
|
20
|
+
})
|
|
21
|
+
.option(CommandArgTo, {
|
|
22
|
+
alias: constants_1.CommandArgAliases.BranchTo,
|
|
23
|
+
describe: 'Name of the mabl branch to merge to',
|
|
24
|
+
type: 'string',
|
|
25
|
+
default: 'master',
|
|
26
|
+
nargs: 1,
|
|
27
|
+
})
|
|
28
|
+
.option(constants_1.CommandArgOutput, {
|
|
29
|
+
alias: constants_1.CommandArgAliases.OutputType,
|
|
30
|
+
describe: 'Specify an output type for the branch data',
|
|
31
|
+
choices: constants_1.DefaultOutputFormatChoices,
|
|
32
|
+
})
|
|
33
|
+
.option(constants_1.CommandArgWorkspaceId, {
|
|
34
|
+
alias: constants_1.CommandArgAliases.WorkspaceId,
|
|
35
|
+
describe: 'The workspace ID to create a new branch',
|
|
36
|
+
nargs: 1,
|
|
37
|
+
type: 'string',
|
|
38
|
+
})
|
|
39
|
+
.check((argv) => {
|
|
40
|
+
const fromBranchName = argv[CommandArgFrom];
|
|
41
|
+
if (!(0, branches_1.isValidMablBranchName)(fromBranchName)) {
|
|
42
|
+
throw new Error(`[${fromBranchName}] is not a valid mabl branch name. Please specify a valid name`);
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
exports.handler = (0, util_1.failWrapper)(mergeBranch);
|
|
48
|
+
async function mergeBranch(parsed) {
|
|
49
|
+
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
50
|
+
const workspaceId = await (0, util_1.getWorkspaceId)(parsed);
|
|
51
|
+
const fromBranchName = parsed.from;
|
|
52
|
+
const toBranchName = parsed.to;
|
|
53
|
+
const branch = await apiClient.mergeBranch(workspaceId, fromBranchName, toBranchName);
|
|
54
|
+
(0, describe_1.outputEntity)(branch, parsed.output);
|
|
55
|
+
return branch.id;
|
|
56
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultBrowserProperties = exports.SupportedBrowserTypeProperties = exports.BrowserType = void 0;
|
|
4
|
+
var BrowserType;
|
|
5
|
+
(function (BrowserType) {
|
|
6
|
+
BrowserType["Chrome"] = "chrome";
|
|
7
|
+
BrowserType["Edge"] = "edge";
|
|
8
|
+
BrowserType["Firefox"] = "firefox";
|
|
9
|
+
BrowserType["Webkit"] = "webkit";
|
|
10
|
+
})(BrowserType || (exports.BrowserType = BrowserType = {}));
|
|
11
|
+
exports.SupportedBrowserTypeProperties = {
|
|
12
|
+
chrome: { browserName: 'chrome', browserReleaseChannel: 'chrome' },
|
|
13
|
+
edge: { browserName: 'edge', browserReleaseChannel: 'msedge' },
|
|
14
|
+
firefox: { browserName: 'firefox', browserReleaseChannel: 'firefox' },
|
|
15
|
+
webkit: {
|
|
16
|
+
browserName: 'webkit',
|
|
17
|
+
browserReleaseChannel: 'webkit',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
exports.DefaultBrowserProperties = exports.SupportedBrowserTypeProperties.chrome;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AwaitCompletion = exports.PollingOutcomeType = void 0;
|
|
4
|
+
var PollingOutcomeType;
|
|
5
|
+
(function (PollingOutcomeType) {
|
|
6
|
+
PollingOutcomeType[PollingOutcomeType["Queued"] = 0] = "Queued";
|
|
7
|
+
PollingOutcomeType[PollingOutcomeType["Running"] = 1] = "Running";
|
|
8
|
+
PollingOutcomeType[PollingOutcomeType["Terminated"] = 2] = "Terminated";
|
|
9
|
+
PollingOutcomeType[PollingOutcomeType["Complete"] = 3] = "Complete";
|
|
10
|
+
PollingOutcomeType[PollingOutcomeType["Timeout"] = 4] = "Timeout";
|
|
11
|
+
})(PollingOutcomeType || (exports.PollingOutcomeType = PollingOutcomeType = {}));
|
|
12
|
+
const completeStates = Object.freeze([
|
|
13
|
+
PollingOutcomeType.Complete,
|
|
14
|
+
PollingOutcomeType.Timeout,
|
|
15
|
+
]);
|
|
16
|
+
class AwaitCompletion {
|
|
17
|
+
constructor(apiClient, pollingTimeoutMilliseconds, pollingIntervalMilliseconds) {
|
|
18
|
+
this.apiClient = apiClient;
|
|
19
|
+
this.defaultPollingTimeoutMilliseconds = 10 * 60 * 1000;
|
|
20
|
+
this.defaultPollingIntervalMilliseconds = 1000;
|
|
21
|
+
this.pollingTimeoutMilliseconds =
|
|
22
|
+
pollingTimeoutMilliseconds || this.defaultPollingTimeoutMilliseconds;
|
|
23
|
+
this.pollingIntervalMilliseconds =
|
|
24
|
+
pollingIntervalMilliseconds || this.defaultPollingIntervalMilliseconds;
|
|
25
|
+
this.startedEpochMilliseconds = Date.now();
|
|
26
|
+
}
|
|
27
|
+
setPollingInterval(milliseconds) {
|
|
28
|
+
this.pollingIntervalMilliseconds = milliseconds;
|
|
29
|
+
}
|
|
30
|
+
isComplete(status) {
|
|
31
|
+
return completeStates.includes(status);
|
|
32
|
+
}
|
|
33
|
+
getElapsedMilliseconds() {
|
|
34
|
+
return Date.now() - this.startedEpochMilliseconds;
|
|
35
|
+
}
|
|
36
|
+
isTimedOut() {
|
|
37
|
+
const millisecondsElapsed = this.getElapsedMilliseconds();
|
|
38
|
+
return millisecondsElapsed >= this.pollingTimeoutMilliseconds;
|
|
39
|
+
}
|
|
40
|
+
async awaitCompletion(seedId) {
|
|
41
|
+
if (!seedId) {
|
|
42
|
+
throw new Error('Seed is undefined');
|
|
43
|
+
}
|
|
44
|
+
const pollingResult = await this.pollingFunction(this.apiClient, undefined, seedId);
|
|
45
|
+
this.statusPresenter(pollingResult.newEntity, pollingResult.status);
|
|
46
|
+
if (this.isTimedOut()) {
|
|
47
|
+
this.timeoutStatusPresenter(pollingResult.newEntity);
|
|
48
|
+
return {
|
|
49
|
+
newEntity: pollingResult.newEntity,
|
|
50
|
+
status: PollingOutcomeType.Timeout,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (this.isComplete(pollingResult.status)) {
|
|
54
|
+
this.completedStatusPresenter(pollingResult.newEntity);
|
|
55
|
+
return {
|
|
56
|
+
newEntity: pollingResult.newEntity,
|
|
57
|
+
status: PollingOutcomeType.Complete,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return new Promise((resolve, reject) => {
|
|
61
|
+
setTimeout(() => this.awaitCompletion(seedId)
|
|
62
|
+
.then((result) => resolve(result))
|
|
63
|
+
.catch((error) => reject(error)), this.pollingIntervalMilliseconds);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.AwaitCompletion = AwaitCompletion;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isValidMablBranchName = exports.crossCheckBranchWithTest = exports.printBranchRunningInfo = exports.checkBranchNameAndAutoBranchMaybe = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const loggingProvider_1 = require("../../providers/logging/loggingProvider");
|
|
6
|
+
const chalk = require('chalk');
|
|
7
|
+
async function checkBranchNameAndAutoBranchMaybe(workspaceId, apiClient, branchName, autoBranch) {
|
|
8
|
+
if (branchName) {
|
|
9
|
+
try {
|
|
10
|
+
await apiClient.getBranchByName(workspaceId, branchName);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
if (autoBranch) {
|
|
14
|
+
await apiClient.createBranch(workspaceId, branchName);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
loggingProvider_1.logger.error(chalk.red.bold(`mabl branch [${branchName}] does not exist.\n` +
|
|
18
|
+
'Please specify an existing branch or provide the [--auto-branch] argument to create a new branch'));
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.checkBranchNameAndAutoBranchMaybe = checkBranchNameAndAutoBranchMaybe;
|
|
25
|
+
function printBranchRunningInfo(branchName) {
|
|
26
|
+
loggingProvider_1.logger.info(chalk.yellow('Running test(s) on the', chalk.magenta(branchName), chalk.yellow('branch')));
|
|
27
|
+
}
|
|
28
|
+
exports.printBranchRunningInfo = printBranchRunningInfo;
|
|
29
|
+
function crossCheckBranchWithTest(branchName, test) {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
if (((_a = test.source_control_tags) === null || _a === void 0 ? void 0 : _a[branchName]) === undefined &&
|
|
32
|
+
((_b = test.source_control_tags) === null || _b === void 0 ? void 0 : _b[constants_1.DefaultBranchName]) === undefined) {
|
|
33
|
+
loggingProvider_1.logger.info(chalk.red('ERROR: Test does not exist on the branch:', chalk.magenta(branchName), 'Use the --mabl-branch flag to specify a branch'));
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.crossCheckBranchWithTest = crossCheckBranchWithTest;
|
|
38
|
+
function isValidMablBranchName(branchName) {
|
|
39
|
+
if (branchName) {
|
|
40
|
+
return /^[A-Za-z0-9._/-]+$/.test(branchName.trim());
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
exports.isValidMablBranchName = isValidMablBranchName;
|