@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,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BrowserEvent = void 0;
|
|
4
|
+
var BrowserEvent;
|
|
5
|
+
(function (BrowserEvent) {
|
|
6
|
+
BrowserEvent["Disconnected"] = "disconnected";
|
|
7
|
+
BrowserEvent["DownloadProgress"] = "downloadprogress";
|
|
8
|
+
BrowserEvent["DownloadWillBegin"] = "downloadwillbegin";
|
|
9
|
+
BrowserEvent["PageCreated"] = "pagecreated";
|
|
10
|
+
BrowserEvent["PageDestroyed"] = "pagedestroyed";
|
|
11
|
+
})(BrowserEvent || (exports.BrowserEvent = BrowserEvent = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LifecycleEvent = exports.BrowserLauncherFactory = exports.Frame = exports.TimeoutError = exports.RunnerError = exports.RUNNER_ERRORS = exports.PageEvent = exports.BrowserEvent = void 0;
|
|
4
|
+
var browserEvent_1 = require("./browserEvent");
|
|
5
|
+
Object.defineProperty(exports, "BrowserEvent", { enumerable: true, get: function () { return browserEvent_1.BrowserEvent; } });
|
|
6
|
+
var pageEvent_1 = require("./pageEvent");
|
|
7
|
+
Object.defineProperty(exports, "PageEvent", { enumerable: true, get: function () { return pageEvent_1.PageEvent; } });
|
|
8
|
+
var errors_1 = require("./errors");
|
|
9
|
+
Object.defineProperty(exports, "RUNNER_ERRORS", { enumerable: true, get: function () { return errors_1.RUNNER_ERRORS; } });
|
|
10
|
+
Object.defineProperty(exports, "RunnerError", { enumerable: true, get: function () { return errors_1.RunnerError; } });
|
|
11
|
+
Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return errors_1.TimeoutError; } });
|
|
12
|
+
var frame_1 = require("./frame");
|
|
13
|
+
Object.defineProperty(exports, "Frame", { enumerable: true, get: function () { return frame_1.Frame; } });
|
|
14
|
+
var browserLauncherFactory_1 = require("./browserLauncherFactory");
|
|
15
|
+
Object.defineProperty(exports, "BrowserLauncherFactory", { enumerable: true, get: function () { return browserLauncherFactory_1.BrowserLauncherFactory; } });
|
|
16
|
+
var types_1 = require("./types");
|
|
17
|
+
Object.defineProperty(exports, "LifecycleEvent", { enumerable: true, get: function () { return types_1.LifecycleEvent; } });
|
|
@@ -0,0 +1,30 @@
|
|
|
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.BrowserLauncherFactory = void 0;
|
|
7
|
+
const playwrightBrowserLauncher_1 = require("./playwrightBrowserLauncher/playwrightBrowserLauncher");
|
|
8
|
+
const types_1 = require("./types");
|
|
9
|
+
const logUtils_1 = require("../util/logUtils");
|
|
10
|
+
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
11
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
12
|
+
class BrowserLauncherFactory {
|
|
13
|
+
static getRunnerFromEnvironment() {
|
|
14
|
+
var _a;
|
|
15
|
+
return (_a = process.env.MABL_RUNNER) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
16
|
+
}
|
|
17
|
+
static createRunner(runnerType = types_1.RunnerType.Playwright, loggerFunc) {
|
|
18
|
+
const runnerFromEnv = BrowserLauncherFactory.getRunnerFromEnvironment();
|
|
19
|
+
const runner = runnerFromEnv ? runnerFromEnv : runnerType;
|
|
20
|
+
loggerFunc =
|
|
21
|
+
loggerFunc !== null && loggerFunc !== void 0 ? loggerFunc : ((line) => (0, logUtils_1.logCliOutput)(loggingProvider_1.LogLevel.Info, line));
|
|
22
|
+
if (runner === types_1.RunnerType.Playwright) {
|
|
23
|
+
loggerFunc(chalk_1.default.cyan(`Browser launcher:`, chalk_1.default.magenta('Playwright')));
|
|
24
|
+
return new playwrightBrowserLauncher_1.PlaywrightBrowserLauncher();
|
|
25
|
+
}
|
|
26
|
+
loggerFunc(chalk_1.default.red.bold(`Unsupported runner type:`, runner));
|
|
27
|
+
throw new Error(`Unsupported runner type:[${runner}]`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.BrowserLauncherFactory = BrowserLauncherFactory;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isElementHandle = exports.commonFocusAndSelect = exports.getHighlightColor = exports.MAX_HIGHLIGHT_OPACITY = void 0;
|
|
4
|
+
exports.MAX_HIGHLIGHT_OPACITY = 0.9;
|
|
5
|
+
const getHighlightColor = (transparency) => ({
|
|
6
|
+
r: 196,
|
|
7
|
+
g: 68,
|
|
8
|
+
b: 183,
|
|
9
|
+
a: transparency,
|
|
10
|
+
});
|
|
11
|
+
exports.getHighlightColor = getHighlightColor;
|
|
12
|
+
function commonFocusAndSelect(element) {
|
|
13
|
+
return element.evaluate((element) => {
|
|
14
|
+
var _a;
|
|
15
|
+
element.focus();
|
|
16
|
+
(_a = element.select) === null || _a === void 0 ? void 0 : _a.call(element);
|
|
17
|
+
return element.value;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
exports.commonFocusAndSelect = commonFocusAndSelect;
|
|
21
|
+
function isElementHandle(value) {
|
|
22
|
+
return (value &&
|
|
23
|
+
typeof value === 'object' &&
|
|
24
|
+
typeof value.evaluate === 'function' &&
|
|
25
|
+
typeof value.focus === 'function' &&
|
|
26
|
+
typeof value.select === 'function' &&
|
|
27
|
+
typeof value.type === 'function' &&
|
|
28
|
+
typeof value.$x === 'function');
|
|
29
|
+
}
|
|
30
|
+
exports.isElementHandle = isElementHandle;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RUNNER_ERRORS = exports.NavigationInterruptedError = exports.TimeoutError = exports.RunnerError = void 0;
|
|
4
|
+
class RunnerError extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = this.constructor.name;
|
|
8
|
+
Error.captureStackTrace(this, this.constructor);
|
|
9
|
+
}
|
|
10
|
+
static isPlaywrightNavigationInterruptedError(error) {
|
|
11
|
+
const errorString = error.message.toLowerCase();
|
|
12
|
+
return (errorString.includes('interrupted by another navigation') &&
|
|
13
|
+
errorString.includes('frame.goto'));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.RunnerError = RunnerError;
|
|
17
|
+
class TimeoutError extends RunnerError {
|
|
18
|
+
}
|
|
19
|
+
exports.TimeoutError = TimeoutError;
|
|
20
|
+
class NavigationInterruptedError extends RunnerError {
|
|
21
|
+
}
|
|
22
|
+
exports.NavigationInterruptedError = NavigationInterruptedError;
|
|
23
|
+
exports.RUNNER_ERRORS = {
|
|
24
|
+
TimeoutError,
|
|
25
|
+
NavigationInterruptedError,
|
|
26
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Frame = void 0;
|
|
4
|
+
const frameBase_1 = require("./frameBase");
|
|
5
|
+
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
6
|
+
class Frame extends frameBase_1.FrameBase {
|
|
7
|
+
getFrameId() {
|
|
8
|
+
const frameId = this.id();
|
|
9
|
+
if (typeof frameId !== 'string' ||
|
|
10
|
+
frameId.length < 20 ||
|
|
11
|
+
frameId.length > 40) {
|
|
12
|
+
loggingProvider_1.logger.warn(`Warning: The frame ID value is unexpected. It was: ${frameId}`);
|
|
13
|
+
}
|
|
14
|
+
return frameId;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.Frame = Frame;
|
|
@@ -0,0 +1,10 @@
|
|
|
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.FrameBase = void 0;
|
|
7
|
+
const events_1 = __importDefault(require("events"));
|
|
8
|
+
class FrameBase extends events_1.default {
|
|
9
|
+
}
|
|
10
|
+
exports.FrameBase = FrameBase;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageEvent = void 0;
|
|
4
|
+
var PageEvent;
|
|
5
|
+
(function (PageEvent) {
|
|
6
|
+
PageEvent["Console"] = "console";
|
|
7
|
+
PageEvent["Error"] = "error";
|
|
8
|
+
PageEvent["FrameAttached"] = "frameattached";
|
|
9
|
+
PageEvent["FrameNavigated"] = "framenavigated";
|
|
10
|
+
PageEvent["PageError"] = "pageerror";
|
|
11
|
+
PageEvent["RequestWillBeSentExtraInfo"] = "requestwillbesentextrainfo";
|
|
12
|
+
PageEvent["Response"] = "response";
|
|
13
|
+
PageEvent["SecondaryWorldCreated"] = "secondaryworldcreated";
|
|
14
|
+
PageEvent["TracingBufferUsage"] = "tracingbufferusage";
|
|
15
|
+
PageEvent["TracingComplete"] = "tracingcomplete";
|
|
16
|
+
PageEvent["TracingDataCollected"] = "TracingDataCollected";
|
|
17
|
+
})(PageEvent || (exports.PageEvent = PageEvent = {}));
|
|
@@ -0,0 +1,61 @@
|
|
|
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.ChromiumBrowserDelegate = void 0;
|
|
27
|
+
const playwright = __importStar(require("playwright"));
|
|
28
|
+
const chromiumPageDelegate_1 = require("./chromiumPageDelegate");
|
|
29
|
+
class ChromiumBrowserDelegate {
|
|
30
|
+
constructor(context) {
|
|
31
|
+
this.context = context;
|
|
32
|
+
const contextImpl = playwright._toImpl(context);
|
|
33
|
+
this._browser = contextImpl._browser;
|
|
34
|
+
}
|
|
35
|
+
createPageDelegate(page) {
|
|
36
|
+
return new chromiumPageDelegate_1.ChromiumPageDelegate(page);
|
|
37
|
+
}
|
|
38
|
+
getCDPSession() {
|
|
39
|
+
return this._browser._connection.rootSession;
|
|
40
|
+
}
|
|
41
|
+
getBrowser() {
|
|
42
|
+
return this._browser;
|
|
43
|
+
}
|
|
44
|
+
async setDownloadBehavior(downloadDirectory) {
|
|
45
|
+
await this.getCDPSession().send('Browser.setDownloadBehavior', {
|
|
46
|
+
behavior: 'allow',
|
|
47
|
+
downloadPath: downloadDirectory,
|
|
48
|
+
eventsEnabled: true,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
downloadsUsingGuids() {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
supportsTracing() {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
supportsExposeFunction() {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.ChromiumBrowserDelegate = ChromiumBrowserDelegate;
|
|
@@ -0,0 +1,129 @@
|
|
|
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.ChromiumElementHandleDelegate = void 0;
|
|
27
|
+
const playwright = __importStar(require("playwright"));
|
|
28
|
+
const testsUtil_1 = require("../../../commands/tests/testsUtil");
|
|
29
|
+
const logUtils_1 = require("../../../util/logUtils");
|
|
30
|
+
const elementHandle_1 = require("../../elementHandle");
|
|
31
|
+
class ChromiumElementHandleDelegate {
|
|
32
|
+
constructor(elementHandle) {
|
|
33
|
+
this.elementHandle = elementHandle;
|
|
34
|
+
try {
|
|
35
|
+
this.elementImpl = playwright._toImpl(elementHandle);
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
(0, logUtils_1.logInternal)(`Unable to get the element handle's implementation. Error: ${e}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
getInnerText() {
|
|
42
|
+
return this.elementHandle.evaluate((el) => el.innerText);
|
|
43
|
+
}
|
|
44
|
+
focusAndSelect(element) {
|
|
45
|
+
return (0, elementHandle_1.commonFocusAndSelect)(element);
|
|
46
|
+
}
|
|
47
|
+
getElementImpl() {
|
|
48
|
+
return this.elementImpl;
|
|
49
|
+
}
|
|
50
|
+
checkCDPSession() {
|
|
51
|
+
var _a, _b, _c;
|
|
52
|
+
if (this.elementImpl === undefined) {
|
|
53
|
+
(0, logUtils_1.logInternal)(`Unable to get the Element's internal implementation. Some functionality, such as getting the clickable point or element highlighting might not work.`);
|
|
54
|
+
}
|
|
55
|
+
else if (this.getInternalCDPSession() === undefined) {
|
|
56
|
+
const undefinedField = ((_b = (_a = this.elementImpl) === null || _a === void 0 ? void 0 : _a._context) === null || _b === void 0 ? void 0 : _b._delegate) !== undefined
|
|
57
|
+
? '_client'
|
|
58
|
+
: ((_c = this.elementImpl) === null || _c === void 0 ? void 0 : _c._context) !== undefined
|
|
59
|
+
? '_delegate'
|
|
60
|
+
: '_context';
|
|
61
|
+
(0, logUtils_1.logInternal)(`Unable to get the CDP Session of the element handle. ${undefinedField} is undefined. Some functionality, such as element highlighting will not work.`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
getCDPSession() {
|
|
65
|
+
this.checkCDPSession();
|
|
66
|
+
return this.getInternalCDPSession();
|
|
67
|
+
}
|
|
68
|
+
async highlight(highlightDurationMillis, highlightPhases) {
|
|
69
|
+
var _a;
|
|
70
|
+
await this.enableDom();
|
|
71
|
+
await this.enableOverlay();
|
|
72
|
+
const nodeInfo = await ((_a = this.getInternalCDPSession()) === null || _a === void 0 ? void 0 : _a.send('DOM.describeNode', {
|
|
73
|
+
objectId: this.getRemoteObjectId(),
|
|
74
|
+
}));
|
|
75
|
+
if (!nodeInfo) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const highlightConfig = {
|
|
79
|
+
backendNodeId: nodeInfo.node.backendNodeId,
|
|
80
|
+
highlightConfig: {
|
|
81
|
+
borderColor: (0, elementHandle_1.getHighlightColor)(0),
|
|
82
|
+
contentColor: (0, elementHandle_1.getHighlightColor)(1),
|
|
83
|
+
colorFormat: 'rgb',
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
await this.fadeInOutHighlight(highlightConfig, highlightDurationMillis, highlightPhases);
|
|
87
|
+
await this.hideHighlight();
|
|
88
|
+
}
|
|
89
|
+
async fadeInOutHighlight(highlightConfig, highlightDurationMillis, highlightPhases) {
|
|
90
|
+
var _a, _b;
|
|
91
|
+
if (highlightPhases <= 0) {
|
|
92
|
+
throw new Error('Highlight phases must be greater than 0');
|
|
93
|
+
}
|
|
94
|
+
const phaseIntervalMilliseconds = highlightDurationMillis / highlightPhases;
|
|
95
|
+
for (let iteration = 0; iteration < highlightPhases; iteration++) {
|
|
96
|
+
if (((_a = highlightConfig.highlightConfig.contentColor) === null || _a === void 0 ? void 0 : _a.a) !== undefined) {
|
|
97
|
+
const x = iteration / highlightPhases;
|
|
98
|
+
highlightConfig.highlightConfig.contentColor.a =
|
|
99
|
+
x * (1 - x) * 4 * elementHandle_1.MAX_HIGHLIGHT_OPACITY;
|
|
100
|
+
}
|
|
101
|
+
await ((_b = this.getInternalCDPSession()) === null || _b === void 0 ? void 0 : _b.send('Overlay.highlightNode', highlightConfig));
|
|
102
|
+
await (0, testsUtil_1.sleep)(phaseIntervalMilliseconds);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async enableDom() {
|
|
106
|
+
var _a;
|
|
107
|
+
await ((_a = this.getInternalCDPSession()) === null || _a === void 0 ? void 0 : _a.send('DOM.enable'));
|
|
108
|
+
}
|
|
109
|
+
async enableOverlay() {
|
|
110
|
+
var _a;
|
|
111
|
+
await ((_a = this.getInternalCDPSession()) === null || _a === void 0 ? void 0 : _a.send('Overlay.enable'));
|
|
112
|
+
}
|
|
113
|
+
async hideHighlight() {
|
|
114
|
+
var _a;
|
|
115
|
+
await ((_a = this.getInternalCDPSession()) === null || _a === void 0 ? void 0 : _a.send('Overlay.hideHighlight'));
|
|
116
|
+
}
|
|
117
|
+
getRemoteObjectId() {
|
|
118
|
+
var _a, _b, _c;
|
|
119
|
+
if (((_a = this.getElementImpl()) === null || _a === void 0 ? void 0 : _a._objectId) === undefined) {
|
|
120
|
+
(0, logUtils_1.logInternal)('ObjectId of an element handle was not found.');
|
|
121
|
+
}
|
|
122
|
+
return (_c = (_b = this.getElementImpl()) === null || _b === void 0 ? void 0 : _b._objectId) !== null && _c !== void 0 ? _c : '';
|
|
123
|
+
}
|
|
124
|
+
getInternalCDPSession() {
|
|
125
|
+
var _a, _b, _c;
|
|
126
|
+
return (_c = (_b = (_a = this.elementImpl) === null || _a === void 0 ? void 0 : _a._context) === null || _b === void 0 ? void 0 : _b._delegate) === null || _c === void 0 ? void 0 : _c._client;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
exports.ChromiumElementHandleDelegate = ChromiumElementHandleDelegate;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChromiumFrameDelegate = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
|
+
class ChromiumFrameDelegate {
|
|
6
|
+
constructor(frame) {
|
|
7
|
+
this.frame = frame;
|
|
8
|
+
}
|
|
9
|
+
url() {
|
|
10
|
+
return Promise.resolve(this.frame.url());
|
|
11
|
+
}
|
|
12
|
+
addBindingToSecondaryWorld(_binding) {
|
|
13
|
+
return Promise.resolve();
|
|
14
|
+
}
|
|
15
|
+
getLifecycleEventStrategy(value) {
|
|
16
|
+
const waitForNetworkIdle = value === types_1.LifecycleEvent.NetworkIdle;
|
|
17
|
+
let waitUntil = value !== null && value !== void 0 ? value : types_1.LifecycleEvent.Load;
|
|
18
|
+
if (waitForNetworkIdle) {
|
|
19
|
+
waitUntil = types_1.LifecycleEvent.Load;
|
|
20
|
+
}
|
|
21
|
+
return { waitUntil, waitForNetworkIdle };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.ChromiumFrameDelegate = ChromiumFrameDelegate;
|
|
@@ -0,0 +1,145 @@
|
|
|
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.ChromiumPageDelegate = void 0;
|
|
27
|
+
const playwright = __importStar(require("playwright"));
|
|
28
|
+
const chromiumElementHandleDelegate_1 = require("./chromiumElementHandleDelegate");
|
|
29
|
+
const logUtils_1 = require("../../../util/logUtils");
|
|
30
|
+
const chromiumFrameDelegate_1 = require("./chromiumFrameDelegate");
|
|
31
|
+
class ChromiumPageDelegate {
|
|
32
|
+
constructor(page) {
|
|
33
|
+
this.page = page;
|
|
34
|
+
try {
|
|
35
|
+
this.pageImpl = playwright._toImpl(page);
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
(0, logUtils_1.logInternal)(`Unable to get the page implementation. Error: ${e}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async setFocusEmulationEnabled(enabled) {
|
|
42
|
+
await this.makeCDPCall('Emulation.setFocusEmulationEnabled', {
|
|
43
|
+
enabled,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async waitForInitialization() {
|
|
47
|
+
this.fallbackCDPSession = await this.createCDPSession();
|
|
48
|
+
}
|
|
49
|
+
makeCDPCall(method, paramArgs) {
|
|
50
|
+
return this.getCDPSession().send(method, paramArgs);
|
|
51
|
+
}
|
|
52
|
+
async getWindowInfo() {
|
|
53
|
+
var _a, _b;
|
|
54
|
+
return this.makeCDPCall('Browser.getWindowForTarget', { targetId: (_a = this.getTargetId()) !== null && _a !== void 0 ? _a : (_b = this.pageImpl) === null || _b === void 0 ? void 0 : _b._guid });
|
|
55
|
+
}
|
|
56
|
+
async getBrowserBounds() {
|
|
57
|
+
const windowInfo = await this.getWindowInfo();
|
|
58
|
+
return windowInfo.bounds;
|
|
59
|
+
}
|
|
60
|
+
async setBrowserBounds(width, height) {
|
|
61
|
+
const session = this.getCDPSession();
|
|
62
|
+
if (session) {
|
|
63
|
+
const windowInfo = await session.send('Browser.getWindowForTarget');
|
|
64
|
+
const setWindowBoundsRequest = {
|
|
65
|
+
windowId: windowInfo.windowId,
|
|
66
|
+
bounds: {
|
|
67
|
+
width,
|
|
68
|
+
height,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
await session.send('Browser.setWindowBounds', setWindowBoundsRequest);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
getCDPSession() {
|
|
75
|
+
var _a, _b, _c, _d;
|
|
76
|
+
this.checkCDPSession();
|
|
77
|
+
const session = (_d = (_c = (_b = (_a = this.pageImpl) === null || _a === void 0 ? void 0 : _a._delegate) === null || _b === void 0 ? void 0 : _b._mainFrameSession) === null || _c === void 0 ? void 0 : _c._client) !== null && _d !== void 0 ? _d : this.fallbackCDPSession;
|
|
78
|
+
if (!session) {
|
|
79
|
+
throw new Error('Unable to get the CDP Session of the page');
|
|
80
|
+
}
|
|
81
|
+
return session;
|
|
82
|
+
}
|
|
83
|
+
checkCDPSession() {
|
|
84
|
+
var _a, _b, _c, _d, _e, _f;
|
|
85
|
+
if (((_c = (_b = (_a = this.pageImpl) === null || _a === void 0 ? void 0 : _a._delegate) === null || _b === void 0 ? void 0 : _b._mainFrameSession) === null || _c === void 0 ? void 0 : _c._client) === undefined) {
|
|
86
|
+
const undefinedField = ((_e = (_d = this.pageImpl) === null || _d === void 0 ? void 0 : _d._delegate) === null || _e === void 0 ? void 0 : _e._mainFrameSession) !== undefined
|
|
87
|
+
? '_client'
|
|
88
|
+
: ((_f = this.pageImpl) === null || _f === void 0 ? void 0 : _f._delegate) !== undefined
|
|
89
|
+
? '_mainFrameSession'
|
|
90
|
+
: 'pageImpl';
|
|
91
|
+
(0, logUtils_1.logInternal)(`Unable to get the CDP Session of the page (${undefinedField} is undefined).
|
|
92
|
+
Using a fallback session. Some functionality might not work as expected.`);
|
|
93
|
+
if (!this.fallbackCDPSession) {
|
|
94
|
+
(0, logUtils_1.logInternal)('No fallback CDP session found');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
getTargetId() {
|
|
99
|
+
var _a, _b;
|
|
100
|
+
return (_b = (_a = this.pageImpl) === null || _a === void 0 ? void 0 : _a._delegate) === null || _b === void 0 ? void 0 : _b._targetId;
|
|
101
|
+
}
|
|
102
|
+
async createCDPSession() {
|
|
103
|
+
try {
|
|
104
|
+
return await this.page.context().newCDPSession(this.page);
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
(0, logUtils_1.logInternal)(`Unable to create a CDP session. Error: ${e}`);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
createElementHandleDelegate(element) {
|
|
112
|
+
return new chromiumElementHandleDelegate_1.ChromiumElementHandleDelegate(element);
|
|
113
|
+
}
|
|
114
|
+
createFrameDelegate(frame) {
|
|
115
|
+
return new chromiumFrameDelegate_1.ChromiumFrameDelegate(frame);
|
|
116
|
+
}
|
|
117
|
+
async enableScreencastMode() {
|
|
118
|
+
try {
|
|
119
|
+
const cdp = await this.createCDPSession();
|
|
120
|
+
if (cdp) {
|
|
121
|
+
cdp.on('Page.screencastFrame', async (params) => {
|
|
122
|
+
await cdp
|
|
123
|
+
.send('Page.screencastFrameAck', { sessionId: params.sessionId })
|
|
124
|
+
.catch(() => { });
|
|
125
|
+
});
|
|
126
|
+
await cdp.send('Page.startScreencast', {
|
|
127
|
+
everyNthFrame: 100,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch (e) {
|
|
132
|
+
(0, logUtils_1.logInternal)(`Unable to enable screencast mode. No CDP session found. Error: ${e}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async getContentAsMhtml() {
|
|
136
|
+
const document = await this.getCDPSession().send('Page.captureSnapshot', {
|
|
137
|
+
format: 'mhtml',
|
|
138
|
+
});
|
|
139
|
+
return Promise.resolve(document.data);
|
|
140
|
+
}
|
|
141
|
+
async resizeViewport() {
|
|
142
|
+
await this.makeCDPCall('Emulation.clearDeviceMetricsOverride');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
exports.ChromiumPageDelegate = ChromiumPageDelegate;
|
|
@@ -0,0 +1,50 @@
|
|
|
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.FirefoxBrowserDelegate = void 0;
|
|
27
|
+
const playwright = __importStar(require("playwright"));
|
|
28
|
+
const firefoxPageDelegate_1 = require("./firefoxPageDelegate");
|
|
29
|
+
const nonChromiumAbstractBrowserDelegate_1 = require("../nonChromium/nonChromiumAbstractBrowserDelegate");
|
|
30
|
+
class FirefoxBrowserDelegate extends nonChromiumAbstractBrowserDelegate_1.NonChromiumAbstractBrowserDelegate {
|
|
31
|
+
constructor(context) {
|
|
32
|
+
super();
|
|
33
|
+
this.context = context;
|
|
34
|
+
const contextImpl = playwright._toImpl(context);
|
|
35
|
+
this._browser = contextImpl._browser;
|
|
36
|
+
}
|
|
37
|
+
getBrowser() {
|
|
38
|
+
return this._browser;
|
|
39
|
+
}
|
|
40
|
+
createPageDelegate(page) {
|
|
41
|
+
return new firefoxPageDelegate_1.FirefoxPageDelegate(page);
|
|
42
|
+
}
|
|
43
|
+
getCDPSession() {
|
|
44
|
+
return this._browser._connection.rootSession;
|
|
45
|
+
}
|
|
46
|
+
supportsExposeFunction() {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.FirefoxBrowserDelegate = FirefoxBrowserDelegate;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FirefoxElementHandleDelegate = void 0;
|
|
4
|
+
const elementHandle_1 = require("../../elementHandle");
|
|
5
|
+
const nonChromiumAbstractElementHandleDelegate_1 = require("../nonChromium/nonChromiumAbstractElementHandleDelegate");
|
|
6
|
+
class FirefoxElementHandleDelegate extends nonChromiumAbstractElementHandleDelegate_1.NonChromiumAbstractElementHandleDelegate {
|
|
7
|
+
focusAndSelect(element) {
|
|
8
|
+
return (0, elementHandle_1.commonFocusAndSelect)(element);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.FirefoxElementHandleDelegate = FirefoxElementHandleDelegate;
|