@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,386 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ScrollStep_1 = require("../../steps/ScrollStep");
|
|
4
|
+
const ScrollStepDescriptor_1 = require("../../../types/mobile/ScrollStepDescriptor");
|
|
5
|
+
const StepTestsUtil_1 = require("../StepTestsUtil");
|
|
6
|
+
const domUtil_1 = require("../../../../domUtil");
|
|
7
|
+
describe('Scroll steps parse correctly', () => {
|
|
8
|
+
describe('ScrollType.ScrollDeviceScreen', () => {
|
|
9
|
+
it('Parses a ScrollDeviceScreen step', () => {
|
|
10
|
+
const windowSize = { width: 1440, height: 2392 };
|
|
11
|
+
const scrollStepDescriptor = {
|
|
12
|
+
description: 'Scroll down 94.06% of the screen',
|
|
13
|
+
id: 'scrolliePolieOlie',
|
|
14
|
+
coordinates: {
|
|
15
|
+
from: {
|
|
16
|
+
xPercent: 1074 / windowSize.width,
|
|
17
|
+
yPercent: 2350 / windowSize.height,
|
|
18
|
+
},
|
|
19
|
+
to: {
|
|
20
|
+
xPercent: 1074 / windowSize.width,
|
|
21
|
+
yPercent: 100 / windowSize.height,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
actionCode: 'scroll',
|
|
25
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
|
|
26
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
|
|
27
|
+
};
|
|
28
|
+
const steps = [
|
|
29
|
+
{
|
|
30
|
+
Scroll: scrollStepDescriptor,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, ScrollStep_1.ScrollStep.stepName, scrollStepDescriptor);
|
|
34
|
+
const scrollStep = new ScrollStep_1.ScrollStep(scrollStepDescriptor);
|
|
35
|
+
expect(scrollStep.stepId()).toEqual(scrollStepDescriptor.id);
|
|
36
|
+
});
|
|
37
|
+
it('Humanizes a ScrollDeviceScreen step', () => {
|
|
38
|
+
const windowSize = { width: 1440, height: 2392 };
|
|
39
|
+
const stepYaml = {
|
|
40
|
+
Scroll: {
|
|
41
|
+
coordinates: {
|
|
42
|
+
from: {
|
|
43
|
+
xPercent: 1074 / windowSize.width,
|
|
44
|
+
yPercent: 2350 / windowSize.height,
|
|
45
|
+
},
|
|
46
|
+
to: {
|
|
47
|
+
xPercent: 1074 / windowSize.width,
|
|
48
|
+
yPercent: 100 / windowSize.height,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
actionCode: 'scroll',
|
|
52
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
|
|
53
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
57
|
+
expect(step.stepDescription()).toEqual(`Scroll down 94.06% of the screen`);
|
|
58
|
+
});
|
|
59
|
+
it('Humanizes scroll directions as expected', () => {
|
|
60
|
+
const scrollUpStepYaml = {
|
|
61
|
+
Scroll: {
|
|
62
|
+
coordinates: {
|
|
63
|
+
from: {
|
|
64
|
+
xPercent: 0.109212,
|
|
65
|
+
yPercent: 0.241223,
|
|
66
|
+
},
|
|
67
|
+
to: {
|
|
68
|
+
xPercent: 0.145543,
|
|
69
|
+
yPercent: 0.865454,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
actionCode: 'scroll',
|
|
73
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Up,
|
|
74
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
const scrollUpStep = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(scrollUpStepYaml);
|
|
78
|
+
expect(scrollUpStep.stepDescription()).toEqual(`Scroll up 62.42% of the screen`);
|
|
79
|
+
const scrollDownStepYaml = {
|
|
80
|
+
Scroll: {
|
|
81
|
+
coordinates: {
|
|
82
|
+
from: {
|
|
83
|
+
xPercent: 0.48351,
|
|
84
|
+
yPercent: 0.89123,
|
|
85
|
+
},
|
|
86
|
+
to: {
|
|
87
|
+
xPercent: 0.4515,
|
|
88
|
+
yPercent: 0.0874,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
actionCode: 'scroll',
|
|
92
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
|
|
93
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
const scrollDownStep = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(scrollDownStepYaml);
|
|
97
|
+
expect(scrollDownStep.stepDescription()).toEqual(`Scroll down 80.38% of the screen`);
|
|
98
|
+
const scrollLeftStepYaml = {
|
|
99
|
+
Scroll: {
|
|
100
|
+
coordinates: {
|
|
101
|
+
from: {
|
|
102
|
+
xPercent: 0.08111,
|
|
103
|
+
yPercent: 0.46123,
|
|
104
|
+
},
|
|
105
|
+
to: {
|
|
106
|
+
xPercent: 0.90295,
|
|
107
|
+
yPercent: 0.4574,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
actionCode: 'scroll',
|
|
111
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Right,
|
|
112
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
const scrollLeftStep = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(scrollLeftStepYaml);
|
|
116
|
+
expect(scrollLeftStep.stepDescription()).toEqual(`Scroll left 82.18% of the screen`);
|
|
117
|
+
const scrollRightStepYaml = {
|
|
118
|
+
Scroll: {
|
|
119
|
+
coordinates: {
|
|
120
|
+
from: {
|
|
121
|
+
xPercent: 0.88111,
|
|
122
|
+
yPercent: 0.46123,
|
|
123
|
+
},
|
|
124
|
+
to: {
|
|
125
|
+
xPercent: 0.09295,
|
|
126
|
+
yPercent: 0.4574,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
actionCode: 'scroll',
|
|
130
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Left,
|
|
131
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
const scrollRightStep = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(scrollRightStepYaml);
|
|
135
|
+
expect(scrollRightStep.stepDescription()).toEqual(`Scroll right 78.82% of the screen`);
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
describe('ScrollType.ScrollToElement', () => {
|
|
139
|
+
const find = {
|
|
140
|
+
findType: domUtil_1.FindType.FIND_ONE,
|
|
141
|
+
findTarget: {
|
|
142
|
+
selector: {
|
|
143
|
+
iOS: {
|
|
144
|
+
name: 'Name field',
|
|
145
|
+
},
|
|
146
|
+
uuid: '',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
const innerFindTarget = {
|
|
151
|
+
findType: domUtil_1.FindType.FIND_ONE,
|
|
152
|
+
findTarget: {
|
|
153
|
+
selector: {
|
|
154
|
+
iOS: {
|
|
155
|
+
name: 'Email field',
|
|
156
|
+
},
|
|
157
|
+
uuid: '',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
it('Parses a ScrollToElement step', () => {
|
|
162
|
+
const scrollStepDescriptor = {
|
|
163
|
+
description: 'Scroll right a maximum of 6 times within the "Name field" element until the "Email field" element is visible',
|
|
164
|
+
id: 'scrollMe',
|
|
165
|
+
actionCode: 'scroll',
|
|
166
|
+
find,
|
|
167
|
+
maxScrollAttempts: 6,
|
|
168
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Right,
|
|
169
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollToElement,
|
|
170
|
+
targetElementDescriptor: innerFindTarget,
|
|
171
|
+
};
|
|
172
|
+
const steps = [
|
|
173
|
+
{
|
|
174
|
+
Scroll: scrollStepDescriptor,
|
|
175
|
+
},
|
|
176
|
+
];
|
|
177
|
+
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, ScrollStep_1.ScrollStep.stepName, scrollStepDescriptor);
|
|
178
|
+
const scrollStep = new ScrollStep_1.ScrollStep(scrollStepDescriptor);
|
|
179
|
+
expect(scrollStep.stepId()).toEqual(scrollStepDescriptor.id);
|
|
180
|
+
});
|
|
181
|
+
it('Humanizes ScrollToElement step with container element', () => {
|
|
182
|
+
const scrollStepDescriptor = {
|
|
183
|
+
id: 'scrollMe',
|
|
184
|
+
actionCode: 'scroll',
|
|
185
|
+
coordinates: {
|
|
186
|
+
from: {
|
|
187
|
+
xPercent: 0.109212,
|
|
188
|
+
yPercent: 0.241223,
|
|
189
|
+
},
|
|
190
|
+
to: {
|
|
191
|
+
xPercent: 0.145543,
|
|
192
|
+
yPercent: 0.865454,
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
find,
|
|
196
|
+
maxScrollAttempts: 6,
|
|
197
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Up,
|
|
198
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollToElement,
|
|
199
|
+
targetElementDescriptor: innerFindTarget,
|
|
200
|
+
};
|
|
201
|
+
const stepYaml = {
|
|
202
|
+
Scroll: scrollStepDescriptor,
|
|
203
|
+
};
|
|
204
|
+
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
205
|
+
expect(step.stepDescription()).toEqual(`Scroll up 62.42% a maximum of 6 times within the "Name field" element until the "Email field" element is visible`);
|
|
206
|
+
});
|
|
207
|
+
it('Humanizes ScrollToElement step without container element', () => {
|
|
208
|
+
const scrollStepDescriptor = {
|
|
209
|
+
id: 'scrollMe',
|
|
210
|
+
actionCode: 'scroll',
|
|
211
|
+
coordinates: {
|
|
212
|
+
from: {
|
|
213
|
+
xPercent: 0.109212,
|
|
214
|
+
yPercent: 0.241223,
|
|
215
|
+
},
|
|
216
|
+
to: {
|
|
217
|
+
xPercent: 0.145543,
|
|
218
|
+
yPercent: 0.865454,
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
maxScrollAttempts: 6,
|
|
222
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Up,
|
|
223
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollToElement,
|
|
224
|
+
targetElementDescriptor: innerFindTarget,
|
|
225
|
+
};
|
|
226
|
+
const stepYaml = {
|
|
227
|
+
Scroll: scrollStepDescriptor,
|
|
228
|
+
};
|
|
229
|
+
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
230
|
+
expect(step.stepDescription()).toEqual(`Scroll up 62.42% a maximum of 6 times within the screen until the "Email field" element is visible`);
|
|
231
|
+
});
|
|
232
|
+
it('Humanizes a legacy ScrollToElement step', () => {
|
|
233
|
+
const scrollStepDescriptor = {
|
|
234
|
+
id: 'scrollMe',
|
|
235
|
+
actionCode: 'scroll',
|
|
236
|
+
find,
|
|
237
|
+
maxScrollAttempts: 6,
|
|
238
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Right,
|
|
239
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollToElement,
|
|
240
|
+
targetElementDescriptor: innerFindTarget,
|
|
241
|
+
};
|
|
242
|
+
const stepYaml = {
|
|
243
|
+
Scroll: scrollStepDescriptor,
|
|
244
|
+
};
|
|
245
|
+
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
246
|
+
expect(step.stepDescription()).toEqual(`Scroll right a maximum of 6 times within the "Name field" element until the "Email field" element is visible`);
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
describe('ScrollType.ScrollWithinElement', () => {
|
|
250
|
+
const find = {
|
|
251
|
+
findType: domUtil_1.FindType.FIND_ONE,
|
|
252
|
+
findTarget: {
|
|
253
|
+
selector: {
|
|
254
|
+
iOS: {
|
|
255
|
+
name: 'Name field',
|
|
256
|
+
},
|
|
257
|
+
uuid: '',
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
it('Parses a ScrollWithinElement step', () => {
|
|
262
|
+
const scrollStepDescriptor = {
|
|
263
|
+
description: 'Scroll right 80% within the "Name field" element',
|
|
264
|
+
id: 'scrollMe',
|
|
265
|
+
actionCode: 'scroll',
|
|
266
|
+
coordinates: {
|
|
267
|
+
from: {
|
|
268
|
+
xPercent: 0.9,
|
|
269
|
+
yPercent: 0.6,
|
|
270
|
+
},
|
|
271
|
+
to: {
|
|
272
|
+
xPercent: 0.1,
|
|
273
|
+
yPercent: 0.5,
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
find,
|
|
277
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Left,
|
|
278
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollWithinElement,
|
|
279
|
+
};
|
|
280
|
+
const steps = [
|
|
281
|
+
{
|
|
282
|
+
Scroll: scrollStepDescriptor,
|
|
283
|
+
},
|
|
284
|
+
];
|
|
285
|
+
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, ScrollStep_1.ScrollStep.stepName, scrollStepDescriptor);
|
|
286
|
+
const scrollStep = new ScrollStep_1.ScrollStep(scrollStepDescriptor);
|
|
287
|
+
expect(scrollStep.stepId()).toEqual(scrollStepDescriptor.id);
|
|
288
|
+
});
|
|
289
|
+
it('Humanizes a ScrollWithinElement step', () => {
|
|
290
|
+
const scrollStepDescriptor = {
|
|
291
|
+
id: 'scrollMe',
|
|
292
|
+
actionCode: 'scroll',
|
|
293
|
+
coordinates: {
|
|
294
|
+
from: {
|
|
295
|
+
xPercent: 0.9,
|
|
296
|
+
yPercent: 0.6,
|
|
297
|
+
},
|
|
298
|
+
to: {
|
|
299
|
+
xPercent: 0.1,
|
|
300
|
+
yPercent: 0.5,
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
find,
|
|
304
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Left,
|
|
305
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollWithinElement,
|
|
306
|
+
};
|
|
307
|
+
const stepYaml = {
|
|
308
|
+
Scroll: scrollStepDescriptor,
|
|
309
|
+
};
|
|
310
|
+
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
311
|
+
expect(step.stepDescription()).toEqual(`Scroll right 80% within the "Name field" element`);
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
describe('getScrollDirectionAndPercentageFromCoordinates', () => {
|
|
316
|
+
it('returned default down 80% if no coordinates supplied', () => {
|
|
317
|
+
expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(undefined)).toEqual({
|
|
318
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
|
|
319
|
+
scrollPercent: '80%',
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
it('determines correct down direction and percentage', () => {
|
|
323
|
+
const scrollCoordinates = {
|
|
324
|
+
from: {
|
|
325
|
+
xPercent: 0.3,
|
|
326
|
+
yPercent: 0.75,
|
|
327
|
+
},
|
|
328
|
+
to: {
|
|
329
|
+
xPercent: 0.5,
|
|
330
|
+
yPercent: 0.25,
|
|
331
|
+
},
|
|
332
|
+
};
|
|
333
|
+
expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(scrollCoordinates)).toEqual({
|
|
334
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
|
|
335
|
+
scrollPercent: '50%',
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
it('determines correct up direction and percentage', () => {
|
|
339
|
+
const scrollCoordinates = {
|
|
340
|
+
from: {
|
|
341
|
+
xPercent: 0.7,
|
|
342
|
+
yPercent: 0,
|
|
343
|
+
},
|
|
344
|
+
to: {
|
|
345
|
+
xPercent: 0.4,
|
|
346
|
+
yPercent: 1,
|
|
347
|
+
},
|
|
348
|
+
};
|
|
349
|
+
expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(scrollCoordinates)).toEqual({
|
|
350
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Up,
|
|
351
|
+
scrollPercent: '100%',
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
it('determines correct right direction and percentage', () => {
|
|
355
|
+
const scrollCoordinates = {
|
|
356
|
+
from: {
|
|
357
|
+
xPercent: 0.95,
|
|
358
|
+
yPercent: 0.4,
|
|
359
|
+
},
|
|
360
|
+
to: {
|
|
361
|
+
xPercent: 0.12,
|
|
362
|
+
yPercent: 0.5,
|
|
363
|
+
},
|
|
364
|
+
};
|
|
365
|
+
expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(scrollCoordinates)).toEqual({
|
|
366
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Right,
|
|
367
|
+
scrollPercent: '83%',
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
it('determines correct left direction and percentage', () => {
|
|
371
|
+
const scrollCoordinates = {
|
|
372
|
+
from: {
|
|
373
|
+
xPercent: 0.04,
|
|
374
|
+
yPercent: 0.7,
|
|
375
|
+
},
|
|
376
|
+
to: {
|
|
377
|
+
xPercent: 0.82,
|
|
378
|
+
yPercent: 0.4,
|
|
379
|
+
},
|
|
380
|
+
};
|
|
381
|
+
expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(scrollCoordinates)).toEqual({
|
|
382
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Left,
|
|
383
|
+
scrollPercent: '78%',
|
|
384
|
+
});
|
|
385
|
+
});
|
|
386
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const SetOrientationStep_1 = require("../../steps/SetOrientationStep");
|
|
4
|
+
const SetOrientationStepDescriptor_1 = require("../../../types/mobile/SetOrientationStepDescriptor");
|
|
5
|
+
const StepTestsUtil_1 = require("../StepTestsUtil");
|
|
6
|
+
describe('SetOrientation steps parse correctly', () => {
|
|
7
|
+
it('Parses a SetOrientation step', () => {
|
|
8
|
+
const setOrientationStepDescriptor = {
|
|
9
|
+
id: 'theOrientalExpress',
|
|
10
|
+
orientation: SetOrientationStepDescriptor_1.Orientation.Landscape,
|
|
11
|
+
actionCode: 'set_orientation',
|
|
12
|
+
};
|
|
13
|
+
const steps = [
|
|
14
|
+
{
|
|
15
|
+
SetOrientation: setOrientationStepDescriptor,
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, SetOrientationStep_1.SetOrientationStep.stepName, setOrientationStepDescriptor);
|
|
19
|
+
const orientationStep = new SetOrientationStep_1.SetOrientationStep(setOrientationStepDescriptor);
|
|
20
|
+
expect(orientationStep.stepId()).toEqual(setOrientationStepDescriptor.id);
|
|
21
|
+
});
|
|
22
|
+
it('Humanizes a SetOrientation step', () => {
|
|
23
|
+
const stepYaml = {
|
|
24
|
+
SetOrientation: {
|
|
25
|
+
orientation: SetOrientationStepDescriptor_1.Orientation.Landscape,
|
|
26
|
+
actionCode: 'set_orientation',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
30
|
+
expect(step.stepDescription()).toEqual(`Set orientation of device to landscape`);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const TapStep_1 = require("../../steps/TapStep");
|
|
4
|
+
const domUtil_1 = require("../../../../domUtil");
|
|
5
|
+
const StepTestsUtil_1 = require("../StepTestsUtil");
|
|
6
|
+
const TapStepDescriptor_1 = require("../../../types/mobile/TapStepDescriptor");
|
|
7
|
+
const TestMobileFindDescriptors_1 = require("../TestMobileFindDescriptors");
|
|
8
|
+
describe('Tap steps parse correctly', () => {
|
|
9
|
+
it('Parses a Tap step with a Find One selector', () => {
|
|
10
|
+
const find = {
|
|
11
|
+
findType: domUtil_1.FindType.FIND_ONE,
|
|
12
|
+
findTarget: {
|
|
13
|
+
selector: {
|
|
14
|
+
iOS: {
|
|
15
|
+
name: '{{@varInFind}}',
|
|
16
|
+
},
|
|
17
|
+
uuid: '',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
const stepDescriptor = {
|
|
22
|
+
id: 'TappyMcTapperson',
|
|
23
|
+
find,
|
|
24
|
+
type: TapStepDescriptor_1.TapType.tap,
|
|
25
|
+
actionCode: 'tap',
|
|
26
|
+
};
|
|
27
|
+
const steps = [
|
|
28
|
+
{
|
|
29
|
+
Tap: stepDescriptor,
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, TapStep_1.TapStep.stepName, stepDescriptor);
|
|
33
|
+
const tapStep = new TapStep_1.TapStep(stepDescriptor);
|
|
34
|
+
expect(tapStep.stepId()).toEqual(stepDescriptor.id);
|
|
35
|
+
expect(tapStep.getInputVariables()).toStrictEqual(['varInFind']);
|
|
36
|
+
});
|
|
37
|
+
it('Parses a WebView Tap step', () => {
|
|
38
|
+
const stepDescriptor = {
|
|
39
|
+
find: TestMobileFindDescriptors_1.iOSWebViewTextFieldMobileFindDescriptor,
|
|
40
|
+
type: TapStepDescriptor_1.TapType.tap,
|
|
41
|
+
actionCode: 'tap',
|
|
42
|
+
};
|
|
43
|
+
const steps = [
|
|
44
|
+
{
|
|
45
|
+
Tap: stepDescriptor,
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, TapStep_1.TapStep.stepName, stepDescriptor);
|
|
49
|
+
});
|
|
50
|
+
it('Renders description for step without find', () => {
|
|
51
|
+
const stepDescriptor = {
|
|
52
|
+
type: TapStepDescriptor_1.TapType.tap,
|
|
53
|
+
};
|
|
54
|
+
const tapStep = new TapStep_1.TapStep(stepDescriptor);
|
|
55
|
+
expect(tapStep.stepDescription()).toEqual('Tap on unknown element');
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const UninstallAppStep_1 = require("../../steps/UninstallAppStep");
|
|
4
|
+
const StepTestsUtil_1 = require("../StepTestsUtil");
|
|
5
|
+
describe('Uninstall App steps parse correctly', () => {
|
|
6
|
+
it('Parses an UninstallApp step', () => {
|
|
7
|
+
const stepDescriptor = {
|
|
8
|
+
id: 'noAppForYou',
|
|
9
|
+
actionCode: 'uninstallApp',
|
|
10
|
+
};
|
|
11
|
+
const steps = [
|
|
12
|
+
{
|
|
13
|
+
UninstallApp: stepDescriptor,
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, UninstallAppStep_1.UninstallAppStep.stepName, stepDescriptor);
|
|
17
|
+
const tapStep = new UninstallAppStep_1.UninstallAppStep(stepDescriptor);
|
|
18
|
+
expect(tapStep.stepId()).toEqual(stepDescriptor.id);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbstractAssertionsAndVariablesStep = void 0;
|
|
4
|
+
const domUtil_1 = require("../../domUtil");
|
|
5
|
+
const MablAction_1 = require("../MablAction");
|
|
6
|
+
const MablStep_1 = require("../MablStep");
|
|
7
|
+
const ConditionDescriptor_1 = require("../types/ConditionDescriptor");
|
|
8
|
+
const AssertStep_1 = require("./AssertStep");
|
|
9
|
+
class AbstractAssertionsAndVariablesStep extends MablStep_1.MablStep {
|
|
10
|
+
constructor(name, args, actions, mablScriptName, stepName, descriptor) {
|
|
11
|
+
super(name, args, actions, mablScriptName);
|
|
12
|
+
this.stepName = stepName;
|
|
13
|
+
this.descriptor = descriptor;
|
|
14
|
+
}
|
|
15
|
+
getStepName() {
|
|
16
|
+
return this.stepName;
|
|
17
|
+
}
|
|
18
|
+
toStepDescriptor() {
|
|
19
|
+
var _a;
|
|
20
|
+
const formatted = JSON.parse(JSON.stringify(this.descriptor));
|
|
21
|
+
formatted.actionCode = this.actionCode;
|
|
22
|
+
(_a = formatted.assertions) === null || _a === void 0 ? void 0 : _a.forEach((assertion) => {
|
|
23
|
+
if (!(0, ConditionDescriptor_1.isComparisonType)(assertion.assertion)) {
|
|
24
|
+
throw new Error(`Invalid comparison type: ${assertion.assertion}`);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return formatted;
|
|
28
|
+
}
|
|
29
|
+
toMablscript() {
|
|
30
|
+
return `${this.getActionCode()}(${(0, domUtil_1.buildStepArgumentString)({
|
|
31
|
+
params: { ...this.descriptor },
|
|
32
|
+
legacy: true,
|
|
33
|
+
})})`;
|
|
34
|
+
}
|
|
35
|
+
getInputVariables() {
|
|
36
|
+
return MablAction_1.MablAction.findUniqueVariableReferencesInValue(this.descriptor);
|
|
37
|
+
}
|
|
38
|
+
getOutputVariables() {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
return (_b = (_a = this.descriptor.variables) === null || _a === void 0 ? void 0 : _a.map((variable) => variable.name)) !== null && _b !== void 0 ? _b : [];
|
|
41
|
+
}
|
|
42
|
+
canContinueOnFailure() {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
return (((_b = (_a = this.descriptor.options) === null || _a === void 0 ? void 0 : _a.onFailure) !== null && _b !== void 0 ? _b : AssertStep_1.OnFailure.FailImmediately) !==
|
|
45
|
+
AssertStep_1.OnFailure.FailImmediately);
|
|
46
|
+
}
|
|
47
|
+
canFailAtEnd() {
|
|
48
|
+
var _a;
|
|
49
|
+
return ((_a = this.descriptor.options) === null || _a === void 0 ? void 0 : _a.onFailure) === AssertStep_1.OnFailure.FailTestAtEnd;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.AbstractAssertionsAndVariablesStep = AbstractAssertionsAndVariablesStep;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccessibilityCheckStep = exports.AccessibilityCheckSeverity = void 0;
|
|
4
|
+
const MablStep_1 = require("../MablStep");
|
|
5
|
+
const FindAction_1 = require("../actions/FindAction");
|
|
6
|
+
const ActionsUtils_1 = require("./ActionsUtils");
|
|
7
|
+
const domUtil_1 = require("../../domUtil");
|
|
8
|
+
var AccessibilityCheckSeverity;
|
|
9
|
+
(function (AccessibilityCheckSeverity) {
|
|
10
|
+
AccessibilityCheckSeverity["Critical"] = "critical";
|
|
11
|
+
AccessibilityCheckSeverity["Minor"] = "minor";
|
|
12
|
+
AccessibilityCheckSeverity["Moderate"] = "moderate";
|
|
13
|
+
AccessibilityCheckSeverity["Serious"] = "serious";
|
|
14
|
+
})(AccessibilityCheckSeverity || (exports.AccessibilityCheckSeverity = AccessibilityCheckSeverity = {}));
|
|
15
|
+
class AccessibilityCheckStep extends MablStep_1.MablStep {
|
|
16
|
+
constructor(name, args, actions) {
|
|
17
|
+
super(name, args, actions, 'accessibility_check');
|
|
18
|
+
if (this.actions.length) {
|
|
19
|
+
this.findAction = ActionsUtils_1.ActionsUtils.validateSingleFindAction(this.actions);
|
|
20
|
+
}
|
|
21
|
+
this.checkConfig = this.getActionArgs()[0];
|
|
22
|
+
}
|
|
23
|
+
canContinueOnFailure() {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
getStepName() {
|
|
27
|
+
return AccessibilityCheckStep.yamlMablScriptNames[0];
|
|
28
|
+
}
|
|
29
|
+
toStepDescriptor() {
|
|
30
|
+
if (this.findAction) {
|
|
31
|
+
const find = this.findAction.toDescriptor();
|
|
32
|
+
switch (find.findType) {
|
|
33
|
+
case domUtil_1.FindType.FIND_FIRST:
|
|
34
|
+
case domUtil_1.FindType.FIND_LAST:
|
|
35
|
+
case domUtil_1.FindType.FIND_ANY:
|
|
36
|
+
case domUtil_1.FindType.FIND_ONE:
|
|
37
|
+
return {
|
|
38
|
+
...this.checkConfig,
|
|
39
|
+
find,
|
|
40
|
+
descriptorToActionMap: new Map().set(find, this),
|
|
41
|
+
actionCode: this.actionCode,
|
|
42
|
+
};
|
|
43
|
+
default:
|
|
44
|
+
throw new Error(`Error generating step descriptor for ${this.getStepName()}: Unexpected find type ${find.findType}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
actionCode: this.actionCode,
|
|
49
|
+
...this.checkConfig,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
getFormattedStep(_fullLocatorsOn) {
|
|
53
|
+
let finalStep;
|
|
54
|
+
if (this.findAction) {
|
|
55
|
+
finalStep = {
|
|
56
|
+
AccessibilityCheck: {
|
|
57
|
+
...super.annotationsAsYml(),
|
|
58
|
+
...this.findAction.toYaml(),
|
|
59
|
+
...this.checkConfig,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
finalStep = {
|
|
65
|
+
AccessibilityCheck: {
|
|
66
|
+
...super.annotationsAsYml(),
|
|
67
|
+
...this.checkConfig,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (this.stepId()) {
|
|
72
|
+
finalStep.AccessibilityCheck.id = this.stepId();
|
|
73
|
+
}
|
|
74
|
+
return finalStep;
|
|
75
|
+
}
|
|
76
|
+
static fromYaml(_stepName, stepArgs) {
|
|
77
|
+
const actions = [];
|
|
78
|
+
if (stepArgs.selector) {
|
|
79
|
+
actions.push(FindAction_1.FindAction.findActionFromStepArgs(stepArgs));
|
|
80
|
+
}
|
|
81
|
+
const checkConfig = {
|
|
82
|
+
tags: stepArgs.tags,
|
|
83
|
+
rules: stepArgs.rules,
|
|
84
|
+
disabledRules: stepArgs.disabledRules,
|
|
85
|
+
failOn: stepArgs.failOn,
|
|
86
|
+
};
|
|
87
|
+
const step = new AccessibilityCheckStep(AccessibilityCheckStep.mablScriptStepNames[0], [checkConfig], actions);
|
|
88
|
+
step.setStepId(stepArgs.id);
|
|
89
|
+
return step;
|
|
90
|
+
}
|
|
91
|
+
toMablscript() {
|
|
92
|
+
var _a, _b, _c;
|
|
93
|
+
let argString = '';
|
|
94
|
+
if (((_a = this.checkConfig) === null || _a === void 0 ? void 0 : _a.tags) ||
|
|
95
|
+
((_b = this.checkConfig) === null || _b === void 0 ? void 0 : _b.disabledRules) ||
|
|
96
|
+
((_c = this.checkConfig) === null || _c === void 0 ? void 0 : _c.rules)) {
|
|
97
|
+
argString = `{${(0, MablStep_1.buildObjectString)(this.checkConfig)}}`;
|
|
98
|
+
}
|
|
99
|
+
let findAction = '';
|
|
100
|
+
if (this.findAction) {
|
|
101
|
+
findAction = `${this.findAction.toMablscript()}.`;
|
|
102
|
+
}
|
|
103
|
+
return `${findAction}${AccessibilityCheckStep.mablScriptStepNames[0]}(${argString})`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.AccessibilityCheckStep = AccessibilityCheckStep;
|
|
107
|
+
AccessibilityCheckStep.mablScriptStepNames = ['accessibility_check'];
|
|
108
|
+
AccessibilityCheckStep.yamlMablScriptNames = ['AccessibilityCheck'];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionsUtils = void 0;
|
|
4
|
+
const FindAction_1 = require("../actions/FindAction");
|
|
5
|
+
var ActionsUtils;
|
|
6
|
+
(function (ActionsUtils) {
|
|
7
|
+
function validateSingleFindAction(actions) {
|
|
8
|
+
if (actions.length !== 1) {
|
|
9
|
+
throw new Error('Expected only one action argument.');
|
|
10
|
+
}
|
|
11
|
+
const action = actions[0];
|
|
12
|
+
if (action instanceof FindAction_1.FindAction) {
|
|
13
|
+
return action;
|
|
14
|
+
}
|
|
15
|
+
throw new Error('The action must be a FindAction.');
|
|
16
|
+
}
|
|
17
|
+
ActionsUtils.validateSingleFindAction = validateSingleFindAction;
|
|
18
|
+
})(ActionsUtils || (exports.ActionsUtils = ActionsUtils = {}));
|