@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,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sanitizeExportedVariables = exports.exportVariables = exports.convertVariablesSummaryToPostmanFormat = void 0;
|
|
4
|
+
const VariableUtils_1 = require("./VariableUtils");
|
|
5
|
+
const domUtil_1 = require("../../domUtil");
|
|
6
|
+
function convertVariablesSummaryToPostmanFormat(summary) {
|
|
7
|
+
const effectiveVariables = { ...summary.effective };
|
|
8
|
+
const values = Object.keys(effectiveVariables).map((key) => ({
|
|
9
|
+
key,
|
|
10
|
+
value: effectiveVariables[key],
|
|
11
|
+
}));
|
|
12
|
+
return {
|
|
13
|
+
values,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
exports.convertVariablesSummaryToPostmanFormat = convertVariablesSummaryToPostmanFormat;
|
|
17
|
+
function exportVariables(postmanResult) {
|
|
18
|
+
const variablePrecedence = [
|
|
19
|
+
postmanResult === null || postmanResult === void 0 ? void 0 : postmanResult.globals.values,
|
|
20
|
+
postmanResult === null || postmanResult === void 0 ? void 0 : postmanResult.collection.variables,
|
|
21
|
+
postmanResult === null || postmanResult === void 0 ? void 0 : postmanResult.environment.values,
|
|
22
|
+
].filter((variables) => !!variables);
|
|
23
|
+
const exportedVariables = {};
|
|
24
|
+
variablePrecedence
|
|
25
|
+
.map((variableList) => variableList.all())
|
|
26
|
+
.forEach((variables) => variables.forEach((variable) => (exportedVariables[variable.key] = variable.value)));
|
|
27
|
+
return exportedVariables;
|
|
28
|
+
}
|
|
29
|
+
exports.exportVariables = exportVariables;
|
|
30
|
+
function sanitizeExportedVariables(variables) {
|
|
31
|
+
const normalized = {};
|
|
32
|
+
if (variables) {
|
|
33
|
+
return normalizeExportedVariables(filterExportedVariables(variables));
|
|
34
|
+
}
|
|
35
|
+
return normalized;
|
|
36
|
+
}
|
|
37
|
+
exports.sanitizeExportedVariables = sanitizeExportedVariables;
|
|
38
|
+
function normalizeExportedVariables(variables) {
|
|
39
|
+
const normalized = {};
|
|
40
|
+
Object.keys(variables).forEach((name) => {
|
|
41
|
+
normalized[(0, VariableUtils_1.addUserNamespace)(name)] = variables[name];
|
|
42
|
+
});
|
|
43
|
+
return normalized;
|
|
44
|
+
}
|
|
45
|
+
function filterExportedVariables(variables) {
|
|
46
|
+
const filtered = {};
|
|
47
|
+
Object.keys(variables)
|
|
48
|
+
.filter((name) => (0, domUtil_1.isValidUserVariableName)(name))
|
|
49
|
+
.forEach((name) => {
|
|
50
|
+
filtered[name] = variables[name];
|
|
51
|
+
});
|
|
52
|
+
return filtered;
|
|
53
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isApiTestResult = exports.TestResultStatus = void 0;
|
|
4
|
+
var TestResultStatus;
|
|
5
|
+
(function (TestResultStatus) {
|
|
6
|
+
TestResultStatus["failed"] = "failed";
|
|
7
|
+
TestResultStatus["passed"] = "passed";
|
|
8
|
+
TestResultStatus["skipped"] = "skipped";
|
|
9
|
+
TestResultStatus["stopped"] = "stopped";
|
|
10
|
+
TestResultStatus["terminated"] = "terminated";
|
|
11
|
+
})(TestResultStatus || (exports.TestResultStatus = TestResultStatus = {}));
|
|
12
|
+
function isApiTestResult(result) {
|
|
13
|
+
return 'flowResults' in result;
|
|
14
|
+
}
|
|
15
|
+
exports.isApiTestResult = isApiTestResult;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findUsedVariables = exports.addUserNamespace = exports.generateVariablesSummaryForExport = exports.generateVariablesSummaryForImport = exports.API_CREDENTIALS_PASSWORD_VARIABLE_NAME = exports.API_CREDENTIALS_USERNAME_VARIABLE_NAME = exports.API_CREDENTIALS_NAMESPACE = exports.API_URL_VARIABLE_NAME = exports.API_NAMESPACE = exports.FLOW_NAMESPACE = exports.USER_NAMESPACE = void 0;
|
|
4
|
+
const domUtil_1 = require("../../domUtil");
|
|
5
|
+
exports.USER_NAMESPACE = 'user.';
|
|
6
|
+
exports.FLOW_NAMESPACE = 'flow.';
|
|
7
|
+
exports.API_NAMESPACE = 'api.';
|
|
8
|
+
exports.API_URL_VARIABLE_NAME = `${exports.API_NAMESPACE}url`;
|
|
9
|
+
exports.API_CREDENTIALS_NAMESPACE = `${exports.API_NAMESPACE}credentials.`;
|
|
10
|
+
exports.API_CREDENTIALS_USERNAME_VARIABLE_NAME = `${exports.API_CREDENTIALS_NAMESPACE}username`;
|
|
11
|
+
exports.API_CREDENTIALS_PASSWORD_VARIABLE_NAME = `${exports.API_CREDENTIALS_NAMESPACE}password`;
|
|
12
|
+
function generateVariablesSummaryForImport(variableSources) {
|
|
13
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
14
|
+
const { environment, scenario, url, credentials, plan, flow, journeyRun, previousFlowVariables, } = variableSources;
|
|
15
|
+
const summary = {
|
|
16
|
+
dataDriven: {},
|
|
17
|
+
effective: {},
|
|
18
|
+
environment: {},
|
|
19
|
+
flow: {},
|
|
20
|
+
journey: {},
|
|
21
|
+
parameters: {},
|
|
22
|
+
};
|
|
23
|
+
const environmentVariables = (environment === null || environment === void 0 ? void 0 : environment.variables) || {};
|
|
24
|
+
Object.keys(environmentVariables).forEach((key) => (summary.environment[removeUserNamespace(key)] =
|
|
25
|
+
environmentVariables[key]));
|
|
26
|
+
const planParameters = extractValueParameters(plan === null || plan === void 0 ? void 0 : plan.parameters);
|
|
27
|
+
planParameters.forEach((parameter) => (summary.parameters[removeUserNamespace(parameter.name)] =
|
|
28
|
+
parameter.value));
|
|
29
|
+
const journeyParameters = extractValueParameters(journeyRun &&
|
|
30
|
+
(plan === null || plan === void 0 ? void 0 : plan.execution_stages) &&
|
|
31
|
+
((_c = (_b = (_a = plan.execution_stages[journeyRun.stage_index]) === null || _a === void 0 ? void 0 : _a.journeys) === null || _b === void 0 ? void 0 : _b.find((journey) => journey.journey_id)) === null || _c === void 0 ? void 0 : _c.parameters));
|
|
32
|
+
journeyParameters.forEach((parameter) => (summary.parameters[removeUserNamespace(parameter.name)] =
|
|
33
|
+
parameter.value));
|
|
34
|
+
const journeyInputs = ((_d = journeyRun === null || journeyRun === void 0 ? void 0 : journeyRun.journey_parameters) === null || _d === void 0 ? void 0 : _d.imported_variables) || {};
|
|
35
|
+
Object.keys(journeyInputs).forEach((key) => (summary.journey[removeUserNamespace(key)] = journeyInputs[key]));
|
|
36
|
+
const ddtVariables = ((_f = (_e = journeyRun === null || journeyRun === void 0 ? void 0 : journeyRun.journey_parameters) === null || _e === void 0 ? void 0 : _e.user_variables) === null || _f === void 0 ? void 0 : _f.row) ||
|
|
37
|
+
(scenario === null || scenario === void 0 ? void 0 : scenario.variables) ||
|
|
38
|
+
[];
|
|
39
|
+
ddtVariables.forEach((variable) => (summary.dataDriven[removeUserNamespace(variable.name)] =
|
|
40
|
+
variable.value));
|
|
41
|
+
const precedence = [
|
|
42
|
+
summary.environment,
|
|
43
|
+
summary.parameters,
|
|
44
|
+
summary.journey,
|
|
45
|
+
summary.dataDriven,
|
|
46
|
+
];
|
|
47
|
+
precedence.forEach((variables) => Object.keys(variables).forEach((name) => (summary.effective[name] = variables[name])));
|
|
48
|
+
if (flow === null || flow === void 0 ? void 0 : flow.parameters) {
|
|
49
|
+
flow.parameters.forEach((parameter) => {
|
|
50
|
+
const parameterName = removePrefix(parameter.name, exports.FLOW_NAMESPACE);
|
|
51
|
+
summary.flow[parameterName] = parameter.default_value;
|
|
52
|
+
if (!summary.effective[parameterName]) {
|
|
53
|
+
summary.effective[parameterName] = parameter.default_value;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const exportedVariables = previousFlowVariables || {};
|
|
58
|
+
Object.keys(exportedVariables).forEach((key) => {
|
|
59
|
+
summary.dataDriven[key] = exportedVariables[key];
|
|
60
|
+
summary.effective[key] = exportedVariables[key];
|
|
61
|
+
});
|
|
62
|
+
if (url) {
|
|
63
|
+
summary.effective[exports.API_URL_VARIABLE_NAME] = url;
|
|
64
|
+
}
|
|
65
|
+
if (credentials) {
|
|
66
|
+
summary.effective[exports.API_CREDENTIALS_USERNAME_VARIABLE_NAME] =
|
|
67
|
+
(_g = credentials.properties) === null || _g === void 0 ? void 0 : _g.username;
|
|
68
|
+
summary.effective[exports.API_CREDENTIALS_PASSWORD_VARIABLE_NAME] =
|
|
69
|
+
(_h = credentials.properties) === null || _h === void 0 ? void 0 : _h.password;
|
|
70
|
+
}
|
|
71
|
+
return summary;
|
|
72
|
+
}
|
|
73
|
+
exports.generateVariablesSummaryForImport = generateVariablesSummaryForImport;
|
|
74
|
+
function generateVariablesSummaryForExport(testContext, plan, flow, journeyRun, exportedVariables) {
|
|
75
|
+
return normalizeVariablesSummaryForExport(generateVariablesSummaryForImport({
|
|
76
|
+
environment: testContext.environment,
|
|
77
|
+
url: testContext.url,
|
|
78
|
+
credentials: testContext.credentials,
|
|
79
|
+
scenario: testContext.getScenario(),
|
|
80
|
+
plan,
|
|
81
|
+
flow,
|
|
82
|
+
journeyRun,
|
|
83
|
+
previousFlowVariables: exportedVariables,
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
exports.generateVariablesSummaryForExport = generateVariablesSummaryForExport;
|
|
87
|
+
function normalizeVariablesSummaryForExport(summary) {
|
|
88
|
+
return {
|
|
89
|
+
dataDriven: addUserNamespaceToVariableNames(sanitizeVariables(summary.dataDriven)),
|
|
90
|
+
effective: sanitizeVariables(summary.effective),
|
|
91
|
+
environment: addUserNamespaceToVariableNames(sanitizeVariables(summary.environment)),
|
|
92
|
+
flow: addPrefixToVariableNames(sanitizeVariables(summary.flow), exports.FLOW_NAMESPACE),
|
|
93
|
+
journey: addUserNamespaceToVariableNames(sanitizeVariables(summary.journey)),
|
|
94
|
+
parameters: addUserNamespaceToVariableNames(sanitizeVariables(summary.parameters)),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function sanitizeVariables(variables) {
|
|
98
|
+
const sanitizedVariables = {};
|
|
99
|
+
Object.keys(variables)
|
|
100
|
+
.filter((name) => (0, domUtil_1.isValidUserVariableName)(name))
|
|
101
|
+
.forEach((name) => (sanitizedVariables[name] = variables[name]));
|
|
102
|
+
return sanitizedVariables;
|
|
103
|
+
}
|
|
104
|
+
function addUserNamespaceToVariableNames(variables) {
|
|
105
|
+
return addPrefixToVariableNames(variables, exports.USER_NAMESPACE);
|
|
106
|
+
}
|
|
107
|
+
function addPrefixToVariableNames(variables, prefix) {
|
|
108
|
+
return mapVariables(variables, (variable) => ({
|
|
109
|
+
name: addPrefix(variable.name, prefix),
|
|
110
|
+
value: variable.value,
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
function mapVariables(variables, mapper) {
|
|
114
|
+
const mappedVariables = {};
|
|
115
|
+
Object.keys(variables)
|
|
116
|
+
.map((name) => mapper({ name, value: variables[name] }))
|
|
117
|
+
.forEach((variable) => (mappedVariables[variable.name] = variable.value));
|
|
118
|
+
return mappedVariables;
|
|
119
|
+
}
|
|
120
|
+
function extractValueParameters(parameters) {
|
|
121
|
+
if (!parameters) {
|
|
122
|
+
return [];
|
|
123
|
+
}
|
|
124
|
+
return parameters.filter((parameter) => { var _a; return ((_a = parameter.type) === null || _a === void 0 ? void 0 : _a.toString()) === 'value'; });
|
|
125
|
+
}
|
|
126
|
+
function removeUserNamespace(variableName) {
|
|
127
|
+
return removePrefix(variableName, exports.USER_NAMESPACE);
|
|
128
|
+
}
|
|
129
|
+
function removePrefix(variableName, prefix) {
|
|
130
|
+
if (variableName.startsWith(prefix)) {
|
|
131
|
+
return variableName.substring(prefix.length);
|
|
132
|
+
}
|
|
133
|
+
return variableName;
|
|
134
|
+
}
|
|
135
|
+
function addUserNamespace(variableName) {
|
|
136
|
+
return addPrefix(variableName, exports.USER_NAMESPACE);
|
|
137
|
+
}
|
|
138
|
+
exports.addUserNamespace = addUserNamespace;
|
|
139
|
+
function addPrefix(variableName, prefix) {
|
|
140
|
+
if (variableName.startsWith(prefix)) {
|
|
141
|
+
return variableName;
|
|
142
|
+
}
|
|
143
|
+
return `${prefix}${variableName}`;
|
|
144
|
+
}
|
|
145
|
+
function findUsedVariables(collection, variableNames) {
|
|
146
|
+
const collectionSubset = {
|
|
147
|
+
auth: collection.auth,
|
|
148
|
+
item: collection.item,
|
|
149
|
+
event: collection.event,
|
|
150
|
+
};
|
|
151
|
+
const collectionAsJson = JSON.stringify(collectionSubset);
|
|
152
|
+
return variableNames.filter((variableName) => collectionAsJson.includes(variableName));
|
|
153
|
+
}
|
|
154
|
+
exports.findUsedVariables = findUsedVariables;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BodyMode = exports.MablSupportedPostmanAuthTypes = exports.SUPPORTED_COLLECTION_SCHEMA = exports.AssertionType = exports.AssertionTarget = void 0;
|
|
4
|
+
var AssertionTarget;
|
|
5
|
+
(function (AssertionTarget) {
|
|
6
|
+
AssertionTarget["Header"] = "Header";
|
|
7
|
+
AssertionTarget["JSONBody"] = "JSONBody";
|
|
8
|
+
AssertionTarget["Size"] = "Size";
|
|
9
|
+
AssertionTarget["Status"] = "Status";
|
|
10
|
+
})(AssertionTarget || (exports.AssertionTarget = AssertionTarget = {}));
|
|
11
|
+
var AssertionType;
|
|
12
|
+
(function (AssertionType) {
|
|
13
|
+
AssertionType["Contains"] = "Contains";
|
|
14
|
+
AssertionType["DoesNotContain"] = "DoesNotContain";
|
|
15
|
+
AssertionType["EndsWith"] = "EndsWith";
|
|
16
|
+
AssertionType["Equals"] = "Equals";
|
|
17
|
+
AssertionType["GreaterThan"] = "GreaterThan";
|
|
18
|
+
AssertionType["GreaterThanOrEqualTo"] = "GreaterThanOrEqualTo";
|
|
19
|
+
AssertionType["LessThan"] = "LessThan";
|
|
20
|
+
AssertionType["LessThanOrEqualTo"] = "LessThanOrEqualTo";
|
|
21
|
+
AssertionType["MatchesRegExp"] = "MatchesRegExp";
|
|
22
|
+
AssertionType["NotEquals"] = "NotEquals";
|
|
23
|
+
AssertionType["NotPresent"] = "NotPresent";
|
|
24
|
+
AssertionType["Present"] = "Present";
|
|
25
|
+
AssertionType["StartsWith"] = "StartsWith";
|
|
26
|
+
})(AssertionType || (exports.AssertionType = AssertionType = {}));
|
|
27
|
+
exports.SUPPORTED_COLLECTION_SCHEMA = 'https://schema.getpostman.com/json/collection/v2.1.0/collection.json';
|
|
28
|
+
exports.MablSupportedPostmanAuthTypes = [
|
|
29
|
+
'apikey',
|
|
30
|
+
'basic',
|
|
31
|
+
'bearer',
|
|
32
|
+
'oauth1',
|
|
33
|
+
];
|
|
34
|
+
var BodyMode;
|
|
35
|
+
(function (BodyMode) {
|
|
36
|
+
BodyMode["file"] = "file";
|
|
37
|
+
BodyMode["formdata"] = "formdata";
|
|
38
|
+
BodyMode["graphql"] = "graphql";
|
|
39
|
+
BodyMode["none"] = "none";
|
|
40
|
+
BodyMode["raw"] = "raw";
|
|
41
|
+
BodyMode["urlencoded"] = "urlencoded";
|
|
42
|
+
})(BodyMode || (exports.BodyMode = BodyMode = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MobileTrainingActionsEventEmitter = exports.MobileTrainingMessageType = void 0;
|
|
4
|
+
const messaging_1 = require("../messaging");
|
|
5
|
+
var MobileTrainingMessageType;
|
|
6
|
+
(function (MobileTrainingMessageType) {
|
|
7
|
+
MobileTrainingMessageType["foundElement"] = "mobileFoundElement";
|
|
8
|
+
})(MobileTrainingMessageType || (exports.MobileTrainingMessageType = MobileTrainingMessageType = {}));
|
|
9
|
+
class MobileTrainingActionsEventEmitter {
|
|
10
|
+
static emitFoundElementInfo(foundElement, isACandidateElement) {
|
|
11
|
+
return messaging_1.mablEventEmitter.dispatch(new messaging_1.MablCoreAction(MobileTrainingMessageType.foundElement, {
|
|
12
|
+
boundingBox: foundElement.boundingBox,
|
|
13
|
+
isACandidateElement,
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.MobileTrainingActionsEventEmitter = MobileTrainingActionsEventEmitter;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PdfEventEmitter = exports.PdfActionMessageType = void 0;
|
|
4
|
+
const messaging_1 = require("../messaging");
|
|
5
|
+
var PdfActionMessageType;
|
|
6
|
+
(function (PdfActionMessageType) {
|
|
7
|
+
PdfActionMessageType["EmbeddedPdfDownloading"] = "EMBEDDED_PDF_DOWNLOADING";
|
|
8
|
+
PdfActionMessageType["EmbeddedPdfViewerReady"] = "EMBEDDED_PDF_VIEWER_READY";
|
|
9
|
+
})(PdfActionMessageType || (exports.PdfActionMessageType = PdfActionMessageType = {}));
|
|
10
|
+
class PdfEventEmitter {
|
|
11
|
+
static embeddedPdfDownloading(frameId, pdfFileName, pdfUrl) {
|
|
12
|
+
PdfEventEmitter.eventEmitter.dispatch(new messaging_1.MablCoreAction(PdfActionMessageType.EmbeddedPdfDownloading, {
|
|
13
|
+
frameId,
|
|
14
|
+
pdfFileName,
|
|
15
|
+
pdfUrl,
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
static embeddedPdfViewerReady(frameId, pdfFileName, pdfUrl) {
|
|
19
|
+
PdfEventEmitter.eventEmitter.dispatch(new messaging_1.MablCoreAction(PdfActionMessageType.EmbeddedPdfViewerReady, {
|
|
20
|
+
frameId,
|
|
21
|
+
pdfFileName,
|
|
22
|
+
pdfUrl,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.PdfEventEmitter = PdfEventEmitter;
|
|
27
|
+
PdfEventEmitter.eventEmitter = messaging_1.mablEventEmitter;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RunnerActionEventEmitter = exports.RunnerActionMessageTypes = void 0;
|
|
4
|
+
const messaging_1 = require("../messaging");
|
|
5
|
+
var RunnerActionMessageTypes;
|
|
6
|
+
(function (RunnerActionMessageTypes) {
|
|
7
|
+
RunnerActionMessageTypes["RUNNER_STOP"] = "RUNNER_STOP";
|
|
8
|
+
RunnerActionMessageTypes["RUNNER_TERMINATE"] = "RUNNER_TERMINATE";
|
|
9
|
+
})(RunnerActionMessageTypes || (exports.RunnerActionMessageTypes = RunnerActionMessageTypes = {}));
|
|
10
|
+
class RunnerActionEventEmitter {
|
|
11
|
+
static stopRunningTest(eventEmitter) {
|
|
12
|
+
(0, messaging_1.getEmitter)(eventEmitter).sendToProcess(new messaging_1.MablCoreProcessAction(RunnerActionMessageTypes.RUNNER_STOP, {}));
|
|
13
|
+
}
|
|
14
|
+
static killRunningTest(eventEmitter) {
|
|
15
|
+
(0, messaging_1.getEmitter)(eventEmitter).sendToProcess(new messaging_1.MablCoreProcessAction(RunnerActionMessageTypes.RUNNER_TERMINATE, {}));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.RunnerActionEventEmitter = RunnerActionEventEmitter;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TrainingEventEmitter = exports.TrainingSessionMessageType = void 0;
|
|
4
|
+
const messaging_1 = require("../messaging");
|
|
5
|
+
var TrainingSessionMessageType;
|
|
6
|
+
(function (TrainingSessionMessageType) {
|
|
7
|
+
TrainingSessionMessageType["closed"] = "TRAINING_SESSION_CLOSED";
|
|
8
|
+
TrainingSessionMessageType["error"] = "TRAINING_SESSION_ERROR";
|
|
9
|
+
TrainingSessionMessageType["initializing"] = "TRAINING_SESSION_INITIALIZING";
|
|
10
|
+
TrainingSessionMessageType["saved"] = "TRAINING_SESSION_SAVED";
|
|
11
|
+
TrainingSessionMessageType["started"] = "TRAINING_SESSION_STARTED";
|
|
12
|
+
})(TrainingSessionMessageType || (exports.TrainingSessionMessageType = TrainingSessionMessageType = {}));
|
|
13
|
+
class TrainingEventEmitter {
|
|
14
|
+
static sessionInitializing() {
|
|
15
|
+
messaging_1.mablEventEmitter.dispatch(new messaging_1.MablCoreAction(TrainingSessionMessageType.initializing, {}));
|
|
16
|
+
}
|
|
17
|
+
static sessionStarted() {
|
|
18
|
+
messaging_1.mablEventEmitter.dispatch(new messaging_1.MablCoreAction(TrainingSessionMessageType.started, {}));
|
|
19
|
+
}
|
|
20
|
+
static sessionError(errorMessage) {
|
|
21
|
+
messaging_1.mablEventEmitter.dispatch(new messaging_1.MablCoreAction(TrainingSessionMessageType.error, {
|
|
22
|
+
errorMessage,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
static sessionSaved(testId, testInvariantId, branchName, planId) {
|
|
26
|
+
const actionPayload = {
|
|
27
|
+
testId,
|
|
28
|
+
testInvariantId,
|
|
29
|
+
planId,
|
|
30
|
+
branchName,
|
|
31
|
+
};
|
|
32
|
+
messaging_1.mablEventEmitter.dispatch(new messaging_1.MablCoreAction(TrainingSessionMessageType.saved, actionPayload));
|
|
33
|
+
}
|
|
34
|
+
static sessionClosed() {
|
|
35
|
+
messaging_1.mablEventEmitter.dispatch(new messaging_1.MablCoreAction(TrainingSessionMessageType.closed, {}));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.TrainingEventEmitter = TrainingEventEmitter;
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
exports.registerConsoleLoggerForOutput = exports.LogLineColor = void 0;
|
|
7
|
+
const messaging_1 = require("./messaging");
|
|
8
|
+
const moment = require("moment");
|
|
9
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
+
const env_1 = require("../../env/env");
|
|
11
|
+
const loggingProvider_1 = require("../../providers/logging/loggingProvider");
|
|
12
|
+
var LogLineColor;
|
|
13
|
+
(function (LogLineColor) {
|
|
14
|
+
LogLineColor["cyan"] = "cyan";
|
|
15
|
+
LogLineColor["magenta"] = "magenta";
|
|
16
|
+
LogLineColor["red"] = "red";
|
|
17
|
+
LogLineColor["white"] = "white";
|
|
18
|
+
LogLineColor["yellow"] = "yellow";
|
|
19
|
+
})(LogLineColor || (exports.LogLineColor = LogLineColor = {}));
|
|
20
|
+
function registerConsoleLoggerForOutput(eventEmitter) {
|
|
21
|
+
eventEmitter
|
|
22
|
+
.getOutputEventChannel()
|
|
23
|
+
.on(messaging_1.EventChannelMessageType.outputLogLine, (line, timestamp, color, metadata) => {
|
|
24
|
+
var _a;
|
|
25
|
+
const stepNumberPrefix = (_a = metadata === null || metadata === void 0 ? void 0 : metadata.stepNumberPrefix) !== null && _a !== void 0 ? _a : '';
|
|
26
|
+
const lineWithPrefix = stepNumberPrefix + line;
|
|
27
|
+
const formatted = color ? chalk_1.default[color](lineWithPrefix) : lineWithPrefix;
|
|
28
|
+
if ((metadata === null || metadata === void 0 ? void 0 : metadata.shouldOutputInConsole) === false) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (timestamp) {
|
|
32
|
+
let formattedTimestamp = '';
|
|
33
|
+
formattedTimestamp = `${moment
|
|
34
|
+
.unix(timestamp / 1000)
|
|
35
|
+
.format('LTS')} - `;
|
|
36
|
+
loggingProvider_1.logger.info(`${chalk_1.default.yellow(formattedTimestamp)}${formatted}`);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
loggingProvider_1.logger.info(formatted);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
if (env_1.ENV === 'local' && env_1.DEBUG_EVENT_EMITTER) {
|
|
43
|
+
eventEmitter
|
|
44
|
+
.getOutputEventChannel()
|
|
45
|
+
.on(messaging_1.EventChannelMessageType.coreAction, (action) => {
|
|
46
|
+
loggingProvider_1.logger.info(action);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.registerConsoleLoggerForOutput = registerConsoleLoggerForOutput;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.createAssertResultMessage = exports.createAssertFailureMessage = exports.getDefaultLogMetadataForInfo = exports.MablCoreProcessAction = exports.MablCoreAction = exports.ObservationErrorSeverity = exports.ObservationErrorCode = exports.ExecutionPhase = exports.EventChannelMessageType = exports.getEmitter = exports.mablEventEmitter = exports.MablCoreEventEmitter = void 0;
|
|
5
|
+
const events_1 = require("events");
|
|
6
|
+
const loggingProvider_1 = require("../../providers/logging/loggingProvider");
|
|
7
|
+
const pureUtil_1 = require("../../util/pureUtil");
|
|
8
|
+
const NO_ID_PLACEHOLDER = 'NO_ID_PROVIDED';
|
|
9
|
+
class MablCoreEventEmitter {
|
|
10
|
+
constructor(debug) {
|
|
11
|
+
this.messageIndex = -1;
|
|
12
|
+
this.outputEventChannel = new events_1.EventEmitter();
|
|
13
|
+
this.inputEventChannel = new events_1.EventEmitter();
|
|
14
|
+
this.debugOutputOn = debug !== null && debug !== void 0 ? debug : false;
|
|
15
|
+
}
|
|
16
|
+
getOutputEventChannel() {
|
|
17
|
+
return this.outputEventChannel;
|
|
18
|
+
}
|
|
19
|
+
getInputEventChannel() {
|
|
20
|
+
return this.inputEventChannel;
|
|
21
|
+
}
|
|
22
|
+
getNextMessageIndex() {
|
|
23
|
+
this.messageIndex += 1;
|
|
24
|
+
return this.messageIndex;
|
|
25
|
+
}
|
|
26
|
+
dispatch(action, metadata) {
|
|
27
|
+
this.outputEventChannel.emit(EventChannelMessageType.coreAction, action, metadata);
|
|
28
|
+
}
|
|
29
|
+
sendToProcess(action) {
|
|
30
|
+
this.inputEventChannel.emit(EventChannelMessageType.coreProcessAction, action);
|
|
31
|
+
}
|
|
32
|
+
log(line, timestamp, color, metadata) {
|
|
33
|
+
this.outputEventChannel.emit(EventChannelMessageType.outputLogLine, line, timestamp, color, metadata);
|
|
34
|
+
}
|
|
35
|
+
debug(line, timestamp, color, metadata) {
|
|
36
|
+
const effectiveMetadata = metadata !== null && metadata !== void 0 ? metadata : {
|
|
37
|
+
logLevel: loggingProvider_1.LogLevel.Debug,
|
|
38
|
+
timestamp: Date.now(),
|
|
39
|
+
};
|
|
40
|
+
this.log(line, timestamp, color, {
|
|
41
|
+
...effectiveMetadata,
|
|
42
|
+
shouldOutputInConsole: this.debugOutputOn,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.MablCoreEventEmitter = MablCoreEventEmitter;
|
|
47
|
+
global.mablEventEmitter = (_a = global.mablEventEmitter) !== null && _a !== void 0 ? _a : new MablCoreEventEmitter();
|
|
48
|
+
exports.mablEventEmitter = global.mablEventEmitter;
|
|
49
|
+
function getEmitter(eventEmitter) {
|
|
50
|
+
return eventEmitter !== null && eventEmitter !== void 0 ? eventEmitter : exports.mablEventEmitter;
|
|
51
|
+
}
|
|
52
|
+
exports.getEmitter = getEmitter;
|
|
53
|
+
var EventChannelMessageType;
|
|
54
|
+
(function (EventChannelMessageType) {
|
|
55
|
+
EventChannelMessageType["coreAction"] = "coreAction";
|
|
56
|
+
EventChannelMessageType["coreProcessAction"] = "coreProcessAction";
|
|
57
|
+
EventChannelMessageType["outputLogLine"] = "outputLogLine";
|
|
58
|
+
})(EventChannelMessageType || (exports.EventChannelMessageType = EventChannelMessageType = {}));
|
|
59
|
+
var ExecutionPhase;
|
|
60
|
+
(function (ExecutionPhase) {
|
|
61
|
+
ExecutionPhase["AFTER_ACTION"] = "AFTER_ACTION";
|
|
62
|
+
ExecutionPhase["AFTER_DEFERRED_ACTION"] = "AFTER_DEFERRED_ACTION";
|
|
63
|
+
ExecutionPhase["AFTER_FLOW"] = "AFTER_FLOW";
|
|
64
|
+
ExecutionPhase["AFTER_TEST"] = "AFTER_TEST";
|
|
65
|
+
ExecutionPhase["ASYNC"] = "ASYNC";
|
|
66
|
+
ExecutionPhase["BEFORE_ACTION"] = "BEFORE_ACTION";
|
|
67
|
+
ExecutionPhase["BEFORE_FLOW"] = "BEFORE_FLOW";
|
|
68
|
+
ExecutionPhase["BEFORE_TEST"] = "BEFORE_TEST";
|
|
69
|
+
ExecutionPhase["DURING_ACTION"] = "DURING_ACTION";
|
|
70
|
+
ExecutionPhase["SKIP_ACTION"] = "SKIP_ACTION";
|
|
71
|
+
})(ExecutionPhase || (exports.ExecutionPhase = ExecutionPhase = {}));
|
|
72
|
+
var ObservationErrorCode;
|
|
73
|
+
(function (ObservationErrorCode) {
|
|
74
|
+
ObservationErrorCode["ILLEGAL_URL_ERROR"] = "ILLEGAL_URL_ERROR";
|
|
75
|
+
ObservationErrorCode["PAGE_LOAD_FAILURE"] = "PAGE_LOAD_FAILURE";
|
|
76
|
+
})(ObservationErrorCode || (exports.ObservationErrorCode = ObservationErrorCode = {}));
|
|
77
|
+
var ObservationErrorSeverity;
|
|
78
|
+
(function (ObservationErrorSeverity) {
|
|
79
|
+
ObservationErrorSeverity["ERROR"] = "ERROR";
|
|
80
|
+
ObservationErrorSeverity["WARN"] = "WARN";
|
|
81
|
+
})(ObservationErrorSeverity || (exports.ObservationErrorSeverity = ObservationErrorSeverity = {}));
|
|
82
|
+
class MablCoreAction {
|
|
83
|
+
constructor(type, payload, timestamp = Date.now()) {
|
|
84
|
+
this.type = type;
|
|
85
|
+
this.payload = payload;
|
|
86
|
+
this.timestamp = timestamp;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.MablCoreAction = MablCoreAction;
|
|
90
|
+
class MablCoreProcessAction extends MablCoreAction {
|
|
91
|
+
}
|
|
92
|
+
exports.MablCoreProcessAction = MablCoreProcessAction;
|
|
93
|
+
function getDefaultLogMetadataForInfo(testId, testInvariantId) {
|
|
94
|
+
return {
|
|
95
|
+
executionIndex: {
|
|
96
|
+
testId: testId !== null && testId !== void 0 ? testId : NO_ID_PLACEHOLDER,
|
|
97
|
+
testInvariantId: testInvariantId !== null && testInvariantId !== void 0 ? testInvariantId : NO_ID_PLACEHOLDER,
|
|
98
|
+
},
|
|
99
|
+
executionPhase: ExecutionPhase.BEFORE_TEST,
|
|
100
|
+
logLevel: loggingProvider_1.LogLevel.Info,
|
|
101
|
+
timestamp: Date.now(),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
exports.getDefaultLogMetadataForInfo = getDefaultLogMetadataForInfo;
|
|
105
|
+
function createAssertFailureMessage(assertFailure) {
|
|
106
|
+
if (assertFailure) {
|
|
107
|
+
const { reason, expected, found, onFailure, shortReason } = assertFailure;
|
|
108
|
+
return {
|
|
109
|
+
reason,
|
|
110
|
+
shortReason,
|
|
111
|
+
expected: (0, pureUtil_1.stringifyIfPresent)(expected),
|
|
112
|
+
found: (0, pureUtil_1.stringifyIfPresent)(found),
|
|
113
|
+
onFailure,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
exports.createAssertFailureMessage = createAssertFailureMessage;
|
|
119
|
+
function createAssertResultMessage(assertResult) {
|
|
120
|
+
if (assertResult) {
|
|
121
|
+
const { success, assertionCriteria } = assertResult;
|
|
122
|
+
return {
|
|
123
|
+
success,
|
|
124
|
+
assertionCriteria,
|
|
125
|
+
...createAssertFailureMessage(assertResult),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
exports.createAssertResultMessage = createAssertResultMessage;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WEB_PERFORMANCE_METRIC_DETECTED_MESSAGE_TYPE = exports.EmbeddedPdfDetectionEvents = void 0;
|
|
4
|
+
var EmbeddedPdfDetectionEvents;
|
|
5
|
+
(function (EmbeddedPdfDetectionEvents) {
|
|
6
|
+
EmbeddedPdfDetectionEvents["EmbeddedPdfDetected"] = "EMBEDDED_PDF_DETECTED";
|
|
7
|
+
EmbeddedPdfDetectionEvents["EmbeddedPdfMarked"] = "EMBEDDED_PDF_MARKED";
|
|
8
|
+
})(EmbeddedPdfDetectionEvents || (exports.EmbeddedPdfDetectionEvents = EmbeddedPdfDetectionEvents = {}));
|
|
9
|
+
exports.WEB_PERFORMANCE_METRIC_DETECTED_MESSAGE_TYPE = 'WEB_PERFORMANCE_METRIC_DETECTED';
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
exports.logSessionStarted = exports.openUrlInDesktopApp = void 0;
|
|
7
|
+
const open_1 = __importDefault(require("open"));
|
|
8
|
+
const env_1 = require("../../env/env");
|
|
9
|
+
const timers_1 = require("timers");
|
|
10
|
+
const messaging_1 = require("../messaging/messaging");
|
|
11
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
12
|
+
const encodingUtil_1 = require("../../util/encodingUtil");
|
|
13
|
+
async function openUrlInDesktopApp(url, trainingSessionOptions) {
|
|
14
|
+
const params = (0, encodingUtil_1.encodeTestConfigAsParamsForParsedUrlProtocol)(trainingSessionOptions, encodingUtil_1.b64EncodeUnicodeInNode);
|
|
15
|
+
const childProcess = await (0, open_1.default)(`${env_1.ELECTRON_PROTOCOL}://${url}/${params}`);
|
|
16
|
+
let childProcessExited = false;
|
|
17
|
+
const keepAliveUntilExited = () => {
|
|
18
|
+
if (!childProcessExited) {
|
|
19
|
+
(0, timers_1.setTimeout)(keepAliveUntilExited, 1000);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
keepAliveUntilExited();
|
|
23
|
+
const exitCode = await new Promise((resolve) => {
|
|
24
|
+
childProcess.on('error', () => {
|
|
25
|
+
childProcessExited = true;
|
|
26
|
+
resolve(1);
|
|
27
|
+
});
|
|
28
|
+
childProcess.on('exit', function () {
|
|
29
|
+
childProcessExited = true;
|
|
30
|
+
resolve(childProcess.exitCode);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
if (exitCode === 0) {
|
|
34
|
+
logSessionStarted();
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
logInstallDesktopApp();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.openUrlInDesktopApp = openUrlInDesktopApp;
|
|
41
|
+
function logSessionStarted() {
|
|
42
|
+
messaging_1.mablEventEmitter.log(chalk_1.default.yellowBright('Session started in the desktop app'));
|
|
43
|
+
}
|
|
44
|
+
exports.logSessionStarted = logSessionStarted;
|
|
45
|
+
function logInstallDesktopApp() {
|
|
46
|
+
messaging_1.mablEventEmitter.log(chalk_1.default.red(`\nFailed to launch mabl desktop app!`, chalk_1.default.cyan(`\nPlease check your installation or download and install it from`), chalk_1.default.magenta('https://www.mabl.com/desktop-app')));
|
|
47
|
+
}
|