@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,254 @@
|
|
|
1
|
+
/*
|
|
2
|
+
object-assign
|
|
3
|
+
(c) Sindre Sorhus
|
|
4
|
+
@license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*!
|
|
8
|
+
* Copyright (c) 2015, Salesforce.com, Inc.
|
|
9
|
+
* All rights reserved.
|
|
10
|
+
*
|
|
11
|
+
* Redistribution and use in source and binary forms, with or without
|
|
12
|
+
* modification, are permitted provided that the following conditions are met:
|
|
13
|
+
*
|
|
14
|
+
* 1. Redistributions of source code must retain the above copyright notice,
|
|
15
|
+
* this list of conditions and the following disclaimer.
|
|
16
|
+
*
|
|
17
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
18
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
19
|
+
* and/or other materials provided with the distribution.
|
|
20
|
+
*
|
|
21
|
+
* 3. Neither the name of Salesforce.com nor the names of its contributors may
|
|
22
|
+
* be used to endorse or promote products derived from this software without
|
|
23
|
+
* specific prior written permission.
|
|
24
|
+
*
|
|
25
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
26
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
27
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
28
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
29
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
30
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
31
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
32
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
33
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
34
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
35
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/*!
|
|
39
|
+
* Copyright (c) 2018, Salesforce.com, Inc.
|
|
40
|
+
* All rights reserved.
|
|
41
|
+
*
|
|
42
|
+
* Redistribution and use in source and binary forms, with or without
|
|
43
|
+
* modification, are permitted provided that the following conditions are met:
|
|
44
|
+
*
|
|
45
|
+
* 1. Redistributions of source code must retain the above copyright notice,
|
|
46
|
+
* this list of conditions and the following disclaimer.
|
|
47
|
+
*
|
|
48
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
49
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
50
|
+
* and/or other materials provided with the distribution.
|
|
51
|
+
*
|
|
52
|
+
* 3. Neither the name of Salesforce.com nor the names of its contributors may
|
|
53
|
+
* be used to endorse or promote products derived from this software without
|
|
54
|
+
* specific prior written permission.
|
|
55
|
+
*
|
|
56
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
57
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
58
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
59
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
60
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
61
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
62
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
63
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
64
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
65
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
66
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
/*!
|
|
70
|
+
* Determine if an object is a Buffer
|
|
71
|
+
*
|
|
72
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
73
|
+
* @license MIT
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
/*!
|
|
77
|
+
* Tmp
|
|
78
|
+
*
|
|
79
|
+
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
|
80
|
+
*
|
|
81
|
+
* MIT Licensed
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
/*!
|
|
85
|
+
* accepts
|
|
86
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
87
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
88
|
+
* MIT Licensed
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
/*!
|
|
92
|
+
* base64id v0.1.0
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
/*!
|
|
96
|
+
* bytes
|
|
97
|
+
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|
98
|
+
* Copyright(c) 2015 Jed Watson
|
|
99
|
+
* MIT Licensed
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
/*!
|
|
103
|
+
* content-disposition
|
|
104
|
+
* Copyright(c) 2014 Douglas Christopher Wilson
|
|
105
|
+
* MIT Licensed
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
/*!
|
|
109
|
+
* cookie
|
|
110
|
+
* Copyright(c) 2012-2014 Roman Shtylman
|
|
111
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
112
|
+
* MIT Licensed
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
/*!
|
|
116
|
+
* encodeurl
|
|
117
|
+
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
118
|
+
* MIT Licensed
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
/*!
|
|
122
|
+
* mime-db
|
|
123
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
124
|
+
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|
125
|
+
* MIT Licensed
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
/*!
|
|
129
|
+
* mime-db
|
|
130
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
131
|
+
* MIT Licensed
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
/*!
|
|
135
|
+
* mime-types
|
|
136
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
137
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
138
|
+
* MIT Licensed
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
/*!
|
|
142
|
+
* negotiator
|
|
143
|
+
* Copyright(c) 2012 Federico Romero
|
|
144
|
+
* Copyright(c) 2012-2014 Isaac Z. Schlueter
|
|
145
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
146
|
+
* MIT Licensed
|
|
147
|
+
*/
|
|
148
|
+
|
|
149
|
+
/*!
|
|
150
|
+
* range-parser
|
|
151
|
+
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|
152
|
+
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
|
153
|
+
* MIT Licensed
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
/*!
|
|
157
|
+
* vary
|
|
158
|
+
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
159
|
+
* MIT Licensed
|
|
160
|
+
*/
|
|
161
|
+
|
|
162
|
+
/*! *****************************************************************************
|
|
163
|
+
Copyright (c) Microsoft Corporation.
|
|
164
|
+
|
|
165
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
166
|
+
purpose with or without fee is hereby granted.
|
|
167
|
+
|
|
168
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
169
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
170
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
171
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
172
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
173
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
174
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
175
|
+
***************************************************************************** */
|
|
176
|
+
|
|
177
|
+
/*! axe v4.8.3
|
|
178
|
+
* Copyright (c) 2015 - 2023 Deque Systems, Inc.
|
|
179
|
+
*
|
|
180
|
+
* Your use of this Source Code Form is subject to the terms of the Mozilla Public
|
|
181
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
182
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
183
|
+
*
|
|
184
|
+
* This entire copyright notice must appear in every copy of this file you
|
|
185
|
+
* distribute or in any file that contains substantial portions of this source
|
|
186
|
+
* code.
|
|
187
|
+
*/
|
|
188
|
+
|
|
189
|
+
/*! https://mths.be/utf8js v2.1.2 by @mathias */
|
|
190
|
+
|
|
191
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
192
|
+
|
|
193
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @license
|
|
197
|
+
* Lodash <https://lodash.com/>
|
|
198
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
199
|
+
* Released under MIT license <https://lodash.com/license>
|
|
200
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
201
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
202
|
+
*/
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* @license Complex.js v2.1.1 12/05/2020
|
|
206
|
+
*
|
|
207
|
+
* Copyright (c) 2020, Robert Eisele (robert@xarg.org)
|
|
208
|
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
209
|
+
**/
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @license Copyright 2016 Google Inc. All Rights Reserved.
|
|
213
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
214
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
215
|
+
*/
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @license Copyright 2016 The Lighthouse Authors. All Rights Reserved.
|
|
219
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
220
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
221
|
+
*/
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* @license Copyright 2017 Google Inc. All Rights Reserved.
|
|
225
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
226
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
227
|
+
*/
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @license Fraction.js v4.2.0 05/03/2022
|
|
231
|
+
* https://www.xarg.org/2014/03/rational-numbers-in-javascript/
|
|
232
|
+
*
|
|
233
|
+
* Copyright (c) 2021, Robert Eisele (robert@xarg.org)
|
|
234
|
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
235
|
+
**/
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Wrapper for built-in http.js to emulate the browser XMLHttpRequest object.
|
|
239
|
+
*
|
|
240
|
+
* This can be used with JS designed for browsers to improve reuse of code and
|
|
241
|
+
* allow the use of existing libraries.
|
|
242
|
+
*
|
|
243
|
+
* Usage: include("XMLHttpRequest.js") and use XMLHttpRequest per W3C specs.
|
|
244
|
+
*
|
|
245
|
+
* @author Dan DeFelippi <dan@driverdan.com>
|
|
246
|
+
* @contributor David Ellis <d.f.ellis@ieee.org>
|
|
247
|
+
* @license MIT
|
|
248
|
+
*/
|
|
249
|
+
|
|
250
|
+
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|
|
251
|
+
|
|
252
|
+
//! moment.js
|
|
253
|
+
|
|
254
|
+
//! moment.js locale configuration
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
const appium = require('appium');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const APPIUM_SERVER_READY = 'APPIUM_SERVER_READY';
|
|
10
|
+
const APPIUM_SERVER_SHUTDOWN = 'APPIUM_SERVER_SHUTDOWN';
|
|
11
|
+
const APPIUM_SERVER_LOG = 'APPIUM_SERVER_LOG';
|
|
12
|
+
const APPIUM_SERVER_PARENT_ALIVE = 'APPIUM_SERVER_PARENT_ALIVE';
|
|
13
|
+
const APPIUM_SERVER_CHECK_IN = 'APPIUM_SERVER_CHECK_IN';
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const CHECK_IN_FAIL_LIMIT_MILLIS = 15_000;
|
|
17
|
+
|
|
18
|
+
const CHECK_IN_INTERVAL_MILLIS = 5_000;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
const appiumConfig = JSON.parse(process.argv[2]);
|
|
22
|
+
|
|
23
|
+
if (appiumConfig.androidHome) {
|
|
24
|
+
process.env.ANDROID_HOME = appiumConfig.androidHome;
|
|
25
|
+
delete appiumConfig.androidHome;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
appiumConfig.allowInsecure = ['chromedriver_autodownload'];
|
|
31
|
+
|
|
32
|
+
let server;
|
|
33
|
+
let shutdownCalled = false;
|
|
34
|
+
let lastKnownCheckInTime = Date.now();
|
|
35
|
+
let intervalCheckIn;
|
|
36
|
+
|
|
37
|
+
appium
|
|
38
|
+
.main({...appiumConfig, logHandler: logHandlerFunc})
|
|
39
|
+
.then((serverInstance) => {
|
|
40
|
+
server = serverInstance;
|
|
41
|
+
sendMessageToParentProcess({type: APPIUM_SERVER_READY});
|
|
42
|
+
lastKnownCheckInTime = Date.now();
|
|
43
|
+
intervalCheckIn = global.setInterval(
|
|
44
|
+
checkInOnParent,
|
|
45
|
+
CHECK_IN_INTERVAL_MILLIS,
|
|
46
|
+
);
|
|
47
|
+
})
|
|
48
|
+
.catch((error) => {
|
|
49
|
+
|
|
50
|
+
throw error;
|
|
51
|
+
});
|
|
52
|
+
process.on('message', (message) => {
|
|
53
|
+
switch (message) {
|
|
54
|
+
case APPIUM_SERVER_PARENT_ALIVE:
|
|
55
|
+
lastKnownCheckInTime = Date.now();
|
|
56
|
+
break;
|
|
57
|
+
case APPIUM_SERVER_SHUTDOWN:
|
|
58
|
+
shutdownCalled = true;
|
|
59
|
+
server.close().catch((error) => {
|
|
60
|
+
|
|
61
|
+
throw error;
|
|
62
|
+
});
|
|
63
|
+
break;
|
|
64
|
+
default:
|
|
65
|
+
console.log('unsupported message', message);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
function logHandlerFunc(logLevel, log) {
|
|
71
|
+
sendMessageToParentProcess({
|
|
72
|
+
type: APPIUM_SERVER_LOG,
|
|
73
|
+
payload: {
|
|
74
|
+
logLevel,
|
|
75
|
+
log,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
const originalExit = process.exit;
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
process.exit = (code) => {
|
|
86
|
+
if (shutdownCalled) {
|
|
87
|
+
global.clearInterval(intervalCheckIn);
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
originalExit();
|
|
91
|
+
process.kill();
|
|
92
|
+
}
|
|
93
|
+
if (code && code > 0) {
|
|
94
|
+
const stack = new Error().stack;
|
|
95
|
+
sendMessageToParentProcess({
|
|
96
|
+
type: APPIUM_SERVER_LOG,
|
|
97
|
+
payload: {
|
|
98
|
+
logLevel: 'error',
|
|
99
|
+
log: `process.exit() call prevented - ${stack}`,
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
process.on('disconnect', () => {
|
|
107
|
+
console.log(
|
|
108
|
+
'[runAppiumServer.js] lost connection to parent process, terminating',
|
|
109
|
+
);
|
|
110
|
+
originalExit();
|
|
111
|
+
process.kill();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
function checkInOnParent() {
|
|
116
|
+
try {
|
|
117
|
+
sendMessageToParentProcess({type: APPIUM_SERVER_CHECK_IN});
|
|
118
|
+
const currentTime = Date.now();
|
|
119
|
+
const timeSinceLastCheckIn = currentTime - lastKnownCheckInTime;
|
|
120
|
+
if (timeSinceLastCheckIn > CHECK_IN_FAIL_LIMIT_MILLIS) {
|
|
121
|
+
console.log(
|
|
122
|
+
'[runAppiumServer.js] parent process has gone dark, terminating',
|
|
123
|
+
);
|
|
124
|
+
global.clearInterval(intervalCheckIn);
|
|
125
|
+
originalExit();
|
|
126
|
+
process.kill();
|
|
127
|
+
}
|
|
128
|
+
lastKnownCheckInTime = currentTime;
|
|
129
|
+
} catch (error) {
|
|
130
|
+
console.error('Could not run checkin function', error);
|
|
131
|
+
}
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
function sendMessageToParentProcess(message) {
|
|
137
|
+
if (appiumConfig.runningAsUtilityProcess) {
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
process.parentPort.postMessage(message);
|
|
141
|
+
} else {
|
|
142
|
+
process.send(message);
|
|
143
|
+
}
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
@@ -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.validateApiTestMessage = exports.createFileUploadDirectory = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const Globals_1 = require("../../Globals");
|
|
9
|
+
const mablApi_1 = require("../../mablApi");
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
function createFileUploadDirectory(testContext) {
|
|
12
|
+
const dir = Globals_1.Globals.getUploadDirectory();
|
|
13
|
+
const prefix = Globals_1.Globals.getUploadDirectoryPrefix();
|
|
14
|
+
const uploadDirectoryName = `${dir}/${prefix}${Date.now()}-`;
|
|
15
|
+
testContext.addFileUploadDir(uploadDirectoryName);
|
|
16
|
+
return fs_1.default.mkdtempSync(uploadDirectoryName);
|
|
17
|
+
}
|
|
18
|
+
exports.createFileUploadDirectory = createFileUploadDirectory;
|
|
19
|
+
function validateApiTestMessage(request, response) {
|
|
20
|
+
var _a, _b, _c;
|
|
21
|
+
const authorizationHeader = request.get('authorization');
|
|
22
|
+
if (authorizationHeader === undefined) {
|
|
23
|
+
(0, utils_1.handleExecutionFailure)(response, 'Illegal authorization');
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const contentType = request.get('content-type');
|
|
27
|
+
if ((contentType === null || contentType === void 0 ? void 0 : contentType.toLowerCase()) !== 'application/json') {
|
|
28
|
+
(0, utils_1.handleExecutionFailure)(response, 'Illegal content type. Must be application/json');
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
const pubsubMessage = request.body;
|
|
32
|
+
if (typeof ((_a = pubsubMessage === null || pubsubMessage === void 0 ? void 0 : pubsubMessage.message) === null || _a === void 0 ? void 0 : _a.data) !== 'string') {
|
|
33
|
+
(0, utils_1.handleExecutionFailure)(response, 'Illegal message data format');
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
if (typeof (pubsubMessage === null || pubsubMessage === void 0 ? void 0 : pubsubMessage.subscription) !== 'string') {
|
|
37
|
+
(0, utils_1.handleExecutionFailure)(response, 'Illegal message subscription format');
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (((_c = (_b = pubsubMessage === null || pubsubMessage === void 0 ? void 0 : pubsubMessage.message) === null || _b === void 0 ? void 0 : _b.attributes) === null || _c === void 0 ? void 0 : _c.test_type) !==
|
|
41
|
+
mablApi_1.TestTypeEnum.Api.toString()) {
|
|
42
|
+
(0, utils_1.handleExecutionFailure)(response, 'Illegal test type');
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
exports.validateApiTestMessage = validateApiTestMessage;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleExecutionFailure = exports.base64Decode = void 0;
|
|
4
|
+
function base64Decode(encoded) {
|
|
5
|
+
return Buffer.from(encoded, 'base64').toString();
|
|
6
|
+
}
|
|
7
|
+
exports.base64Decode = base64Decode;
|
|
8
|
+
function handleExecutionFailure(response, message) {
|
|
9
|
+
console.error(new Error(message));
|
|
10
|
+
response.status(200).send(message);
|
|
11
|
+
}
|
|
12
|
+
exports.handleExecutionFailure = handleExecutionFailure;
|
|
@@ -0,0 +1,73 @@
|
|
|
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.MablHttpAgent = void 0;
|
|
30
|
+
const http_1 = __importDefault(require("http"));
|
|
31
|
+
const agent_base_1 = require("agent-base");
|
|
32
|
+
const axiosProxyConfig_1 = require("./axiosProxyConfig");
|
|
33
|
+
const https = __importStar(require("https"));
|
|
34
|
+
const httpUtil_1 = require("./httpUtil");
|
|
35
|
+
class MablHttpAgent extends agent_base_1.Agent {
|
|
36
|
+
constructor(httpAgent, httpsAgent) {
|
|
37
|
+
super();
|
|
38
|
+
this.httpAgent = httpAgent;
|
|
39
|
+
this.httpsAgent = httpsAgent;
|
|
40
|
+
}
|
|
41
|
+
static async createNewInstance(config) {
|
|
42
|
+
const constructorParameters = await MablHttpAgent.getConstructorParameters(config.httpAgent, config.httpsAgent);
|
|
43
|
+
if (config.proxyConfig) {
|
|
44
|
+
const axiosConfig = (0, axiosProxyConfig_1.axiosProxyConfig)(config.proxyConfig);
|
|
45
|
+
constructorParameters.httpAgent = axiosConfig.httpAgent;
|
|
46
|
+
constructorParameters.httpsAgent = axiosConfig.httpsAgent;
|
|
47
|
+
}
|
|
48
|
+
return new MablHttpAgent(constructorParameters.httpAgent, constructorParameters.httpsAgent);
|
|
49
|
+
}
|
|
50
|
+
static async getConstructorParameters(httpAgent, httpsAgent) {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
const proxyConfig = await (0, axiosProxyConfig_1.currentProxyConfig)('test');
|
|
53
|
+
return {
|
|
54
|
+
httpAgent: (_a = httpAgent !== null && httpAgent !== void 0 ? httpAgent : proxyConfig.httpAgent) !== null && _a !== void 0 ? _a : http_1.default.globalAgent,
|
|
55
|
+
httpsAgent: (_b = httpsAgent !== null && httpsAgent !== void 0 ? httpsAgent : proxyConfig.httpsAgent) !== null && _b !== void 0 ? _b : https.globalAgent,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
callback(req, opts) {
|
|
59
|
+
var _a;
|
|
60
|
+
if ((_a = this.maybeGetFirstStringHeader(req, httpUtil_1.USER_AGENT_HEADER)) === null || _a === void 0 ? void 0 : _a.startsWith('PostmanRuntime/')) {
|
|
61
|
+
req.setHeader(httpUtil_1.USER_AGENT_HEADER, httpUtil_1.USER_AGENT);
|
|
62
|
+
}
|
|
63
|
+
return Promise.resolve(opts.secureEndpoint ? this.httpsAgent : this.httpAgent);
|
|
64
|
+
}
|
|
65
|
+
maybeGetFirstStringHeader(req, name) {
|
|
66
|
+
const value = req.getHeader(name);
|
|
67
|
+
if (Array.isArray(value)) {
|
|
68
|
+
return value[0].toString();
|
|
69
|
+
}
|
|
70
|
+
return value === null || value === void 0 ? void 0 : value.toString();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.MablHttpAgent = MablHttpAgent;
|
|
@@ -0,0 +1,119 @@
|
|
|
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.isPrivateAddress = exports.isForbiddenHeader = exports.isForbiddenHost = exports.RequestFilteringHttpAgent = void 0;
|
|
27
|
+
const rangeCheck = __importStar(require("range_check"));
|
|
28
|
+
const RequestSecurityError_1 = require("./RequestSecurityError");
|
|
29
|
+
const MablHttpAgent_1 = require("./MablHttpAgent");
|
|
30
|
+
const FORBIDDEN_HOSTS = new Set(['metadata.google.internal']);
|
|
31
|
+
const FORBIDDEN_IP_RANGES = ['169.254.169.254/32'];
|
|
32
|
+
const FORBIDDEN_HEADERS = {
|
|
33
|
+
'metadata-flavor': 'google',
|
|
34
|
+
'x-google-metadata-request': undefined,
|
|
35
|
+
};
|
|
36
|
+
const FORBIDDEN_HEADER_NAMES = Object.keys(FORBIDDEN_HEADERS);
|
|
37
|
+
const RFC_1918_RANGES = ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16'];
|
|
38
|
+
const LOCAL_ADDRESSES = new Set(['127.0.0.1', '::1']);
|
|
39
|
+
const LOCAL_HOSTS = new Set(['localhost']);
|
|
40
|
+
class RequestFilteringHttpAgent extends MablHttpAgent_1.MablHttpAgent {
|
|
41
|
+
constructor(httpAgent, httpsAgent) {
|
|
42
|
+
super(httpAgent, httpsAgent);
|
|
43
|
+
}
|
|
44
|
+
static async createNewInstance() {
|
|
45
|
+
const constructorParameters = await MablHttpAgent_1.MablHttpAgent.getConstructorParameters();
|
|
46
|
+
return new RequestFilteringHttpAgent(constructorParameters.httpAgent, constructorParameters.httpsAgent);
|
|
47
|
+
}
|
|
48
|
+
callback(req, opts) {
|
|
49
|
+
if (isForbiddenHost(opts.host)) {
|
|
50
|
+
return Promise.reject(new RequestSecurityError_1.RequestSecurityError('Request contains forbidden host'));
|
|
51
|
+
}
|
|
52
|
+
else if (containsForbiddenHeader(opts.headers)) {
|
|
53
|
+
return Promise.reject(new RequestSecurityError_1.RequestSecurityError('Request contains forbidden header'));
|
|
54
|
+
}
|
|
55
|
+
else if (isPrivateAddress(opts.host)) {
|
|
56
|
+
return Promise.reject(new RequestSecurityError_1.RequestSecurityError('Request contains private address'));
|
|
57
|
+
}
|
|
58
|
+
return super.callback(req, opts);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.RequestFilteringHttpAgent = RequestFilteringHttpAgent;
|
|
62
|
+
function isForbiddenHost(host) {
|
|
63
|
+
if (!host) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
if (rangeCheck.isIP(host)) {
|
|
67
|
+
return rangeCheck.inRange(host, FORBIDDEN_IP_RANGES);
|
|
68
|
+
}
|
|
69
|
+
const normalizedHost = host.toLowerCase();
|
|
70
|
+
return FORBIDDEN_HOSTS.has(normalizedHost);
|
|
71
|
+
}
|
|
72
|
+
exports.isForbiddenHost = isForbiddenHost;
|
|
73
|
+
function containsForbiddenHeader(headers) {
|
|
74
|
+
if (!headers) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
return Object.keys(headers).some((header) => isForbiddenHeader(header, headers[header]));
|
|
78
|
+
}
|
|
79
|
+
function isForbiddenHeader(headerName, headerValue) {
|
|
80
|
+
const normalizedHeaderName = headerName.toLowerCase().trim();
|
|
81
|
+
if (!FORBIDDEN_HEADER_NAMES.includes(normalizedHeaderName)) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
const forbiddenHeaderValue = FORBIDDEN_HEADERS[normalizedHeaderName];
|
|
85
|
+
if (!forbiddenHeaderValue) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
if (!headerValue) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
const headerValueType = typeof headerValue;
|
|
92
|
+
if (headerValueType === 'string') {
|
|
93
|
+
const normalizedHeaderValue = headerValue.toLowerCase().trim();
|
|
94
|
+
return normalizedHeaderValue == forbiddenHeaderValue;
|
|
95
|
+
}
|
|
96
|
+
else if (headerValueType === 'number') {
|
|
97
|
+
return headerValue == forbiddenHeaderValue;
|
|
98
|
+
}
|
|
99
|
+
else if (Array.isArray(headerValue)) {
|
|
100
|
+
return headerValue.some((value) => isForbiddenHeader(headerName, value));
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
exports.isForbiddenHeader = isForbiddenHeader;
|
|
105
|
+
function isPrivateAddress(host) {
|
|
106
|
+
if (!host) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
if (rangeCheck.isIP(host)) {
|
|
110
|
+
if (rangeCheck.inRange(host, RFC_1918_RANGES)) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
const normalizedIP = rangeCheck.searchIP(host);
|
|
114
|
+
return LOCAL_ADDRESSES.has(normalizedIP);
|
|
115
|
+
}
|
|
116
|
+
const normalizedHostname = host.toLowerCase();
|
|
117
|
+
return LOCAL_HOSTS.has(normalizedHostname);
|
|
118
|
+
}
|
|
119
|
+
exports.isPrivateAddress = isPrivateAddress;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequestSecurityError = void 0;
|
|
4
|
+
class RequestSecurityError extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.isRequestSecurityError = true;
|
|
8
|
+
}
|
|
9
|
+
static isInstance(error) {
|
|
10
|
+
return (error === null || error === void 0 ? void 0 : error.isRequestSecurityError) || false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.RequestSecurityError = RequestSecurityError;
|