@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,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.LocalTestOutputWriter = void 0;
|
|
30
|
+
const fs = __importStar(require("fs"));
|
|
31
|
+
const CloudStorageWriter_1 = __importDefault(require("./CloudStorageWriter"));
|
|
32
|
+
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
33
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
34
|
+
const path_1 = __importDefault(require("path"));
|
|
35
|
+
const EXECUTION_OUTPUT_PATH_PREFIX = 'execution-output';
|
|
36
|
+
const MAX_PATH_LENGTH = 1024;
|
|
37
|
+
class LocalTestOutputWriter {
|
|
38
|
+
constructor(outputDir) {
|
|
39
|
+
this.outputDir = outputDir;
|
|
40
|
+
}
|
|
41
|
+
write(name, _contentType, data) {
|
|
42
|
+
const localPath = `${this.outputDir}/${name}`;
|
|
43
|
+
this.maybeCreateDirectory(localPath);
|
|
44
|
+
fs.writeFileSync(localPath, data);
|
|
45
|
+
return Promise.resolve(localPath);
|
|
46
|
+
}
|
|
47
|
+
writeObjectAsJson(name, data, replacer, reviver) {
|
|
48
|
+
const localPath = `${this.outputDir}/${name}`;
|
|
49
|
+
this.maybeCreateDirectory(localPath);
|
|
50
|
+
if (replacer || reviver) {
|
|
51
|
+
data = JSON.parse(JSON.stringify(data, replacer), reviver);
|
|
52
|
+
}
|
|
53
|
+
fs.writeFileSync(localPath, JSON.stringify(data));
|
|
54
|
+
return Promise.resolve(localPath);
|
|
55
|
+
}
|
|
56
|
+
maybeCreateDirectory(localPath) {
|
|
57
|
+
const directory = path_1.default.dirname(localPath);
|
|
58
|
+
if (!fs.existsSync(directory)) {
|
|
59
|
+
fs.mkdirSync(directory, { recursive: true });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.LocalTestOutputWriter = LocalTestOutputWriter;
|
|
64
|
+
class CloudOutputWriter {
|
|
65
|
+
constructor(projectId, workspaceId, applicationId, planId, planRunId, testRunId) {
|
|
66
|
+
this.storageWriter = new CloudStorageWriter_1.default(projectId, workspaceId);
|
|
67
|
+
this.applicationId = applicationId;
|
|
68
|
+
this.planId = planId;
|
|
69
|
+
this.planRunId = planRunId;
|
|
70
|
+
this.testRunId = testRunId;
|
|
71
|
+
}
|
|
72
|
+
async writeObjectAsJson(name, data, replacer, reviver) {
|
|
73
|
+
if (replacer || reviver) {
|
|
74
|
+
data = JSON.parse(JSON.stringify(data, replacer), reviver);
|
|
75
|
+
}
|
|
76
|
+
return this.write(name, 'application/json', Buffer.from(JSON.stringify(data)));
|
|
77
|
+
}
|
|
78
|
+
async write(name, contentType, data) {
|
|
79
|
+
const path = this.nameToFullPath(name);
|
|
80
|
+
await this.storageWriter.write(path, contentType, data);
|
|
81
|
+
return `${this.storageWriter.bucketName()}/${path}`;
|
|
82
|
+
}
|
|
83
|
+
randomPathComponent() {
|
|
84
|
+
return (crypto_1.default
|
|
85
|
+
.randomBytes(3)
|
|
86
|
+
.toString('base64url')
|
|
87
|
+
.replace(/-/g, 'm')
|
|
88
|
+
.replace(/_/g, 'a')
|
|
89
|
+
.toLowerCase());
|
|
90
|
+
}
|
|
91
|
+
nameToFullPath(name) {
|
|
92
|
+
const directoryPath = `${this.applicationId}/${this.planId}/${this.planRunId}/${this.testRunId}`;
|
|
93
|
+
const randomComponent = this.randomPathComponent();
|
|
94
|
+
const fullPath = `${EXECUTION_OUTPUT_PATH_PREFIX}/${randomComponent}/${directoryPath}/${name}`;
|
|
95
|
+
if (fullPath.length <= MAX_PATH_LENGTH) {
|
|
96
|
+
return fullPath;
|
|
97
|
+
}
|
|
98
|
+
loggingProvider_1.logger.info(`WARNING: Truncating path longer than ${MAX_PATH_LENGTH}: ${fullPath}`);
|
|
99
|
+
const overage = fullPath.length - MAX_PATH_LENGTH;
|
|
100
|
+
const truncatedName = name.substring(overage);
|
|
101
|
+
return `${EXECUTION_OUTPUT_PATH_PREFIX}/${randomComponent}/${directoryPath}/${truncatedName}`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.default = CloudOutputWriter;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.maybeAddPopupLogic = exports.attemptPopupDismissal = exports.checkActionabilityAt = exports.checkPopupDismissalOnAction = void 0;
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
28
|
+
const resourceUtil_1 = require("./resourceUtil");
|
|
29
|
+
const messaging_1 = require("../core/messaging/messaging");
|
|
30
|
+
const logUtils_1 = require("./logUtils");
|
|
31
|
+
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
32
|
+
const ACTIONABILITY_CHECK_SCRIPT_LOCATION = (0, resourceUtil_1.findResource)('actionabilityCheck.js');
|
|
33
|
+
const EMBEDDED_POPUP_SCRIPT_LOCATION = (0, resourceUtil_1.findResource)('popupDismissal.js');
|
|
34
|
+
const NO_CLICKABLE_POINT_ERROR = 'Unable to find a clickable point for the element';
|
|
35
|
+
const POPUP_ERROR_MESSAGE_HINT = 'intercepts pointer events';
|
|
36
|
+
let embeddedPopupScript;
|
|
37
|
+
let embeddedActionabilityLogic;
|
|
38
|
+
async function checkPopupDismissalOnAction(elementHandle, action, executionContext, recheckOnFail = true) {
|
|
39
|
+
try {
|
|
40
|
+
await action();
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (error.message.includes(POPUP_ERROR_MESSAGE_HINT)) {
|
|
44
|
+
const hasPopup = await isElementWithPopup(elementHandle);
|
|
45
|
+
if (hasPopup) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
const dismissalResult = await attemptPopupDismissal(elementHandle, executionContext);
|
|
49
|
+
if (recheckOnFail) {
|
|
50
|
+
return checkPopupDismissalOnAction(elementHandle, action, executionContext, false);
|
|
51
|
+
}
|
|
52
|
+
if (!dismissalResult) {
|
|
53
|
+
(0, logUtils_1.logWebUIAndCliOutput)(`Found element may not be actionable`, loggingProvider_1.LogLevel.Warn, executionContext, {
|
|
54
|
+
executionPhase: messaging_1.ExecutionPhase.DURING_ACTION,
|
|
55
|
+
});
|
|
56
|
+
(0, logUtils_1.logInternal)(`Found element might not be actionable. ${error.toString()}`);
|
|
57
|
+
}
|
|
58
|
+
return dismissalResult;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
exports.checkPopupDismissalOnAction = checkPopupDismissalOnAction;
|
|
64
|
+
async function checkActionabilityAt(elementHandle, executionContext, recheckOnFail = true) {
|
|
65
|
+
let point = await elementHandle.clickablePoint();
|
|
66
|
+
if (point === undefined) {
|
|
67
|
+
throw new Error(NO_CLICKABLE_POINT_ERROR);
|
|
68
|
+
}
|
|
69
|
+
const frame = await elementHandle.frame();
|
|
70
|
+
if (frame === null || frame === void 0 ? void 0 : frame.parentFrame()) {
|
|
71
|
+
const element = await frame.getFrameOwnerElement();
|
|
72
|
+
if (element !== undefined) {
|
|
73
|
+
const box = await element.boundingBox();
|
|
74
|
+
if (!box) {
|
|
75
|
+
throw new Error('Element not connected');
|
|
76
|
+
}
|
|
77
|
+
point = { x: point.x - box.x, y: point.y - box.y };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
await maybeAddActionabilityLogic(elementHandle);
|
|
81
|
+
const result = await elementHandle.evaluate((node, point) => mablCheckActionability(node, point), { ...point });
|
|
82
|
+
if (result !== 'done') {
|
|
83
|
+
if (typeof result === 'object' && 'actionabilityDescription' in result) {
|
|
84
|
+
(0, logUtils_1.logInternal)(`${result.actionabilityDescription} intercepts pointer events. Trying to auto-dismiss popups.`);
|
|
85
|
+
const hasPopup = await isElementWithPopup(elementHandle);
|
|
86
|
+
if (hasPopup) {
|
|
87
|
+
return {
|
|
88
|
+
result: 'done',
|
|
89
|
+
clickablePoint: point,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
await attemptPopupDismissal(elementHandle, executionContext);
|
|
93
|
+
if (recheckOnFail) {
|
|
94
|
+
return checkActionabilityAt(elementHandle, executionContext, false);
|
|
95
|
+
}
|
|
96
|
+
throw new Error(`Element not clickable at point.`);
|
|
97
|
+
}
|
|
98
|
+
throw new Error(`Element not at point. ${result}`);
|
|
99
|
+
}
|
|
100
|
+
return { result, clickablePoint: point };
|
|
101
|
+
}
|
|
102
|
+
exports.checkActionabilityAt = checkActionabilityAt;
|
|
103
|
+
async function attemptPopupDismissal(element, executionContext) {
|
|
104
|
+
const frame = await element.frame();
|
|
105
|
+
if (frame === undefined) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
await maybeAddPopupLogic(element);
|
|
109
|
+
const { dismissedStatus, elementsInFront, error } = await element.evaluate((element) => globalThis.popupDismissal.detectAndDismissPopupCandidates(element));
|
|
110
|
+
if (error) {
|
|
111
|
+
(0, logUtils_1.logInternal)(`Error while trying to dismiss popups: ${error}`);
|
|
112
|
+
}
|
|
113
|
+
if (!dismissedStatus) {
|
|
114
|
+
if (elementsInFront) {
|
|
115
|
+
(0, logUtils_1.logInternal)('Failed to auto dismiss and there are still elements in front. Sending escape key to body.');
|
|
116
|
+
const bodyElement = await frame.$('BODY');
|
|
117
|
+
if (bodyElement) {
|
|
118
|
+
await bodyElement.press('Escape');
|
|
119
|
+
}
|
|
120
|
+
const elementsInFront = await element.evaluate((element) => globalThis.popupDismissal.elementsInFrontCount(element));
|
|
121
|
+
if (elementsInFront) {
|
|
122
|
+
(0, logUtils_1.logInternal)('The popup did not dismiss using the escape key.');
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
(0, logUtils_1.logInternal)('Failed to auto dismiss. No elements found in front of target element.');
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
(0, logUtils_1.logWebUIAndCliOutput)(`A popup was detected and dismissed`, loggingProvider_1.LogLevel.Info, executionContext, {
|
|
132
|
+
executionPhase: messaging_1.ExecutionPhase.DURING_ACTION,
|
|
133
|
+
});
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
exports.attemptPopupDismissal = attemptPopupDismissal;
|
|
137
|
+
async function maybeAddPopupLogic(element) {
|
|
138
|
+
const hasPopupDismissalLogic = await isPopupDismissalInTarget(element);
|
|
139
|
+
if (!hasPopupDismissalLogic) {
|
|
140
|
+
if (!embeddedPopupScript) {
|
|
141
|
+
embeddedPopupScript = fs.readFileSync(EMBEDDED_POPUP_SCRIPT_LOCATION, 'utf8');
|
|
142
|
+
}
|
|
143
|
+
await element.evaluate(embeddedPopupScript);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
exports.maybeAddPopupLogic = maybeAddPopupLogic;
|
|
147
|
+
async function maybeAddActionabilityLogic(element) {
|
|
148
|
+
const hasActionabilityCheckLogic = await isActionabilityLogicInTarget(element);
|
|
149
|
+
if (!hasActionabilityCheckLogic) {
|
|
150
|
+
if (!embeddedActionabilityLogic) {
|
|
151
|
+
embeddedActionabilityLogic = fs.readFileSync(ACTIONABILITY_CHECK_SCRIPT_LOCATION, 'utf8');
|
|
152
|
+
}
|
|
153
|
+
await element.evaluate(embeddedActionabilityLogic);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function isActionabilityLogicInTarget(element) {
|
|
157
|
+
return element.evaluate(() => !!globalThis.mablCheckActionability);
|
|
158
|
+
}
|
|
159
|
+
function isPopupDismissalInTarget(element) {
|
|
160
|
+
return element.evaluate(() => !!globalThis.popupDismissal);
|
|
161
|
+
}
|
|
162
|
+
function isElementWithPopup(element) {
|
|
163
|
+
return element.evaluate((element) => element.getAttribute('aria-expanded') === 'true' &&
|
|
164
|
+
element.getAttribute('aria-haspopup') === 'true');
|
|
165
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExternalToolsEvents = void 0;
|
|
4
|
+
var ExternalToolsEvents;
|
|
5
|
+
(function (ExternalToolsEvents) {
|
|
6
|
+
ExternalToolsEvents["CreateMailboxAddress"] = "MablToolset: create mailbox address";
|
|
7
|
+
ExternalToolsEvents["EvaluateGenAiAssertion"] = "MablToolset: evaluate AI assertion";
|
|
8
|
+
ExternalToolsEvents["ExecuteDatabaseQuery"] = "MablToolset: execute database query";
|
|
9
|
+
ExternalToolsEvents["GetCredentials"] = "MablToolset: get credentials";
|
|
10
|
+
ExternalToolsEvents["GetMFACode"] = "MablTooset: get MFA code";
|
|
11
|
+
ExternalToolsEvents["InitializeContext"] = "MablToolset: content initialization";
|
|
12
|
+
ExternalToolsEvents["OpenPdfFileInPage"] = "MablToolset: open PDF file in page";
|
|
13
|
+
ExternalToolsEvents["WaitForEmail"] = "MablToolset: wait for email";
|
|
14
|
+
})(ExternalToolsEvents || (exports.ExternalToolsEvents = ExternalToolsEvents = {}));
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.trackMablTestsRunnerEvent = exports.trackExternalToolEvent = exports.trackCliEvent = void 0;
|
|
27
|
+
const env_1 = require("../env/env");
|
|
28
|
+
const cliConfigProvider_1 = require("../providers/cliConfigProvider");
|
|
29
|
+
const axiosProxyConfig_1 = require("../http/axiosProxyConfig");
|
|
30
|
+
const pureUtil_1 = require("./pureUtil");
|
|
31
|
+
const os = __importStar(require("os"));
|
|
32
|
+
const types_1 = require("../api/types");
|
|
33
|
+
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
34
|
+
const configKeys_1 = require("../commands/config/config_cmds/configKeys");
|
|
35
|
+
const Analytics = require('analytics-node');
|
|
36
|
+
function getCliUserId(workspaceId) {
|
|
37
|
+
return `cliKey-${workspaceId !== null && workspaceId !== void 0 ? workspaceId : 'unknown'}`;
|
|
38
|
+
}
|
|
39
|
+
async function getTrackingInfo() {
|
|
40
|
+
var _a, _b, _c, _d, _e;
|
|
41
|
+
const config = await cliConfigProvider_1.CliConfigProvider.getCliConfig();
|
|
42
|
+
if (config.authentication.authType === undefined) {
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
let userId;
|
|
46
|
+
if (config.authentication.authType === types_1.AuthType.ApiKey) {
|
|
47
|
+
userId = `cliKey-${(_b = (_a = config.workspace) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : 'unknown'}`;
|
|
48
|
+
userId = getCliUserId((_c = config.workspace) === null || _c === void 0 ? void 0 : _c.id);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
userId = config.userId;
|
|
52
|
+
}
|
|
53
|
+
const scmDetectionEnabled = (_d = (await cliConfigProvider_1.CliConfigProvider.getConfigProperty(configKeys_1.configKeys.enableSourceControlMetadataCollection))) !== null && _d !== void 0 ? _d : false;
|
|
54
|
+
return {
|
|
55
|
+
userId,
|
|
56
|
+
workspaceId: (_e = config.workspace) === null || _e === void 0 ? void 0 : _e.id,
|
|
57
|
+
features: {
|
|
58
|
+
scm_metadata: scmDetectionEnabled,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
async function trackCliEvent(commands, argumentCountMap) {
|
|
63
|
+
try {
|
|
64
|
+
const trackingInfo = await getTrackingInfo();
|
|
65
|
+
if (!trackingInfo.userId) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const event = `mablCli - ${commands.join(' ')}`;
|
|
69
|
+
const properties = {
|
|
70
|
+
workspaceId: trackingInfo.workspaceId,
|
|
71
|
+
environment: env_1.ENV,
|
|
72
|
+
argumentCountMap,
|
|
73
|
+
features: trackingInfo.features,
|
|
74
|
+
};
|
|
75
|
+
await trackEvent(event, trackingInfo.userId, properties);
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
if (env_1.ENV === 'local' || env_1.ENV === 'dev') {
|
|
79
|
+
loggingProvider_1.logger.error('Error with Segment event', error);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.trackCliEvent = trackCliEvent;
|
|
84
|
+
async function trackExternalToolEvent(event, properties) {
|
|
85
|
+
try {
|
|
86
|
+
(await getAnalytics()).track({
|
|
87
|
+
userId: getCliUserId(properties.workspaceId),
|
|
88
|
+
event,
|
|
89
|
+
context: {
|
|
90
|
+
app: {
|
|
91
|
+
build: env_1.ENV,
|
|
92
|
+
name: (0, pureUtil_1.getCliName)(),
|
|
93
|
+
version: (0, pureUtil_1.getCliVersion)(),
|
|
94
|
+
},
|
|
95
|
+
os: {
|
|
96
|
+
name: os.platform(),
|
|
97
|
+
version: os.release(),
|
|
98
|
+
},
|
|
99
|
+
groupId: properties.workspaceId,
|
|
100
|
+
userAgent: getUserAgent(),
|
|
101
|
+
},
|
|
102
|
+
properties,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
loggingProvider_1.logger.error('Error with analytics data', error);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.trackExternalToolEvent = trackExternalToolEvent;
|
|
110
|
+
async function trackMablTestsRunnerEvent(eventName, resultsMap) {
|
|
111
|
+
try {
|
|
112
|
+
const trackingInfo = await getTrackingInfo();
|
|
113
|
+
if (!trackingInfo.userId) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const properties = {
|
|
117
|
+
workspaceId: trackingInfo.workspaceId,
|
|
118
|
+
environment: env_1.ENV,
|
|
119
|
+
resultsMap,
|
|
120
|
+
};
|
|
121
|
+
await trackEvent(eventName, trackingInfo.userId, properties);
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
if (env_1.ENV === 'local' || env_1.ENV === 'dev') {
|
|
125
|
+
loggingProvider_1.logger.error('Error with Segment event', error);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
exports.trackMablTestsRunnerEvent = trackMablTestsRunnerEvent;
|
|
130
|
+
async function trackEvent(event, userId, properties) {
|
|
131
|
+
var _a, _b, _c;
|
|
132
|
+
const cpuInfo = (_a = os.cpus()) !== null && _a !== void 0 ? _a : [];
|
|
133
|
+
(await getAnalytics()).track({
|
|
134
|
+
userId,
|
|
135
|
+
event,
|
|
136
|
+
context: {
|
|
137
|
+
app: {
|
|
138
|
+
build: env_1.ENV,
|
|
139
|
+
name: (0, pureUtil_1.getCliName)(),
|
|
140
|
+
version: (0, pureUtil_1.getCliVersion)(),
|
|
141
|
+
},
|
|
142
|
+
os: {
|
|
143
|
+
name: os.platform(),
|
|
144
|
+
version: os.release(),
|
|
145
|
+
},
|
|
146
|
+
groupId: properties.workspaceId,
|
|
147
|
+
userAgent: getUserAgent(),
|
|
148
|
+
userAgentData: {
|
|
149
|
+
cpuCount: cpuInfo.length,
|
|
150
|
+
cpuType: (_b = cpuInfo === null || cpuInfo === void 0 ? void 0 : cpuInfo[0]) === null || _b === void 0 ? void 0 : _b.model,
|
|
151
|
+
cpuSpeed: (_c = cpuInfo === null || cpuInfo === void 0 ? void 0 : cpuInfo[0]) === null || _c === void 0 ? void 0 : _c.speed,
|
|
152
|
+
osArch: os.arch(),
|
|
153
|
+
memFree: os.freemem(),
|
|
154
|
+
memTotal: os.totalmem(),
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
properties,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
async function getAnalytics() {
|
|
161
|
+
return new Analytics('ghbAXZbk8fqWROgMscPdkQMoqEjwsKRa', {
|
|
162
|
+
axiosConfig: await (0, axiosProxyConfig_1.currentProxyConfig)(),
|
|
163
|
+
errorHandler: (error) => {
|
|
164
|
+
if (env_1.ENV === 'local' || env_1.ENV === 'dev') {
|
|
165
|
+
loggingProvider_1.logger.error('Error with Segment event', error);
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
flushAt: 1,
|
|
169
|
+
flushInterval: 1,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
function getUserAgent() {
|
|
173
|
+
var _a, _b;
|
|
174
|
+
const nodeName = (_b = (_a = process === null || process === void 0 ? void 0 : process.release) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : 'node';
|
|
175
|
+
return `${nodeName}_${process.arch}@${process.version}`;
|
|
176
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterAsync = exports.TimeoutError = exports.promiseWithTimeout = void 0;
|
|
4
|
+
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
5
|
+
const pureUtil_1 = require("./pureUtil");
|
|
6
|
+
const logUtils_1 = require("./logUtils");
|
|
7
|
+
async function promiseWithTimeout(promise, timeoutMillis, description, timeoutType = 'mabl timeout', printToConsole = true) {
|
|
8
|
+
const startTimeMillis = new Date().getTime();
|
|
9
|
+
const { timer, cancelTimer, errorMessage } = startTimer(timeoutMillis, description, timeoutType);
|
|
10
|
+
try {
|
|
11
|
+
const result = await Promise.race([timer, promise]);
|
|
12
|
+
if (loggingProvider_1.logger.isDebugEnabled() && printToConsole) {
|
|
13
|
+
loggingProvider_1.logger.debug(`"${description}" completed in ${new Date().getTime() - startTimeMillis}ms`);
|
|
14
|
+
}
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
if (error instanceof TimeoutError &&
|
|
19
|
+
printToConsole &&
|
|
20
|
+
error.message === errorMessage) {
|
|
21
|
+
loggingProvider_1.logger.warn(error.message);
|
|
22
|
+
}
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
cancelTimer();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.promiseWithTimeout = promiseWithTimeout;
|
|
30
|
+
class TimeoutError extends Error {
|
|
31
|
+
constructor(timeoutMillis, description, timeoutType) {
|
|
32
|
+
super(`[${timeoutType}] "${description}" timed out after ${timeoutMillis}ms`);
|
|
33
|
+
this.timeoutMillis = timeoutMillis;
|
|
34
|
+
this.description = description;
|
|
35
|
+
this.timeoutType = timeoutType;
|
|
36
|
+
Object.setPrototypeOf(this, TimeoutError.prototype);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.TimeoutError = TimeoutError;
|
|
40
|
+
const startTimer = (timeoutMillis, description, timeoutType) => {
|
|
41
|
+
let timeout;
|
|
42
|
+
const timeoutError = new TimeoutError(timeoutMillis, description, timeoutType);
|
|
43
|
+
const promise = new Promise((_resolve, reject) => {
|
|
44
|
+
timeout = global.setTimeout(() => reject(timeoutError), timeoutMillis);
|
|
45
|
+
timeout.unref();
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
timer: promise,
|
|
49
|
+
cancelTimer: () => global.clearTimeout(timeout),
|
|
50
|
+
errorMessage: timeoutError.message,
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
async function filterAsync(array, callback) {
|
|
54
|
+
const results = await Promise.allSettled(array.map(callback));
|
|
55
|
+
(0, logUtils_1.logPromiseSettledRejections)(results);
|
|
56
|
+
return array.filter((_, index) => {
|
|
57
|
+
const result = results[index];
|
|
58
|
+
return (0, pureUtil_1.isFulfilledPromise)(result) && result.value;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.filterAsync = filterAsync;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a, _b;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.IS_TEST_BROWSER_WEBKIT = exports.IS_TEST_BROWSER_FIREFOX = exports.IS_TEST_BROWSER_CHROMIUM = exports.TEST_BROWSER_ENGINE = exports.TEST_BROWSER_TYPE = void 0;
|
|
5
|
+
const browserEngines_1 = require("../browserEngines/browserEngines");
|
|
6
|
+
const browserTypes_1 = require("../commands/browserTypes");
|
|
7
|
+
const VALID_TEST_BROWSER_TYPES = ['chrome', 'firefox', 'webkit'];
|
|
8
|
+
const browserTypeEnvironmentVariable = (_b = (_a = process.env.TEST_BROWSER_TYPE) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : 'chrome';
|
|
9
|
+
if (browserTypeEnvironmentVariable &&
|
|
10
|
+
!VALID_TEST_BROWSER_TYPES.includes(browserTypeEnvironmentVariable)) {
|
|
11
|
+
throw Error(`Test browser type cannot be ${browserTypeEnvironmentVariable}, it must be one of ${VALID_TEST_BROWSER_TYPES}`);
|
|
12
|
+
}
|
|
13
|
+
exports.TEST_BROWSER_TYPE = browserTypeEnvironmentVariable;
|
|
14
|
+
exports.TEST_BROWSER_ENGINE = browserEngines_1.BrowserTypeToBrowserEngine[exports.TEST_BROWSER_TYPE];
|
|
15
|
+
exports.IS_TEST_BROWSER_CHROMIUM = exports.TEST_BROWSER_ENGINE === browserEngines_1.BrowserTypeToBrowserEngine[browserTypes_1.BrowserType.Chrome];
|
|
16
|
+
exports.IS_TEST_BROWSER_FIREFOX = exports.TEST_BROWSER_ENGINE === browserEngines_1.BrowserTypeToBrowserEngine[browserTypes_1.BrowserType.Firefox];
|
|
17
|
+
exports.IS_TEST_BROWSER_WEBKIT = exports.TEST_BROWSER_ENGINE === browserEngines_1.BrowserTypeToBrowserEngine[browserTypes_1.BrowserType.Webkit];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clickOnElement = exports.CLICK_TYPE_TO_HUMAN_TEXT = exports.ClickType = void 0;
|
|
4
|
+
const messaging_1 = require("../core/messaging/messaging");
|
|
5
|
+
const ExecutorUtils_1 = require("../execution/actions/ExecutorUtils");
|
|
6
|
+
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
7
|
+
const actionabilityUtil_1 = require("./actionabilityUtil");
|
|
8
|
+
const logUtils_1 = require("./logUtils");
|
|
9
|
+
var ClickType;
|
|
10
|
+
(function (ClickType) {
|
|
11
|
+
ClickType["DoubleClick"] = "double_click";
|
|
12
|
+
ClickType["LeftClick"] = "click";
|
|
13
|
+
ClickType["RightClick"] = "right_click";
|
|
14
|
+
})(ClickType || (exports.ClickType = ClickType = {}));
|
|
15
|
+
const CLICK_TYPE_TO_JS_FIRER = {
|
|
16
|
+
[ClickType.DoubleClick]: (element) => globalThis.popupDismissal.fireDoubleClickEvent(element),
|
|
17
|
+
[ClickType.LeftClick]: (element) => globalThis.popupDismissal.fireClickEvent(element),
|
|
18
|
+
[ClickType.RightClick]: (element) => globalThis.popupDismissal.fireRightClickEvent(element),
|
|
19
|
+
};
|
|
20
|
+
exports.CLICK_TYPE_TO_HUMAN_TEXT = {
|
|
21
|
+
[ClickType.DoubleClick]: 'double click',
|
|
22
|
+
[ClickType.LeftClick]: 'click',
|
|
23
|
+
[ClickType.RightClick]: 'right click',
|
|
24
|
+
};
|
|
25
|
+
async function clickOnElement(elementHandle, executionContext, clickType = ClickType.LeftClick) {
|
|
26
|
+
const trialClickOptions = {
|
|
27
|
+
button: clickType === ClickType.RightClick ? 'right' : 'left',
|
|
28
|
+
trial: true,
|
|
29
|
+
minimizeScrollIntoView: executionContext.browserConfig.minimizeScrollIntoView,
|
|
30
|
+
};
|
|
31
|
+
const elementHandleTrialClickAction = clickType === ClickType.DoubleClick
|
|
32
|
+
? () => elementHandle.doubleClick(trialClickOptions)
|
|
33
|
+
: () => elementHandle.click(trialClickOptions);
|
|
34
|
+
const noOverlappingElement = await (0, actionabilityUtil_1.checkPopupDismissalOnAction)(elementHandle, elementHandleTrialClickAction, executionContext);
|
|
35
|
+
const elementBoundingBox = await elementHandle.boundingBox();
|
|
36
|
+
const elementHasSurfaceArea = elementBoundingBox
|
|
37
|
+
? elementBoundingBox.height > 0 && elementBoundingBox.width > 0
|
|
38
|
+
: false;
|
|
39
|
+
if (!noOverlappingElement || !elementHasSurfaceArea) {
|
|
40
|
+
const isAttached = await elementHandle.evaluate((el) => el.isConnected);
|
|
41
|
+
if (!isAttached) {
|
|
42
|
+
throw new Error(ExecutorUtils_1.ELEMENT_NOT_ATTACHED_ERROR);
|
|
43
|
+
}
|
|
44
|
+
const jsClickReasons = [
|
|
45
|
+
!noOverlappingElement && "there is a popup we couldn't dismiss",
|
|
46
|
+
!elementHasSurfaceArea && 'the element is not visible',
|
|
47
|
+
]
|
|
48
|
+
.filter((reason) => reason !== false)
|
|
49
|
+
.join(' and ');
|
|
50
|
+
(0, logUtils_1.logWebUIAndCliOutput)(`Attempting ${exports.CLICK_TYPE_TO_HUMAN_TEXT[clickType]} with javascript because ${jsClickReasons}`, loggingProvider_1.LogLevel.Warn, executionContext, {
|
|
51
|
+
executionPhase: messaging_1.ExecutionPhase.DURING_ACTION,
|
|
52
|
+
});
|
|
53
|
+
if (noOverlappingElement) {
|
|
54
|
+
await (0, actionabilityUtil_1.maybeAddPopupLogic)(elementHandle);
|
|
55
|
+
}
|
|
56
|
+
const jsClickEventFirer = CLICK_TYPE_TO_JS_FIRER[clickType];
|
|
57
|
+
return elementHandle.evaluate(jsClickEventFirer);
|
|
58
|
+
}
|
|
59
|
+
const finalClickOptions = {
|
|
60
|
+
button: clickType === ClickType.RightClick ? 'right' : 'left',
|
|
61
|
+
timeout: 0,
|
|
62
|
+
minimizeScrollIntoView: executionContext.browserConfig.minimizeScrollIntoView,
|
|
63
|
+
};
|
|
64
|
+
return clickType === ClickType.DoubleClick
|
|
65
|
+
? elementHandle.doubleClick(finalClickOptions)
|
|
66
|
+
: elementHandle.click(finalClickOptions);
|
|
67
|
+
}
|
|
68
|
+
exports.clickOnElement = clickOnElement;
|