@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,279 @@
|
|
|
1
|
+
var EmbeddedPdfHandler;
|
|
2
|
+
/******/ (() => { // webpackBootstrap
|
|
3
|
+
/******/ "use strict";
|
|
4
|
+
/******/ // The require scope
|
|
5
|
+
/******/ var __webpack_require__ = {};
|
|
6
|
+
/******/
|
|
7
|
+
/************************************************************************/
|
|
8
|
+
/******/ /* webpack/runtime/define property getters */
|
|
9
|
+
/******/ (() => {
|
|
10
|
+
/******/ // define getter functions for harmony exports
|
|
11
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
12
|
+
/******/ for(var key in definition) {
|
|
13
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
14
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
15
|
+
/******/ }
|
|
16
|
+
/******/ }
|
|
17
|
+
/******/ };
|
|
18
|
+
/******/ })();
|
|
19
|
+
/******/
|
|
20
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
21
|
+
/******/ (() => {
|
|
22
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
23
|
+
/******/ })();
|
|
24
|
+
/******/
|
|
25
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
26
|
+
/******/ (() => {
|
|
27
|
+
/******/ // define __esModule on exports
|
|
28
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
29
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
30
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
31
|
+
/******/ }
|
|
32
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
33
|
+
/******/ };
|
|
34
|
+
/******/ })();
|
|
35
|
+
/******/
|
|
36
|
+
/************************************************************************/
|
|
37
|
+
var __webpack_exports__ = {};
|
|
38
|
+
// This entry need to be wrapped in an IIFE because it declares 'EmbeddedPdfHandler' on top-level, which conflicts with the current library output.
|
|
39
|
+
(() => {
|
|
40
|
+
/*!***********************************!*\
|
|
41
|
+
!*** ./src/EmbeddedPdfHandler.js ***!
|
|
42
|
+
\***********************************/
|
|
43
|
+
__webpack_require__.r(__webpack_exports__);
|
|
44
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
45
|
+
/* harmony export */ "EmbeddedPdfHandler": () => (/* binding */ EmbeddedPdfHandler),
|
|
46
|
+
/* harmony export */ "MABL_PDF_DETECTOR_ANIMATION_NAME": () => (/* binding */ MABL_PDF_DETECTOR_ANIMATION_NAME),
|
|
47
|
+
/* harmony export */ "MABL_PDF_DETECTOR_STYLE_ID": () => (/* binding */ MABL_PDF_DETECTOR_STYLE_ID),
|
|
48
|
+
/* harmony export */ "MABL_PROCESSED_PDF_ATTRIBUTE": () => (/* binding */ MABL_PROCESSED_PDF_ATTRIBUTE),
|
|
49
|
+
/* harmony export */ "PDFEventType": () => (/* binding */ PDFEventType)
|
|
50
|
+
/* harmony export */ });
|
|
51
|
+
var MABL_PROCESSED_PDF_ATTRIBUTE = '__mabl-processed-pdf';
|
|
52
|
+
var MABL_PDF_DETECTOR_STYLE_ID = '__mabl-pdf-detector';
|
|
53
|
+
var MABL_PDF_DETECTOR_ANIMATION_NAME = '__mabl-trainer-object-embed-detector';
|
|
54
|
+
var MABL_PDF_SRC_ATTRIBUTE = 'data-mabl-pdf-src';
|
|
55
|
+
var PDFEventType = 'animationstart';
|
|
56
|
+
class EmbeddedPdfHandler {
|
|
57
|
+
constructor(PDFEmbeddedViewerBaseUrl, createElement, shouldHandlePredicate, cMapUrl) {
|
|
58
|
+
this.PDFEmbeddedViewerBaseUrl = PDFEmbeddedViewerBaseUrl;
|
|
59
|
+
this.createElement = createElement || document.createElement;
|
|
60
|
+
|
|
61
|
+
this.shouldHandle = shouldHandlePredicate || (() => true);
|
|
62
|
+
|
|
63
|
+
this.cMapUrl = cMapUrl;
|
|
64
|
+
this.handle = this.handle.bind(this);
|
|
65
|
+
this.register = this.register.bind(this);
|
|
66
|
+
this.updateElement = this.updateElement.bind(this);
|
|
67
|
+
this.createViewerElement = this.createViewerElement.bind(this);
|
|
68
|
+
this.checkUrlProtocol = this.checkUrlProtocol.bind(this);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
register() {
|
|
72
|
+
if (document.doctype && document.doctype.name && document.doctype.name.indexOf('html') === -1) {
|
|
73
|
+
// don't inject on non-HTML pages, such as XML, which causes the style to be visible
|
|
74
|
+
// e.g. http://storage.googleapis.com/mabl-dev-pdf/not-a-page.html
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (!document.getElementById(MABL_PDF_DETECTOR_STYLE_ID)) {
|
|
79
|
+
var pdfDetectorStyleElem = this.createElement.call(document, 'style');
|
|
80
|
+
pdfDetectorStyleElem.innerHTML = "\n @keyframes ".concat(MABL_PDF_DETECTOR_ANIMATION_NAME, " { from {} }\n object, embed {\n animation-delay: 0s !important;\n animation-name: ").concat(MABL_PDF_DETECTOR_ANIMATION_NAME, " !important;\n animation-play-state: running !important;\n }");
|
|
81
|
+
pdfDetectorStyleElem.id = MABL_PDF_DETECTOR_STYLE_ID;
|
|
82
|
+
this.pdfDetectorStyleElem = pdfDetectorStyleElem;
|
|
83
|
+
|
|
84
|
+
if (document.head) {
|
|
85
|
+
// the default PDF page in Chrome doesn't have a head, and the browser doesn't insert one
|
|
86
|
+
document.head.appendChild(pdfDetectorStyleElem);
|
|
87
|
+
} else if (document.body) {
|
|
88
|
+
document.body.appendChild(pdfDetectorStyleElem);
|
|
89
|
+
} else {
|
|
90
|
+
// treat this as not an HTML document
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
window.addEventListener(PDFEventType, this.handle, true);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
unregister() {
|
|
99
|
+
window.removeEventListener(PDFEventType, this.handle, true);
|
|
100
|
+
|
|
101
|
+
if (this.pdfDetectorStyleElem && this.pdfDetectorStyleElem.parentNode) {
|
|
102
|
+
this.pdfDetectorStyleElem.parentNode.removeChild(this.pdfDetectorStyleElem);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
handle(event) {
|
|
107
|
+
if (!this.canHandleEvent(event)) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
var pdfElement = event.target;
|
|
112
|
+
this.updateElement(pdfElement);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
checkAnimationEvent(event) {
|
|
116
|
+
return event.animationName === MABL_PDF_DETECTOR_ANIMATION_NAME;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
checkElement(element) {
|
|
120
|
+
return element.tagName === 'EMBED' || element.tagName === 'OBJECT';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
checkMimeType(element) {
|
|
124
|
+
var mimeType = element.type;
|
|
125
|
+
var path = this.getPdfUrlFromElement(element);
|
|
126
|
+
var isAPdf = mimeType && mimeType.toLowerCase() === 'application/pdf' || // mime type is PDF
|
|
127
|
+
!mimeType && path && /\.pdf($|[?#])/i.test(path) || // or if we don't have a mime type test the path up to query or hash
|
|
128
|
+
!!element[MABL_PROCESSED_PDF_ATTRIBUTE]; // it's an element we've already identified
|
|
129
|
+
|
|
130
|
+
return isAPdf;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Checks that the URL embedding the PDF leads to a valid location and/or
|
|
134
|
+
* has a valid protocol
|
|
135
|
+
* @param {HTMLElement} element The element on the page whose URL to check
|
|
136
|
+
* @returns {boolean} Whether or not the element is valid
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
checkUrlProtocol(element) {
|
|
141
|
+
if (element.src === 'about:blank') {
|
|
142
|
+
// this is likely the chrome viewer for a POST
|
|
143
|
+
// don't do anything, we might get a manual update later
|
|
144
|
+
// if the trainer finds a PDF
|
|
145
|
+
return false;
|
|
146
|
+
} // Validate that the URL is an allowed protocol to prevent XSS, see IST-561
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
var pdfUrlString = this.getPdfUrlFromElement(element);
|
|
150
|
+
|
|
151
|
+
try {
|
|
152
|
+
var _pdfUrl$href;
|
|
153
|
+
|
|
154
|
+
var pdfUrl = new URL(pdfUrlString); // data: is allowed to support embedding the PDF inline using a data URI scheme
|
|
155
|
+
|
|
156
|
+
var allowedProtocols = ['http:', 'https:', 'data:'];
|
|
157
|
+
|
|
158
|
+
if (!allowedProtocols.includes(pdfUrl === null || pdfUrl === void 0 ? void 0 : pdfUrl.protocol)) {
|
|
159
|
+
console.warn("PDF Handler ignoring element with URL ".concat(pdfUrlString, " because protocol ").concat(pdfUrl === null || pdfUrl === void 0 ? void 0 : pdfUrl.protocol, " does not match one of the allowed protocols ").concat(allowedProtocols));
|
|
160
|
+
return false;
|
|
161
|
+
} else if ((pdfUrl === null || pdfUrl === void 0 ? void 0 : pdfUrl.protocol) === 'data:' && !/^data:application\/pdf[,;]/.test((_pdfUrl$href = pdfUrl === null || pdfUrl === void 0 ? void 0 : pdfUrl.href) !== null && _pdfUrl$href !== void 0 ? _pdfUrl$href : '') // starts with data:application/pdf and either , or ; separator
|
|
162
|
+
) {
|
|
163
|
+
console.warn("PDF Handler ignoring element with URL ".concat(pdfUrlString, " because it does not use application/pdf MIME type"));
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
} catch (e) {
|
|
167
|
+
console.warn("PDF Handler ignoring element with URL ".concat(pdfUrlString, "; error ").concat(e, " was thrown while converting to URL"));
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
canHandleEvent(event) {
|
|
175
|
+
var element = event.target;
|
|
176
|
+
return this.shouldHandle(event) && this.checkAnimationEvent(event) && this.checkElement(element) && this.checkMimeType(element) && this.checkUrlProtocol(element);
|
|
177
|
+
} // adapted from PDF.js
|
|
178
|
+
// Display the PDF Viewer in an <embed>.
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
updateElement(elem) {
|
|
182
|
+
if (elem.type === 'text/html' && elem.src.lastIndexOf(this.PDFEmbeddedViewerBaseUrl, 0) === 0) {
|
|
183
|
+
// The viewer is already shown.
|
|
184
|
+
return;
|
|
185
|
+
} // The <embed> or <object> tag needs to be removed and replaced with our element
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
var parentNode = elem.parentNode;
|
|
189
|
+
var nextSibling = elem.nextSibling;
|
|
190
|
+
var viewerElem = this.createViewerElement(elem);
|
|
191
|
+
|
|
192
|
+
if (parentNode) {
|
|
193
|
+
parentNode.removeChild(elem);
|
|
194
|
+
parentNode.insertBefore(viewerElem, nextSibling);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Returns the URL string of the element which should in some way be embedding a PDF.
|
|
199
|
+
* @param {HTMLElement} originalPdfElement The element embedding the PDF, should have embed tag, object tag,
|
|
200
|
+
* or have the mabl-pdf-url attribute
|
|
201
|
+
* @returns {(string|undefined)} The URL which should host the PDF, or undefined if none was found
|
|
202
|
+
*/
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
getPdfUrlFromElement(originalPdfElement) {
|
|
206
|
+
var pdfUrl = originalPdfElement.src || originalPdfElement.data || // embed has @src, object has @data
|
|
207
|
+
originalPdfElement.getAttribute('mabl-pdf-url') || // special case for embedded blob urls
|
|
208
|
+
undefined; // getAttribute can return null or '', would prefer to return undefined
|
|
209
|
+
|
|
210
|
+
if (pdfUrl === 'about:blank') {
|
|
211
|
+
// we're likely in the chrome viewer, so window.location actually has
|
|
212
|
+
// the right URL
|
|
213
|
+
pdfUrl = window.location.href;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return pdfUrl;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
createViewerElement(originalPdfElement) {
|
|
220
|
+
var viewerElem = this.createElement.call(document, 'iframe');
|
|
221
|
+
var pdfUrl = this.getPdfUrlFromElement(originalPdfElement); // Firefox does not always get the correct offsetHeight and offsetWidth
|
|
222
|
+
// so if the value returned is 0, then just leave the size to the default size
|
|
223
|
+
|
|
224
|
+
if (originalPdfElement.offsetHeight && originalPdfElement.offsetWidth) {
|
|
225
|
+
viewerElem.height = originalPdfElement.offsetHeight;
|
|
226
|
+
viewerElem.width = originalPdfElement.offsetWidth;
|
|
227
|
+
} else if (originalPdfElement.height && originalPdfElement.width) {
|
|
228
|
+
// Default to height and width of original if available
|
|
229
|
+
viewerElem.height = originalPdfElement.height;
|
|
230
|
+
viewerElem.width = originalPdfElement.width;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
viewerElem.id = '__mabl_pdf_viewer_' + this.idSanitize(this.getPdfFilenameFromUrl(pdfUrl));
|
|
234
|
+
viewerElem.src = this.getEmbeddedViewerURL(pdfUrl);
|
|
235
|
+
viewerElem.setAttribute(MABL_PROCESSED_PDF_ATTRIBUTE, 'true');
|
|
236
|
+
viewerElem.setAttribute(MABL_PDF_SRC_ATTRIBUTE, pdfUrl);
|
|
237
|
+
return viewerElem;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
getEmbeddedViewerURL(path) {
|
|
241
|
+
var fragment = /^([^#]*)(#.*)?$/.exec(path);
|
|
242
|
+
path = fragment[1];
|
|
243
|
+
fragment = fragment[2] || ''; // Resolve relative path to document.
|
|
244
|
+
|
|
245
|
+
var a = document.createElement('a');
|
|
246
|
+
a.href = document.baseURI;
|
|
247
|
+
a.href = path;
|
|
248
|
+
path = a.href;
|
|
249
|
+
return this.getViewerURL(path) + fragment;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
getPdfFilenameFromUrl(pdfUrl) {
|
|
253
|
+
var parsedUrl = new URL(pdfUrl);
|
|
254
|
+
var pdfFileName = parsedUrl.pathname.split('/').slice(-1)[0] || 'mablPdf';
|
|
255
|
+
|
|
256
|
+
if (pdfUrl.startsWith('blob:')) {
|
|
257
|
+
pdfFileName = 'blob_pdf';
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return pdfFileName;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
getViewerURL(pdfUrl) {
|
|
264
|
+
var pdfFileName = this.getPdfFilenameFromUrl(pdfUrl);
|
|
265
|
+
return this.PDFEmbeddedViewerBaseUrl + '?file=' + encodeURIComponent(pdfUrl) + '&name=' + pdfFileName;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
idSanitize(originalId) {
|
|
269
|
+
// TODO: make sure this is sufficient to create valid IDs
|
|
270
|
+
return originalId && originalId.replace(/[^a-zA-Z0-9.-]/g, '_');
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
}
|
|
274
|
+
})();
|
|
275
|
+
|
|
276
|
+
EmbeddedPdfHandler = __webpack_exports__;
|
|
277
|
+
/******/ })()
|
|
278
|
+
;
|
|
279
|
+
//# sourceMappingURL=libEmbeddedPdfHandler.js.map
|