@eclipse-che/che-e2e 7.39.0
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/README.md +86 -0
- package/TestConstants.ts +263 -0
- package/TimeoutConstants.ts +220 -0
- package/dist/TestConstants.d.ts +206 -0
- package/dist/TestConstants.d.ts.map +1 -0
- package/dist/TestConstants.js +216 -0
- package/dist/TestConstants.js.map +1 -0
- package/dist/TimeoutConstants.d.ts +164 -0
- package/dist/TimeoutConstants.d.ts.map +1 -0
- package/dist/TimeoutConstants.js +175 -0
- package/dist/TimeoutConstants.js.map +1 -0
- package/dist/driver/CheReporter.d.ts +18 -0
- package/dist/driver/CheReporter.d.ts.map +1 -0
- package/dist/driver/CheReporter.js +180 -0
- package/dist/driver/CheReporter.js.map +1 -0
- package/dist/driver/ChromeDriver.d.ts +21 -0
- package/dist/driver/ChromeDriver.d.ts.map +1 -0
- package/dist/driver/ChromeDriver.js +75 -0
- package/dist/driver/ChromeDriver.js.map +1 -0
- package/dist/driver/IDriver.d.ts +14 -0
- package/dist/driver/IDriver.d.ts.map +1 -0
- package/dist/driver/IDriver.js +3 -0
- package/dist/driver/IDriver.js.map +1 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +92 -0
- package/dist/index.js.map +1 -0
- package/dist/inversify.config.d.ts +13 -0
- package/dist/inversify.config.d.ts.map +1 -0
- package/dist/inversify.config.js +126 -0
- package/dist/inversify.config.js.map +1 -0
- package/dist/inversify.types.d.ts +68 -0
- package/dist/inversify.types.d.ts.map +1 -0
- package/dist/inversify.types.js +72 -0
- package/dist/inversify.types.js.map +1 -0
- package/dist/pageobjects/dashboard/CreateWorkspace.d.ts +20 -0
- package/dist/pageobjects/dashboard/CreateWorkspace.d.ts.map +1 -0
- package/dist/pageobjects/dashboard/CreateWorkspace.js +65 -0
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -0
- package/dist/pageobjects/dashboard/Dashboard.d.ts +24 -0
- package/dist/pageobjects/dashboard/Dashboard.d.ts.map +1 -0
- package/dist/pageobjects/dashboard/Dashboard.js +111 -0
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -0
- package/dist/pageobjects/dashboard/Workspaces.d.ts +44 -0
- package/dist/pageobjects/dashboard/Workspaces.d.ts.map +1 -0
- package/dist/pageobjects/dashboard/Workspaces.js +157 -0
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -0
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.d.ts +42 -0
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.d.ts.map +1 -0
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +138 -0
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -0
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.d.ts +29 -0
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.d.ts.map +1 -0
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.js +97 -0
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.js.map +1 -0
- package/dist/pageobjects/ide/ContextMenu.d.ts +22 -0
- package/dist/pageobjects/ide/ContextMenu.d.ts.map +1 -0
- package/dist/pageobjects/ide/ContextMenu.js +66 -0
- package/dist/pageobjects/ide/ContextMenu.js.map +1 -0
- package/dist/pageobjects/ide/DebugView.d.ts +32 -0
- package/dist/pageobjects/ide/DebugView.d.ts.map +1 -0
- package/dist/pageobjects/ide/DebugView.js +98 -0
- package/dist/pageobjects/ide/DebugView.js.map +1 -0
- package/dist/pageobjects/ide/DialogWindow.d.ts +28 -0
- package/dist/pageobjects/ide/DialogWindow.d.ts.map +1 -0
- package/dist/pageobjects/ide/DialogWindow.js +102 -0
- package/dist/pageobjects/ide/DialogWindow.js.map +1 -0
- package/dist/pageobjects/ide/Editor.d.ts +78 -0
- package/dist/pageobjects/ide/Editor.d.ts.map +1 -0
- package/dist/pageobjects/ide/Editor.js +463 -0
- package/dist/pageobjects/ide/Editor.js.map +1 -0
- package/dist/pageobjects/ide/Ide.d.ts +61 -0
- package/dist/pageobjects/ide/Ide.d.ts.map +1 -0
- package/dist/pageobjects/ide/Ide.js +312 -0
- package/dist/pageobjects/ide/Ide.js.map +1 -0
- package/dist/pageobjects/ide/LeftToolBar.d.ts +23 -0
- package/dist/pageobjects/ide/LeftToolBar.d.ts.map +1 -0
- package/dist/pageobjects/ide/LeftToolBar.js +81 -0
- package/dist/pageobjects/ide/LeftToolBar.js.map +1 -0
- package/dist/pageobjects/ide/NavigationBar.d.ts +9 -0
- package/dist/pageobjects/ide/NavigationBar.d.ts.map +1 -0
- package/dist/pageobjects/ide/NavigationBar.js +57 -0
- package/dist/pageobjects/ide/NavigationBar.js.map +1 -0
- package/dist/pageobjects/ide/NotificationCenter.d.ts +22 -0
- package/dist/pageobjects/ide/NotificationCenter.d.ts.map +1 -0
- package/dist/pageobjects/ide/NotificationCenter.js +76 -0
- package/dist/pageobjects/ide/NotificationCenter.js.map +1 -0
- package/dist/pageobjects/ide/OpenDialogWidget.d.ts +36 -0
- package/dist/pageobjects/ide/OpenDialogWidget.d.ts.map +1 -0
- package/dist/pageobjects/ide/OpenDialogWidget.js +100 -0
- package/dist/pageobjects/ide/OpenDialogWidget.js.map +1 -0
- package/dist/pageobjects/ide/OpenWorkspaceWidget.d.ts +17 -0
- package/dist/pageobjects/ide/OpenWorkspaceWidget.d.ts.map +1 -0
- package/dist/pageobjects/ide/OpenWorkspaceWidget.js +62 -0
- package/dist/pageobjects/ide/OpenWorkspaceWidget.js.map +1 -0
- package/dist/pageobjects/ide/PreviewWidget.d.ts +35 -0
- package/dist/pageobjects/ide/PreviewWidget.d.ts.map +1 -0
- package/dist/pageobjects/ide/PreviewWidget.js +127 -0
- package/dist/pageobjects/ide/PreviewWidget.js.map +1 -0
- package/dist/pageobjects/ide/ProjectTree.d.ts +53 -0
- package/dist/pageobjects/ide/ProjectTree.d.ts.map +1 -0
- package/dist/pageobjects/ide/ProjectTree.js +275 -0
- package/dist/pageobjects/ide/ProjectTree.js.map +1 -0
- package/dist/pageobjects/ide/QuickOpenContainer.d.ts +20 -0
- package/dist/pageobjects/ide/QuickOpenContainer.d.ts.map +1 -0
- package/dist/pageobjects/ide/QuickOpenContainer.js +70 -0
- package/dist/pageobjects/ide/QuickOpenContainer.js.map +1 -0
- package/dist/pageobjects/ide/RightToolBar.d.ts +8 -0
- package/dist/pageobjects/ide/RightToolBar.d.ts.map +1 -0
- package/dist/pageobjects/ide/RightToolBar.js +51 -0
- package/dist/pageobjects/ide/RightToolBar.js.map +1 -0
- package/dist/pageobjects/ide/Terminal.d.ts +36 -0
- package/dist/pageobjects/ide/Terminal.d.ts.map +1 -0
- package/dist/pageobjects/ide/Terminal.js +204 -0
- package/dist/pageobjects/ide/Terminal.js.map +1 -0
- package/dist/pageobjects/ide/TopMenu.d.ts +28 -0
- package/dist/pageobjects/ide/TopMenu.d.ts.map +1 -0
- package/dist/pageobjects/ide/TopMenu.js +109 -0
- package/dist/pageobjects/ide/TopMenu.js.map +1 -0
- package/dist/pageobjects/ide/plugins/GitHubPullRequestPlugin.d.ts +36 -0
- package/dist/pageobjects/ide/plugins/GitHubPullRequestPlugin.d.ts.map +1 -0
- package/dist/pageobjects/ide/plugins/GitHubPullRequestPlugin.js +128 -0
- package/dist/pageobjects/ide/plugins/GitHubPullRequestPlugin.js.map +1 -0
- package/dist/pageobjects/ide/plugins/GitPlugin.d.ts +35 -0
- package/dist/pageobjects/ide/plugins/GitPlugin.d.ts.map +1 -0
- package/dist/pageobjects/ide/plugins/GitPlugin.js +120 -0
- package/dist/pageobjects/ide/plugins/GitPlugin.js.map +1 -0
- package/dist/pageobjects/ide/plugins/KubernetesPlugin.d.ts +32 -0
- package/dist/pageobjects/ide/plugins/KubernetesPlugin.d.ts.map +1 -0
- package/dist/pageobjects/ide/plugins/KubernetesPlugin.js +107 -0
- package/dist/pageobjects/ide/plugins/KubernetesPlugin.js.map +1 -0
- package/dist/pageobjects/ide/plugins/OpenshiftPlugin.d.ts +38 -0
- package/dist/pageobjects/ide/plugins/OpenshiftPlugin.d.ts.map +1 -0
- package/dist/pageobjects/ide/plugins/OpenshiftPlugin.js +99 -0
- package/dist/pageobjects/ide/plugins/OpenshiftPlugin.js.map +1 -0
- package/dist/pageobjects/ide/plugins/PluginsView.d.ts +43 -0
- package/dist/pageobjects/ide/plugins/PluginsView.d.ts.map +1 -0
- package/dist/pageobjects/ide/plugins/PluginsView.js +166 -0
- package/dist/pageobjects/ide/plugins/PluginsView.js.map +1 -0
- package/dist/pageobjects/login/ICheLoginPage.d.ts +13 -0
- package/dist/pageobjects/login/ICheLoginPage.d.ts.map +1 -0
- package/dist/pageobjects/login/ICheLoginPage.js +12 -0
- package/dist/pageobjects/login/ICheLoginPage.js.map +1 -0
- package/dist/pageobjects/login/IOcpLoginPage.d.ts +13 -0
- package/dist/pageobjects/login/IOcpLoginPage.d.ts.map +1 -0
- package/dist/pageobjects/login/IOcpLoginPage.js +12 -0
- package/dist/pageobjects/login/IOcpLoginPage.js.map +1 -0
- package/dist/pageobjects/login/MultiUserLoginPage.d.ts +18 -0
- package/dist/pageobjects/login/MultiUserLoginPage.d.ts.map +1 -0
- package/dist/pageobjects/login/MultiUserLoginPage.js +49 -0
- package/dist/pageobjects/login/MultiUserLoginPage.js.map +1 -0
- package/dist/pageobjects/login/OcpUserLoginPage.d.ts +18 -0
- package/dist/pageobjects/login/OcpUserLoginPage.d.ts.map +1 -0
- package/dist/pageobjects/login/OcpUserLoginPage.js +53 -0
- package/dist/pageobjects/login/OcpUserLoginPage.js.map +1 -0
- package/dist/pageobjects/login/RegularUserOcpCheLoginPage.d.ts +20 -0
- package/dist/pageobjects/login/RegularUserOcpCheLoginPage.d.ts.map +1 -0
- package/dist/pageobjects/login/RegularUserOcpCheLoginPage.js +75 -0
- package/dist/pageobjects/login/RegularUserOcpCheLoginPage.js.map +1 -0
- package/dist/pageobjects/login/UpdateAccountInformationPage.d.ts +24 -0
- package/dist/pageobjects/login/UpdateAccountInformationPage.d.ts.map +1 -0
- package/dist/pageobjects/login/UpdateAccountInformationPage.js +74 -0
- package/dist/pageobjects/login/UpdateAccountInformationPage.js.map +1 -0
- package/dist/pageobjects/openshift/CheLoginPage.d.ts +27 -0
- package/dist/pageobjects/openshift/CheLoginPage.d.ts.map +1 -0
- package/dist/pageobjects/openshift/CheLoginPage.js +88 -0
- package/dist/pageobjects/openshift/CheLoginPage.js.map +1 -0
- package/dist/pageobjects/openshift/OcpLoginPage.d.ts +30 -0
- package/dist/pageobjects/openshift/OcpLoginPage.d.ts.map +1 -0
- package/dist/pageobjects/openshift/OcpLoginPage.js +106 -0
- package/dist/pageobjects/openshift/OcpLoginPage.js.map +1 -0
- package/dist/pageobjects/third-parties/GitLoginPage.d.ts +27 -0
- package/dist/pageobjects/third-parties/GitLoginPage.d.ts.map +1 -0
- package/dist/pageobjects/third-parties/GitLoginPage.js +85 -0
- package/dist/pageobjects/third-parties/GitLoginPage.js.map +1 -0
- package/dist/pageobjects/third-parties/GitOauthAppsSettings.d.ts +33 -0
- package/dist/pageobjects/third-parties/GitOauthAppsSettings.d.ts.map +1 -0
- package/dist/pageobjects/third-parties/GitOauthAppsSettings.js +110 -0
- package/dist/pageobjects/third-parties/GitOauthAppsSettings.js.map +1 -0
- package/dist/tests/devfiles/CSlashCPlusPlus.spec.d.ts +12 -0
- package/dist/tests/devfiles/CSlashCPlusPlus.spec.d.ts.map +1 -0
- package/dist/tests/devfiles/CSlashCPlusPlus.spec.js +74 -0
- package/dist/tests/devfiles/CSlashCPlusPlus.spec.js.map +1 -0
- package/dist/tests/devfiles/DevfileSmoke.spec.d.ts +11 -0
- package/dist/tests/devfiles/DevfileSmoke.spec.d.ts.map +1 -0
- package/dist/tests/devfiles/DevfileSmoke.spec.js +48 -0
- package/dist/tests/devfiles/DevfileSmoke.spec.js.map +1 -0
- package/dist/tests/devfiles/DotNetCore.spec.d.ts +12 -0
- package/dist/tests/devfiles/DotNetCore.spec.d.ts.map +1 -0
- package/dist/tests/devfiles/DotNetCore.spec.js +82 -0
- package/dist/tests/devfiles/DotNetCore.spec.js.map +1 -0
- package/dist/tests/devfiles/Go.spec.d.ts +2 -0
- package/dist/tests/devfiles/Go.spec.d.ts.map +1 -0
- package/dist/tests/devfiles/Go.spec.js +73 -0
- package/dist/tests/devfiles/Go.spec.js.map +1 -0
- package/dist/tests/devfiles/JavaMaven.spec.d.ts +11 -0
- package/dist/tests/devfiles/JavaMaven.spec.d.ts.map +1 -0
- package/dist/tests/devfiles/JavaMaven.spec.js +61 -0
- package/dist/tests/devfiles/JavaMaven.spec.js.map +1 -0
- package/dist/tests/devfiles/JavaSpringBoot.spec.d.ts +11 -0
- package/dist/tests/devfiles/JavaSpringBoot.spec.d.ts.map +1 -0
- package/dist/tests/devfiles/JavaSpringBoot.spec.js +67 -0
- package/dist/tests/devfiles/JavaSpringBoot.spec.js.map +1 -0
- package/dist/tests/devfiles/JavaVertx.spec.d.ts +11 -0
- package/dist/tests/devfiles/JavaVertx.spec.d.ts.map +1 -0
- package/dist/tests/devfiles/JavaVertx.spec.js +61 -0
- package/dist/tests/devfiles/JavaVertx.spec.js.map +1 -0
- package/dist/tests/devfiles/NodeJS.spec.d.ts +2 -0
- package/dist/tests/devfiles/NodeJS.spec.d.ts.map +1 -0
- package/dist/tests/devfiles/NodeJS.spec.js +65 -0
- package/dist/tests/devfiles/NodeJS.spec.js.map +1 -0
- package/dist/tests/devfiles/PHPSimple.spec.d.ts +12 -0
- package/dist/tests/devfiles/PHPSimple.spec.d.ts.map +1 -0
- package/dist/tests/devfiles/PHPSimple.spec.js +75 -0
- package/dist/tests/devfiles/PHPSimple.spec.js.map +1 -0
- package/dist/tests/devfiles/Python.spec.d.ts +2 -0
- package/dist/tests/devfiles/Python.spec.d.ts.map +1 -0
- package/dist/tests/devfiles/Python.spec.js +59 -0
- package/dist/tests/devfiles/Python.spec.js.map +1 -0
- package/dist/tests/devfiles/PythonDjango.spec.d.ts +2 -0
- package/dist/tests/devfiles/PythonDjango.spec.d.ts.map +1 -0
- package/dist/tests/devfiles/PythonDjango.spec.js +62 -0
- package/dist/tests/devfiles/PythonDjango.spec.js.map +1 -0
- package/dist/tests/devfiles/Quarkus.spec.d.ts +2 -0
- package/dist/tests/devfiles/Quarkus.spec.d.ts.map +1 -0
- package/dist/tests/devfiles/Quarkus.spec.js +70 -0
- package/dist/tests/devfiles/Quarkus.spec.js.map +1 -0
- package/dist/tests/devfiles/Scala.spec.d.ts +11 -0
- package/dist/tests/devfiles/Scala.spec.d.ts.map +1 -0
- package/dist/tests/devfiles/Scala.spec.js +67 -0
- package/dist/tests/devfiles/Scala.spec.js.map +1 -0
- package/dist/tests/e2e/FactoryUrl.spec.d.ts +2 -0
- package/dist/tests/e2e/FactoryUrl.spec.d.ts.map +1 -0
- package/dist/tests/e2e/FactoryUrl.spec.js +45 -0
- package/dist/tests/e2e/FactoryUrl.spec.js.map +1 -0
- package/dist/tests/e2e/GitPublishBranch.spec.d.ts +11 -0
- package/dist/tests/e2e/GitPublishBranch.spec.d.ts.map +1 -0
- package/dist/tests/e2e/GitPublishBranch.spec.js +88 -0
- package/dist/tests/e2e/GitPublishBranch.spec.js.map +1 -0
- package/dist/tests/e2e/GitSelfSignCert.spec.d.ts +11 -0
- package/dist/tests/e2e/GitSelfSignCert.spec.d.ts.map +1 -0
- package/dist/tests/e2e/GitSelfSignCert.spec.js +83 -0
- package/dist/tests/e2e/GitSelfSignCert.spec.js.map +1 -0
- package/dist/tests/e2e/GitSsh.spec.d.ts +11 -0
- package/dist/tests/e2e/GitSsh.spec.d.ts.map +1 -0
- package/dist/tests/e2e/GitSsh.spec.js +118 -0
- package/dist/tests/e2e/GitSsh.spec.js.map +1 -0
- package/dist/tests/e2e/OpenshiftConnector.spec.d.ts +11 -0
- package/dist/tests/e2e/OpenshiftConnector.spec.d.ts.map +1 -0
- package/dist/tests/e2e/OpenshiftConnector.spec.js +122 -0
- package/dist/tests/e2e/OpenshiftConnector.spec.js.map +1 -0
- package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.d.ts +2 -0
- package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.d.ts.map +1 -0
- package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js +53 -0
- package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js.map +1 -0
- package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.d.ts +2 -0
- package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.d.ts.map +1 -0
- package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js +51 -0
- package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js.map +1 -0
- package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.d.ts +2 -0
- package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.d.ts.map +1 -0
- package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js +51 -0
- package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js.map +1 -0
- package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.d.ts +2 -0
- package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.d.ts.map +1 -0
- package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js +200 -0
- package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js.map +1 -0
- package/dist/tests/e2e_happy_path/HappyPath.spec.d.ts +11 -0
- package/dist/tests/e2e_happy_path/HappyPath.spec.d.ts.map +1 -0
- package/dist/tests/e2e_happy_path/HappyPath.spec.js +309 -0
- package/dist/tests/e2e_happy_path/HappyPath.spec.js.map +1 -0
- package/dist/tests/intelij/IntelijOpenWorkspace.spec.d.ts +11 -0
- package/dist/tests/intelij/IntelijOpenWorkspace.spec.d.ts.map +1 -0
- package/dist/tests/intelij/IntelijOpenWorkspace.spec.js +43 -0
- package/dist/tests/intelij/IntelijOpenWorkspace.spec.js.map +1 -0
- package/dist/tests/load_test/LoadTest.spec.d.ts +11 -0
- package/dist/tests/load_test/LoadTest.spec.d.ts.map +1 -0
- package/dist/tests/load_test/LoadTest.spec.js +44 -0
- package/dist/tests/load_test/LoadTest.spec.js.map +1 -0
- package/dist/tests/login/LinkCheAndOcpUsers.spec.d.ts +11 -0
- package/dist/tests/login/LinkCheAndOcpUsers.spec.d.ts.map +1 -0
- package/dist/tests/login/LinkCheAndOcpUsers.spec.js +39 -0
- package/dist/tests/login/LinkCheAndOcpUsers.spec.js.map +1 -0
- package/dist/tests/login/Login.spec.d.ts +11 -0
- package/dist/tests/login/Login.spec.d.ts.map +1 -0
- package/dist/tests/login/Login.spec.js +26 -0
- package/dist/tests/login/Login.spec.js.map +1 -0
- package/dist/tests/plugins/GitHubPullRequestPlugin.spec.d.ts +11 -0
- package/dist/tests/plugins/GitHubPullRequestPlugin.spec.d.ts.map +1 -0
- package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js +122 -0
- package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js.map +1 -0
- package/dist/tests/plugins/InstallPluginUsingUI.spec.d.ts +11 -0
- package/dist/tests/plugins/InstallPluginUsingUI.spec.d.ts.map +1 -0
- package/dist/tests/plugins/InstallPluginUsingUI.spec.js +69 -0
- package/dist/tests/plugins/InstallPluginUsingUI.spec.js.map +1 -0
- package/dist/tests/plugins/JavaPlugin.spec.d.ts +2 -0
- package/dist/tests/plugins/JavaPlugin.spec.d.ts.map +1 -0
- package/dist/tests/plugins/JavaPlugin.spec.js +82 -0
- package/dist/tests/plugins/JavaPlugin.spec.js.map +1 -0
- package/dist/tests/plugins/PhpPlugin.spec.d.ts +2 -0
- package/dist/tests/plugins/PhpPlugin.spec.d.ts.map +1 -0
- package/dist/tests/plugins/PhpPlugin.spec.js +94 -0
- package/dist/tests/plugins/PhpPlugin.spec.js.map +1 -0
- package/dist/tests/plugins/PythonPlugin.spec.d.ts +11 -0
- package/dist/tests/plugins/PythonPlugin.spec.d.ts.map +1 -0
- package/dist/tests/plugins/PythonPlugin.spec.js +80 -0
- package/dist/tests/plugins/PythonPlugin.spec.js.map +1 -0
- package/dist/tests/plugins/TypescriptPlugin.spec.d.ts +11 -0
- package/dist/tests/plugins/TypescriptPlugin.spec.d.ts.map +1 -0
- package/dist/tests/plugins/TypescriptPlugin.spec.js +147 -0
- package/dist/tests/plugins/TypescriptPlugin.spec.js.map +1 -0
- package/dist/tests/plugins/VscodeKubernetesPlugin.spec.d.ts +11 -0
- package/dist/tests/plugins/VscodeKubernetesPlugin.spec.d.ts.map +1 -0
- package/dist/tests/plugins/VscodeKubernetesPlugin.spec.js +76 -0
- package/dist/tests/plugins/VscodeKubernetesPlugin.spec.js.map +1 -0
- package/dist/tests/plugins/VscodeShellcheckPlugin.spec.d.ts +11 -0
- package/dist/tests/plugins/VscodeShellcheckPlugin.spec.d.ts.map +1 -0
- package/dist/tests/plugins/VscodeShellcheckPlugin.spec.js +89 -0
- package/dist/tests/plugins/VscodeShellcheckPlugin.spec.js.map +1 -0
- package/dist/tests/plugins/VscodeValePlugin.spec.d.ts +11 -0
- package/dist/tests/plugins/VscodeValePlugin.spec.d.ts.map +1 -0
- package/dist/tests/plugins/VscodeValePlugin.spec.js +77 -0
- package/dist/tests/plugins/VscodeValePlugin.spec.js.map +1 -0
- package/dist/tests/plugins/VscodeXmlPlugin.spec.d.ts +11 -0
- package/dist/tests/plugins/VscodeXmlPlugin.spec.d.ts.map +1 -0
- package/dist/tests/plugins/VscodeXmlPlugin.spec.js +98 -0
- package/dist/tests/plugins/VscodeXmlPlugin.spec.js.map +1 -0
- package/dist/tests/plugins/VscodeYamlPlugin.spec.d.ts +11 -0
- package/dist/tests/plugins/VscodeYamlPlugin.spec.d.ts.map +1 -0
- package/dist/tests/plugins/VscodeYamlPlugin.spec.js +96 -0
- package/dist/tests/plugins/VscodeYamlPlugin.spec.js.map +1 -0
- package/dist/testsLibrary/CodeExecutionTests.d.ts +49 -0
- package/dist/testsLibrary/CodeExecutionTests.d.ts.map +1 -0
- package/dist/testsLibrary/CodeExecutionTests.js +222 -0
- package/dist/testsLibrary/CodeExecutionTests.js.map +1 -0
- package/dist/testsLibrary/LanguageServerTests.d.ts +36 -0
- package/dist/testsLibrary/LanguageServerTests.d.ts.map +1 -0
- package/dist/testsLibrary/LanguageServerTests.js +237 -0
- package/dist/testsLibrary/LanguageServerTests.js.map +1 -0
- package/dist/testsLibrary/ProjectAndFileTests.d.ts +28 -0
- package/dist/testsLibrary/ProjectAndFileTests.d.ts.map +1 -0
- package/dist/testsLibrary/ProjectAndFileTests.js +100 -0
- package/dist/testsLibrary/ProjectAndFileTests.js.map +1 -0
- package/dist/testsLibrary/WorkspaceHandlingTests.d.ts +29 -0
- package/dist/testsLibrary/WorkspaceHandlingTests.d.ts.map +1 -0
- package/dist/testsLibrary/WorkspaceHandlingTests.js +87 -0
- package/dist/testsLibrary/WorkspaceHandlingTests.js.map +1 -0
- package/dist/utils/AnimationChecker.d.ts +16 -0
- package/dist/utils/AnimationChecker.d.ts.map +1 -0
- package/dist/utils/AnimationChecker.js +45 -0
- package/dist/utils/AnimationChecker.js.map +1 -0
- package/dist/utils/BrowserTabsUtil.d.ts +28 -0
- package/dist/utils/BrowserTabsUtil.d.ts.map +1 -0
- package/dist/utils/BrowserTabsUtil.js +115 -0
- package/dist/utils/BrowserTabsUtil.js.map +1 -0
- package/dist/utils/DriverHelper.d.ts +76 -0
- package/dist/utils/DriverHelper.d.ts.map +1 -0
- package/dist/utils/DriverHelper.js +616 -0
- package/dist/utils/DriverHelper.js.map +1 -0
- package/dist/utils/KeycloackUrlHandler.d.ts +15 -0
- package/dist/utils/KeycloackUrlHandler.d.ts.map +1 -0
- package/dist/utils/KeycloackUrlHandler.js +30 -0
- package/dist/utils/KeycloackUrlHandler.js.map +1 -0
- package/dist/utils/Logger.d.ts +39 -0
- package/dist/utils/Logger.d.ts.map +1 -0
- package/dist/utils/Logger.js +84 -0
- package/dist/utils/Logger.js.map +1 -0
- package/dist/utils/PreferencesHandler.d.ts +52 -0
- package/dist/utils/PreferencesHandler.d.ts.map +1 -0
- package/dist/utils/PreferencesHandler.js +139 -0
- package/dist/utils/PreferencesHandler.js.map +1 -0
- package/dist/utils/Sanitizer.d.ts +13 -0
- package/dist/utils/Sanitizer.d.ts.map +1 -0
- package/dist/utils/Sanitizer.js +29 -0
- package/dist/utils/Sanitizer.js.map +1 -0
- package/dist/utils/ScreenCatcher.d.ts +12 -0
- package/dist/utils/ScreenCatcher.d.ts.map +1 -0
- package/dist/utils/ScreenCatcher.js +107 -0
- package/dist/utils/ScreenCatcher.js.map +1 -0
- package/dist/utils/VCS/CheGitApi.d.ts +8 -0
- package/dist/utils/VCS/CheGitApi.d.ts.map +1 -0
- package/dist/utils/VCS/CheGitApi.js +42 -0
- package/dist/utils/VCS/CheGitApi.js.map +1 -0
- package/dist/utils/VCS/github/GitHubUtil.d.ts +15 -0
- package/dist/utils/VCS/github/GitHubUtil.d.ts.map +1 -0
- package/dist/utils/VCS/github/GitHubUtil.js +106 -0
- package/dist/utils/VCS/github/GitHubUtil.js.map +1 -0
- package/dist/utils/WorkspaceNameHandler.d.ts +17 -0
- package/dist/utils/WorkspaceNameHandler.d.ts.map +1 -0
- package/dist/utils/WorkspaceNameHandler.js +60 -0
- package/dist/utils/WorkspaceNameHandler.js.map +1 -0
- package/dist/utils/requestHandlers/CheApiRequestHandler.d.ts +28 -0
- package/dist/utils/requestHandlers/CheApiRequestHandler.d.ts.map +1 -0
- package/dist/utils/requestHandlers/CheApiRequestHandler.js +100 -0
- package/dist/utils/requestHandlers/CheApiRequestHandler.js.map +1 -0
- package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.d.ts +18 -0
- package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.d.ts.map +1 -0
- package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js +33 -0
- package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -0
- package/dist/utils/requestHandlers/headers/IAuthorizationHeaderHandler.d.ts +14 -0
- package/dist/utils/requestHandlers/headers/IAuthorizationHeaderHandler.d.ts.map +1 -0
- package/dist/utils/requestHandlers/headers/IAuthorizationHeaderHandler.js +12 -0
- package/dist/utils/requestHandlers/headers/IAuthorizationHeaderHandler.js.map +1 -0
- package/dist/utils/requestHandlers/tokens/CheMultiuserTokenHandler.d.ts +5 -0
- package/dist/utils/requestHandlers/tokens/CheMultiuserTokenHandler.d.ts.map +1 -0
- package/dist/utils/requestHandlers/tokens/CheMultiuserTokenHandler.js +50 -0
- package/dist/utils/requestHandlers/tokens/CheMultiuserTokenHandler.js.map +1 -0
- package/dist/utils/requestHandlers/tokens/ITokenHandler.d.ts +13 -0
- package/dist/utils/requestHandlers/tokens/ITokenHandler.d.ts.map +1 -0
- package/dist/utils/requestHandlers/tokens/ITokenHandler.js +12 -0
- package/dist/utils/requestHandlers/tokens/ITokenHandler.js.map +1 -0
- package/dist/utils/workspace/ITestWorkspaceUtil.d.ts +25 -0
- package/dist/utils/workspace/ITestWorkspaceUtil.d.ts.map +1 -0
- package/dist/utils/workspace/ITestWorkspaceUtil.js +12 -0
- package/dist/utils/workspace/ITestWorkspaceUtil.js.map +1 -0
- package/dist/utils/workspace/TestWorkspaceUtil.d.ts +34 -0
- package/dist/utils/workspace/TestWorkspaceUtil.d.ts.map +1 -0
- package/dist/utils/workspace/TestWorkspaceUtil.js +233 -0
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -0
- package/dist/utils/workspace/WorkspaceStatus.d.ts +15 -0
- package/dist/utils/workspace/WorkspaceStatus.d.ts.map +1 -0
- package/dist/utils/workspace/WorkspaceStatus.js +19 -0
- package/dist/utils/workspace/WorkspaceStatus.js.map +1 -0
- package/driver/CheReporter.ts +202 -0
- package/driver/ChromeDriver.ts +71 -0
- package/driver/IDriver.ts +14 -0
- package/files/devfiles/plugins/GitHubPullRequestPlugin.yaml +11 -0
- package/files/devfiles/plugins/InstallPluginUsingUI.yaml +3 -0
- package/files/devfiles/plugins/Java11PluginTest.yaml +17 -0
- package/files/devfiles/plugins/PhpPluginTest.yaml +47 -0
- package/files/devfiles/plugins/PythonPluginTest.yaml +14 -0
- package/files/devfiles/plugins/TypescriptNodeDebug2PluginTest.yaml +49 -0
- package/files/devfiles/plugins/VscodeKubernetesPlugin.yaml +12 -0
- package/files/devfiles/plugins/VscodeShellcheckPlugin.yaml +12 -0
- package/files/devfiles/plugins/VscodeValePlugin.yaml +42 -0
- package/files/devfiles/plugins/VscodeXmlPlugin.yaml +12 -0
- package/files/devfiles/plugins/VscodeYamlPlugin.yaml +12 -0
- package/files/happy-path/containers-happy-path.yaml +127 -0
- package/files/happy-path/happy-path-workspace.yaml +95 -0
- package/files/happy-path/petclinic-classpath.txt +49 -0
- package/generateIndex.sh +35 -0
- package/index.ts +67 -0
- package/initDefaultValues.sh +27 -0
- package/initDevfileTests.sh +48 -0
- package/initPluginTest.sh +9 -0
- package/inversify.config.ts +134 -0
- package/inversify.types.ts +71 -0
- package/mocha-all-devfiles.opts +8 -0
- package/mocha-all-factories.opts +8 -0
- package/mocha-all-plugins.opts +7 -0
- package/mocha-connector.opts +7 -0
- package/mocha-devworkspace-happy-path.opts +7 -0
- package/mocha-factory.opts +7 -0
- package/mocha-git-publish-branch.opts +7 -0
- package/mocha-git-self-sign-cert.opts +7 -0
- package/mocha-git-ssh.opts +7 -0
- package/mocha-happy-path.opts +8 -0
- package/mocha-java-vertx.opts +7 -0
- package/mocha-load.opts +7 -0
- package/mocha-single-devfile.opts +6 -0
- package/mocha-wkspc-creation-and-ls.opts +7 -0
- package/mocha.intelij.opts +7 -0
- package/mocha.ocp.link.opts +6 -0
- package/mocha.opts +7 -0
- package/mocha.single.plugin.opts +5 -0
- package/package.json +59 -0
- package/pageobjects/dashboard/CreateWorkspace.ts +58 -0
- package/pageobjects/dashboard/Dashboard.ts +112 -0
- package/pageobjects/dashboard/Workspaces.ts +189 -0
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +153 -0
- package/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.ts +96 -0
- package/pageobjects/ide/ContextMenu.ts +55 -0
- package/pageobjects/ide/DebugView.ts +88 -0
- package/pageobjects/ide/DialogWindow.ts +101 -0
- package/pageobjects/ide/Editor.ts +601 -0
- package/pageobjects/ide/Ide.ts +370 -0
- package/pageobjects/ide/LeftToolBar.ts +81 -0
- package/pageobjects/ide/NavigationBar.ts +41 -0
- package/pageobjects/ide/NotificationCenter.ts +75 -0
- package/pageobjects/ide/OpenDialogWidget.ts +92 -0
- package/pageobjects/ide/OpenWorkspaceWidget.ts +48 -0
- package/pageobjects/ide/PreviewWidget.ts +135 -0
- package/pageobjects/ide/ProjectTree.ts +335 -0
- package/pageobjects/ide/QuickOpenContainer.ts +59 -0
- package/pageobjects/ide/RightToolBar.ts +34 -0
- package/pageobjects/ide/Terminal.ts +245 -0
- package/pageobjects/ide/TopMenu.ts +103 -0
- package/pageobjects/ide/plugins/GitHubPullRequestPlugin.ts +130 -0
- package/pageobjects/ide/plugins/GitPlugin.ts +118 -0
- package/pageobjects/ide/plugins/KubernetesPlugin.ts +113 -0
- package/pageobjects/ide/plugins/OpenshiftPlugin.ts +87 -0
- package/pageobjects/ide/plugins/PluginsView.ts +191 -0
- package/pageobjects/login/ICheLoginPage.ts +13 -0
- package/pageobjects/login/IOcpLoginPage.ts +13 -0
- package/pageobjects/login/MultiUserLoginPage.ts +33 -0
- package/pageobjects/login/OcpUserLoginPage.ts +38 -0
- package/pageobjects/login/RegularUserOcpCheLoginPage.ts +61 -0
- package/pageobjects/login/UpdateAccountInformationPage.ts +70 -0
- package/pageobjects/openshift/CheLoginPage.ts +91 -0
- package/pageobjects/openshift/OcpLoginPage.ts +113 -0
- package/pageobjects/third-parties/GitLoginPage.ts +81 -0
- package/pageobjects/third-parties/GitOauthAppsSettings.ts +110 -0
- package/tests/devfiles/CSlashCPlusPlus.spec.ts +81 -0
- package/tests/devfiles/DevfileSmoke.spec.ts +53 -0
- package/tests/devfiles/DotNetCore.spec.ts +90 -0
- package/tests/devfiles/Go.spec.ts +84 -0
- package/tests/devfiles/JavaMaven.spec.ts +67 -0
- package/tests/devfiles/JavaSpringBoot.spec.ts +74 -0
- package/tests/devfiles/JavaVertx.spec.ts +68 -0
- package/tests/devfiles/NodeJS.spec.ts +74 -0
- package/tests/devfiles/PHPSimple.spec.ts +83 -0
- package/tests/devfiles/Python.spec.ts +67 -0
- package/tests/devfiles/PythonDjango.spec.ts +70 -0
- package/tests/devfiles/Quarkus.spec.ts +79 -0
- package/tests/devfiles/Scala.spec.ts +74 -0
- package/tests/e2e/FactoryUrl.spec.ts +51 -0
- package/tests/e2e/GitPublishBranch.spec.ts +107 -0
- package/tests/e2e/GitSelfSignCert.spec.ts +107 -0
- package/tests/e2e/GitSsh.spec.ts +143 -0
- package/tests/e2e/OpenshiftConnector.spec.ts +142 -0
- package/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.ts +61 -0
- package/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.ts +59 -0
- package/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.ts +61 -0
- package/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +204 -0
- package/tests/e2e_happy_path/HappyPath.spec.ts +342 -0
- package/tests/intelij/IntelijOpenWorkspace.spec.ts +49 -0
- package/tests/load_test/LoadTest.spec.ts +54 -0
- package/tests/login/LinkCheAndOcpUsers.spec.ts +47 -0
- package/tests/login/Login.spec.ts +27 -0
- package/tests/plugins/GitHubPullRequestPlugin.spec.ts +150 -0
- package/tests/plugins/InstallPluginUsingUI.spec.ts +83 -0
- package/tests/plugins/JavaPlugin.spec.ts +108 -0
- package/tests/plugins/PhpPlugin.spec.ts +121 -0
- package/tests/plugins/PythonPlugin.spec.ts +92 -0
- package/tests/plugins/TypescriptPlugin.spec.ts +179 -0
- package/tests/plugins/VscodeKubernetesPlugin.spec.ts +89 -0
- package/tests/plugins/VscodeShellcheckPlugin.spec.ts +106 -0
- package/tests/plugins/VscodeValePlugin.spec.ts +91 -0
- package/tests/plugins/VscodeXmlPlugin.spec.ts +120 -0
- package/tests/plugins/VscodeYamlPlugin.spec.ts +117 -0
- package/testsLibrary/CodeExecutionTests.ts +196 -0
- package/testsLibrary/LanguageServerTests.ts +210 -0
- package/testsLibrary/ProjectAndFileTests.ts +82 -0
- package/testsLibrary/WorkspaceHandlingTests.ts +68 -0
- package/tsconfig.json +16 -0
- package/tslint.json +123 -0
- package/utils/AnimationChecker.ts +27 -0
- package/utils/BrowserTabsUtil.ts +120 -0
- package/utils/DriverHelper.ts +753 -0
- package/utils/KeycloackUrlHandler.ts +32 -0
- package/utils/Logger.ts +87 -0
- package/utils/PreferencesHandler.ts +120 -0
- package/utils/Sanitizer.ts +20 -0
- package/utils/ScreenCatcher.ts +74 -0
- package/utils/VCS/CheGitApi.ts +26 -0
- package/utils/VCS/github/GitHubUtil.ts +91 -0
- package/utils/WorkspaceNameHandler.ts +48 -0
- package/utils/requestHandlers/CheApiRequestHandler.ts +83 -0
- package/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +27 -0
- package/utils/requestHandlers/headers/IAuthorizationHeaderHandler.ts +15 -0
- package/utils/requestHandlers/tokens/CheMultiuserTokenHandler.ts +39 -0
- package/utils/requestHandlers/tokens/ITokenHandler.ts +14 -0
- package/utils/workspace/ITestWorkspaceUtil.ts +26 -0
- package/utils/workspace/TestWorkspaceUtil.ts +275 -0
- package/utils/workspace/WorkspaceStatus.ts +15 -0
|
@@ -0,0 +1,753 @@
|
|
|
1
|
+
/*********************************************************************
|
|
2
|
+
* Copyright (c) 2019 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import { IDriver } from '../driver/IDriver';
|
|
11
|
+
import { inject, injectable } from 'inversify';
|
|
12
|
+
import { TYPES } from '../inversify.types';
|
|
13
|
+
import { error, ActionSequence } from 'selenium-webdriver';
|
|
14
|
+
import 'reflect-metadata';
|
|
15
|
+
import { ThenableWebDriver, By, until, WebElement } from 'selenium-webdriver';
|
|
16
|
+
import { TestConstants } from '../TestConstants';
|
|
17
|
+
import { Logger } from './Logger';
|
|
18
|
+
import { TimeoutConstants } from '../TimeoutConstants';
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@injectable()
|
|
22
|
+
export class DriverHelper {
|
|
23
|
+
private readonly driver: ThenableWebDriver;
|
|
24
|
+
|
|
25
|
+
constructor(@inject(TYPES.Driver) driver: IDriver) {
|
|
26
|
+
this.driver = driver.get();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public getAction(): ActionSequence {
|
|
30
|
+
Logger.trace('DriverHelper.getAction');
|
|
31
|
+
|
|
32
|
+
return this.driver.actions();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated Method deprecated. Use the next method instead.
|
|
37
|
+
* @see BrowserTabsUtil.maximize()
|
|
38
|
+
*/
|
|
39
|
+
public async maximize() {
|
|
40
|
+
Logger.trace(`DriverHelper.maximize`);
|
|
41
|
+
|
|
42
|
+
await this.driver.manage().window().maximize();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public async isVisible(locator: By): Promise<boolean> {
|
|
46
|
+
Logger.trace(`DriverHelper.isVisible ${locator}`);
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
const element: WebElement = await this.driver.findElement(locator);
|
|
50
|
+
const isVisible: boolean = await element.isDisplayed();
|
|
51
|
+
return isVisible;
|
|
52
|
+
} catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public async wait(milliseconds: number) {
|
|
58
|
+
Logger.trace(`DriverHelper.wait (${milliseconds} milliseconds)`);
|
|
59
|
+
|
|
60
|
+
await this.driver.sleep(milliseconds);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public async waitVisibilityBoolean(locator: By,
|
|
64
|
+
attempts: number = TestConstants.TS_SELENIUM_DEFAULT_ATTEMPTS,
|
|
65
|
+
polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING): Promise<boolean> {
|
|
66
|
+
|
|
67
|
+
Logger.trace(`DriverHelper.waitVisibilityBoolean ${locator}`);
|
|
68
|
+
|
|
69
|
+
for (let i = 0; i < attempts; i++) {
|
|
70
|
+
const isVisible: boolean = await this.isVisible(locator);
|
|
71
|
+
|
|
72
|
+
if (isVisible) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
await this.wait(polling);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public async waitDisappearanceBoolean(locator: By,
|
|
83
|
+
attempts: number = TestConstants.TS_SELENIUM_DEFAULT_ATTEMPTS,
|
|
84
|
+
polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING): Promise<boolean> {
|
|
85
|
+
|
|
86
|
+
Logger.trace(`DriverHelper.waitDisappearanceBoolean ${locator}`);
|
|
87
|
+
|
|
88
|
+
for (let i = 0; i < attempts; i++) {
|
|
89
|
+
const isVisible: boolean = await this.isVisible(locator);
|
|
90
|
+
|
|
91
|
+
if (!isVisible) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
await this.wait(polling);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public async waitVisibility(elementLocator: By, timeout: number = TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM): Promise<WebElement> {
|
|
102
|
+
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
103
|
+
const attempts: number = Math.ceil(timeout / polling);
|
|
104
|
+
|
|
105
|
+
Logger.trace(`DriverHelper.waitVisibility ${elementLocator}`);
|
|
106
|
+
|
|
107
|
+
for (let i = 0; i < attempts; i++) {
|
|
108
|
+
let element: WebElement;
|
|
109
|
+
try {
|
|
110
|
+
element = await this.driver.wait(until.elementLocated(elementLocator), polling);
|
|
111
|
+
} catch (err) {
|
|
112
|
+
if (i >= attempts) {
|
|
113
|
+
Logger.error(`DriverHelper.waitVisibility - failed with exception, out of attempts - ${err}`);
|
|
114
|
+
throw err;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (err instanceof error.TimeoutError) {
|
|
118
|
+
if (attempts !== 1) { // waitVisibility was spamming other methods when the number of attempts was 1 - only show message if attempts > 1
|
|
119
|
+
Logger.trace(`DriverHelper.waitVisibility - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
120
|
+
}
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (err instanceof error.NoSuchWindowError) { // sometimes waitVisibility fails with NoSuchWindowError when the check is run too soon before the page loads
|
|
125
|
+
Logger.trace(`DriverHelper.waitVisibility - failed with NoSuchWindow exception. Attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
Logger.error(`DriverHelper.waitVisibility - failed with an unexpected exception - ${err}`);
|
|
130
|
+
throw err;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
try {
|
|
134
|
+
const visibleWebElement = await this.driver.wait(until.elementIsVisible(element), polling);
|
|
135
|
+
Logger.trace('DriverHelper.waitVisibility - Element is located and is visible.');
|
|
136
|
+
return visibleWebElement;
|
|
137
|
+
} catch (err) {
|
|
138
|
+
if (err instanceof error.TimeoutError) {
|
|
139
|
+
if (attempts !== 1) { // waitVisibility was spamming other methods when the number of attempts was 1 - only show message if attempts > 1
|
|
140
|
+
Logger.trace(`DriverHelper.waitVisibility - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
141
|
+
}
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (err instanceof error.StaleElementReferenceError) {
|
|
146
|
+
Logger.debug(`DriverHelper.waitVisibility - Stale element error - ${err}`);
|
|
147
|
+
await this.wait(polling);
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
Logger.error(`DriverHelper.waitVisibility - failed with an unexpected exception - ${err}`);
|
|
152
|
+
throw err;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
throw new error.TimeoutError(`Exceeded maximum visibility checkings attempts for '${elementLocator}' element, timeouted after ${timeout}`);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
public async waitPresence(elementLocator: By, timeout: number = TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM): Promise<WebElement> {
|
|
160
|
+
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
161
|
+
const attempts: number = Math.ceil(timeout / polling);
|
|
162
|
+
|
|
163
|
+
Logger.trace(`DriverHelper.waitPresence ${elementLocator}`);
|
|
164
|
+
|
|
165
|
+
for (let i = 0; i < attempts; i++) {
|
|
166
|
+
try {
|
|
167
|
+
const webElement: WebElement = await this.driver.wait(until.elementLocated(elementLocator), polling);
|
|
168
|
+
return webElement;
|
|
169
|
+
} catch (err) {
|
|
170
|
+
if (err instanceof error.TimeoutError) {
|
|
171
|
+
Logger.trace(`DriverHelper.waitPresence - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (err instanceof error.StaleElementReferenceError) {
|
|
176
|
+
await this.wait(polling);
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
Logger.error(`DriverHelper.waitPresence - failed with an unexpected exception - ${err}`);
|
|
181
|
+
throw err;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
throw new error.TimeoutError(`Exceeded maximum presence checkings attempts, problems with 'StaleElementReferenceError' of '${elementLocator}' element`);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
public async waitAllPresence(elementLocator: By, timeout: number = TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM): Promise<Array<WebElement>> {
|
|
189
|
+
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
190
|
+
const attempts: number = Math.ceil(timeout / polling);
|
|
191
|
+
|
|
192
|
+
Logger.trace(`DriverHelper.waitAllPresence ${elementLocator}`);
|
|
193
|
+
|
|
194
|
+
for (let i = 0; i < attempts; i++) {
|
|
195
|
+
try {
|
|
196
|
+
const webElements: Array<WebElement> = await this.driver.wait(until.elementsLocated(elementLocator), polling);
|
|
197
|
+
return webElements;
|
|
198
|
+
} catch (err) {
|
|
199
|
+
if (err instanceof error.TimeoutError) {
|
|
200
|
+
Logger.trace(`DriverHelper.waitAllPresence - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (err instanceof error.StaleElementReferenceError) {
|
|
205
|
+
await this.wait(polling);
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
Logger.error(`DriverHelper.waitAllPresence - failed with an unexpected exception - ${err}`);
|
|
210
|
+
throw err;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
throw new error.TimeoutError(`Exceeded maximum presence checkings attempts, problems with 'StaleElementReferenceError' of '${elementLocator}' element`);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
public async waitAllVisibility(locators: Array<By>, timeout: number) {
|
|
218
|
+
Logger.trace(`DriverHelper.waitAllVisibility ${locators}`);
|
|
219
|
+
|
|
220
|
+
for (const elementLocator of locators) {
|
|
221
|
+
await this.waitVisibility(elementLocator, timeout);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
public async waitDisappearance(elementLocator: By,
|
|
226
|
+
attempts: number = TestConstants.TS_SELENIUM_DEFAULT_ATTEMPTS,
|
|
227
|
+
polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING) {
|
|
228
|
+
|
|
229
|
+
Logger.trace(`DriverHelper.waitDisappearance ${elementLocator}`);
|
|
230
|
+
|
|
231
|
+
const isDisappeared = await this.waitDisappearanceBoolean(elementLocator, attempts, polling);
|
|
232
|
+
|
|
233
|
+
if (!isDisappeared) {
|
|
234
|
+
throw new error.TimeoutError(`Waiting attempts exceeded, element '${elementLocator}' is still visible`);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
public async waitDisappearanceWithTimeout(elementLocator: By, timeout: number) {
|
|
239
|
+
Logger.trace(`DriverHelper.waitDisappearanceWithTimeout ${elementLocator}`);
|
|
240
|
+
|
|
241
|
+
await this.getDriver().wait(async () => {
|
|
242
|
+
const isVisible: boolean = await this.isVisible(elementLocator);
|
|
243
|
+
|
|
244
|
+
if (!isVisible) {
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
}, timeout);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
public async waitAllDisappearance(locators: Array<By>,
|
|
251
|
+
attemptsPerLocator: number = TestConstants.TS_SELENIUM_DEFAULT_ATTEMPTS,
|
|
252
|
+
pollingPerLocator: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING) {
|
|
253
|
+
|
|
254
|
+
Logger.trace(`DriverHelper.waitAllDisappearance ${locators}`);
|
|
255
|
+
|
|
256
|
+
for (const elementLocator of locators) {
|
|
257
|
+
await this.waitDisappearance(elementLocator, attemptsPerLocator, pollingPerLocator);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
public async waitAndClick(elementLocator: By, timeout: number = TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
|
|
262
|
+
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
263
|
+
const attempts: number = Math.ceil(timeout / polling);
|
|
264
|
+
|
|
265
|
+
Logger.trace(`DriverHelper.waitAndClick ${elementLocator}`);
|
|
266
|
+
|
|
267
|
+
for (let i = 0; i < attempts; i++) {
|
|
268
|
+
let element: WebElement;
|
|
269
|
+
try {
|
|
270
|
+
element = await this.waitVisibility(elementLocator, polling);
|
|
271
|
+
} catch (err) {
|
|
272
|
+
if (i >= attempts) {
|
|
273
|
+
Logger.error(`DriverHelper.waitAndClick - failed with exception, out of attempts - ${err}`);
|
|
274
|
+
throw err;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (err instanceof error.TimeoutError) {
|
|
278
|
+
Logger.trace(`DriverHelper.waitAndClick - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
Logger.error(`DriverHelper.waitAndClick - failed with an unexpected exception - ${err}`);
|
|
283
|
+
throw err;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
try {
|
|
287
|
+
await element.click();
|
|
288
|
+
return;
|
|
289
|
+
} catch (err) {
|
|
290
|
+
if (err instanceof error.StaleElementReferenceError) {
|
|
291
|
+
Logger.debug(`DriverHelper.waitAndClik - ${elementLocator} - StaleElementReferenceError - ${err}`);
|
|
292
|
+
await this.wait(polling);
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
Logger.error(`DriverHelper.waitAndClick - failed with an unexpected exception - ${err}`);
|
|
297
|
+
throw err;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
throw new error.TimeoutError(`Exceeded maximum clicking attempts, the '${elementLocator}' element is not clickable`);
|
|
302
|
+
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
public async waitAndGetElementAttribute(elementLocator: By, attribute: string,
|
|
306
|
+
timeout: number = TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM): Promise<string> {
|
|
307
|
+
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
308
|
+
const attempts: number = Math.ceil(timeout / polling);
|
|
309
|
+
|
|
310
|
+
Logger.trace(`DriverHelper.waitAndGetElementAttribute ${elementLocator} attribute: '${attribute}'`);
|
|
311
|
+
|
|
312
|
+
for (let i = 0; i < attempts; i++) {
|
|
313
|
+
let element: WebElement;
|
|
314
|
+
try {
|
|
315
|
+
element = await this.waitVisibility(elementLocator, polling);
|
|
316
|
+
} catch (err) {
|
|
317
|
+
if (i >= attempts) {
|
|
318
|
+
Logger.error(`DriverHelper.waitAndGetElementAttribute - failed with exception, out of attempts - ${err}`);
|
|
319
|
+
throw err;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (err instanceof error.TimeoutError) {
|
|
323
|
+
Logger.trace(`DriverHelper.waitAndGetElementAttribute - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
324
|
+
continue;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
Logger.error(`DriverHelper.waitAndGetElementAttribute - failed with an unexpected exception - ${err}`);
|
|
328
|
+
throw err;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
try {
|
|
332
|
+
const attributeValue = await element.getAttribute(attribute);
|
|
333
|
+
return attributeValue;
|
|
334
|
+
} catch (err) {
|
|
335
|
+
if (err instanceof error.StaleElementReferenceError) {
|
|
336
|
+
await this.wait(polling);
|
|
337
|
+
continue;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
Logger.error(`DriverHelper.waitAndGetElementAttribute - failed with an unexpected exception - ${err}`);
|
|
341
|
+
throw err;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
throw new error.TimeoutError(`Exceeded maximum gettin of the '${attribute}' attribute attempts, from the '${elementLocator}' element`);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
public async waitAndGetCssValue(elementLocator: By, cssAttribute: string,
|
|
349
|
+
timeout: number = TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM): Promise<string> {
|
|
350
|
+
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
351
|
+
const attempts: number = Math.ceil(timeout / polling);
|
|
352
|
+
|
|
353
|
+
Logger.trace(`DriverHelper.waitAndGetCssValue ${elementLocator} cssAttribute: ${cssAttribute}`);
|
|
354
|
+
|
|
355
|
+
for (let i = 0; i < attempts; i++) {
|
|
356
|
+
let element: WebElement;
|
|
357
|
+
try {
|
|
358
|
+
element = await this.waitVisibility(elementLocator, polling);
|
|
359
|
+
} catch (err) {
|
|
360
|
+
if (i >= attempts) {
|
|
361
|
+
Logger.error(`DriverHelper.waitAndGetCssValue - failed with exception, out of attempts - ${err}`);
|
|
362
|
+
throw err;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (err instanceof error.TimeoutError) {
|
|
366
|
+
Logger.trace(`DriverHelper.waitAndGetCssValue - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
Logger.error(`DriverHelper.waitAndGetCssValue - failed with an unexpected exception - ${err}`);
|
|
371
|
+
throw err;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
try {
|
|
375
|
+
const cssAttributeValue = await element.getCssValue(cssAttribute);
|
|
376
|
+
return cssAttributeValue;
|
|
377
|
+
} catch (err) {
|
|
378
|
+
if (err instanceof error.StaleElementReferenceError) {
|
|
379
|
+
await this.wait(polling);
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
Logger.error(`DriverHelper.waitAndGetCssValue - failed with an unexpected exception - ${err}`);
|
|
384
|
+
throw err;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
throw new error.TimeoutError(`Exceeded maximum gettin of the '${cssAttribute}' css attribute attempts, from the '${elementLocator}' element`);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
public async waitAttributeValue(elementLocator: By,
|
|
392
|
+
attribute: string,
|
|
393
|
+
expectedValue: string,
|
|
394
|
+
timeout: number) {
|
|
395
|
+
|
|
396
|
+
Logger.trace(`DriverHelper.waitAttributeValue ${elementLocator}`);
|
|
397
|
+
|
|
398
|
+
await this.driver.wait(async () => {
|
|
399
|
+
const attributeValue: string = await this.waitAndGetElementAttribute(elementLocator, attribute, timeout);
|
|
400
|
+
|
|
401
|
+
return expectedValue === attributeValue;
|
|
402
|
+
},
|
|
403
|
+
timeout,
|
|
404
|
+
`The '${attribute}' attribute value doesn't match with expected value '${expectedValue}'`);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
public async type(elementLocator: By, text: string, timeout: number = TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
|
|
408
|
+
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
409
|
+
const attempts: number = Math.ceil(timeout / polling);
|
|
410
|
+
|
|
411
|
+
Logger.trace(`DriverHelper.type ${elementLocator} text: ${text}`);
|
|
412
|
+
|
|
413
|
+
for (let i = 0; i < attempts; i++) {
|
|
414
|
+
let element: WebElement;
|
|
415
|
+
try {
|
|
416
|
+
element = await this.waitVisibility(elementLocator, polling);
|
|
417
|
+
} catch (err) {
|
|
418
|
+
if (i >= attempts) {
|
|
419
|
+
Logger.error(`DriverHelper.type - failed with exception, out of attempts - ${err}`);
|
|
420
|
+
throw err;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
if (err instanceof error.TimeoutError) {
|
|
424
|
+
Logger.trace(`DriverHelper.type - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
Logger.error(`DriverHelper.type - failed with an unexpected exception - ${err}`);
|
|
429
|
+
throw err;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
try {
|
|
433
|
+
await element.sendKeys(text);
|
|
434
|
+
return;
|
|
435
|
+
} catch (err) {
|
|
436
|
+
if (err instanceof error.StaleElementReferenceError) {
|
|
437
|
+
await this.wait(polling);
|
|
438
|
+
continue;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
Logger.error(`DriverHelper.type - failed with an unexpected exception - ${err}`);
|
|
442
|
+
throw err;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
throw new error.TimeoutError(`Exceeded maximum typing attempts, to the '${elementLocator}' element`);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
public async typeToInvisible(elementLocator: By, text: string, timeout: number = TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
|
|
450
|
+
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
451
|
+
const attempts: number = Math.ceil(timeout / polling);
|
|
452
|
+
|
|
453
|
+
Logger.trace(`DriverHelper.typeToInvisible ${elementLocator} text: ${text}`);
|
|
454
|
+
|
|
455
|
+
for (let i = 0; i < attempts; i++) {
|
|
456
|
+
let element: WebElement;
|
|
457
|
+
try {
|
|
458
|
+
element = await this.waitPresence(elementLocator, polling);
|
|
459
|
+
} catch (err) {
|
|
460
|
+
if (i >= attempts) {
|
|
461
|
+
Logger.error(`DriverHelper.typeToInvisible - failed with exception, out of attempts - ${err}`);
|
|
462
|
+
throw err;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
if (err instanceof error.TimeoutError) {
|
|
466
|
+
Logger.trace(`DriverHelper.typeToInvisible - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
467
|
+
continue;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
Logger.error(`DriverHelper.typeToInvisible - failed with an unexpected exception - ${err}`);
|
|
471
|
+
throw err;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
try {
|
|
475
|
+
await element.sendKeys(text);
|
|
476
|
+
return;
|
|
477
|
+
} catch (err) {
|
|
478
|
+
if (err instanceof error.StaleElementReferenceError) {
|
|
479
|
+
await this.wait(polling);
|
|
480
|
+
continue;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
Logger.error(`DriverHelper.typeToInvisible - failed with an unexpected exception - ${err}`);
|
|
484
|
+
throw err;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
throw new error.TimeoutError(`Exceeded maximum typing attempts, to the '${elementLocator}' element`);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
public async clear(elementLocator: By, timeout: number = TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
|
|
492
|
+
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
493
|
+
const attempts: number = Math.ceil(timeout / polling);
|
|
494
|
+
|
|
495
|
+
Logger.trace(`DriverHelper.clear ${elementLocator}`);
|
|
496
|
+
|
|
497
|
+
for (let i = 0; i < attempts; i++) {
|
|
498
|
+
let element: WebElement;
|
|
499
|
+
try {
|
|
500
|
+
element = await this.waitVisibility(elementLocator, polling);
|
|
501
|
+
} catch (err) {
|
|
502
|
+
if (i >= attempts) {
|
|
503
|
+
Logger.error(`DriverHelper.clear - failed with exception, out of attempts - ${err}`);
|
|
504
|
+
throw err;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
if (err instanceof error.TimeoutError) {
|
|
508
|
+
Logger.trace(`DriverHelper.clear - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
509
|
+
continue;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
Logger.error(`DriverHelper.clear - failed with an unexpected exception - ${err}`);
|
|
513
|
+
throw err;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
try {
|
|
517
|
+
await element.clear();
|
|
518
|
+
return;
|
|
519
|
+
} catch (err) {
|
|
520
|
+
if (err instanceof error.StaleElementReferenceError) {
|
|
521
|
+
await this.wait(polling);
|
|
522
|
+
continue;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
Logger.error(`DriverHelper.clear - failed with an unexpected exception - ${err}`);
|
|
526
|
+
throw err;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
throw new error.TimeoutError(`Exceeded maximum clearing attempts, to the '${elementLocator}' element`);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
public async clearInvisible(elementLocator: By, timeout: number = TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
|
|
534
|
+
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
535
|
+
const attempts: number = Math.ceil(timeout / polling);
|
|
536
|
+
|
|
537
|
+
Logger.trace(`DriverHelper.clearInvisible ${elementLocator}`);
|
|
538
|
+
|
|
539
|
+
for (let i = 0; i < attempts; i++) {
|
|
540
|
+
let element: WebElement;
|
|
541
|
+
try {
|
|
542
|
+
element = await this.waitPresence(elementLocator, polling);
|
|
543
|
+
} catch (err) {
|
|
544
|
+
if (i >= attempts) {
|
|
545
|
+
Logger.error(`DriverHelper.clearInvisible - failed with exception, out of attempts - ${err}`);
|
|
546
|
+
throw err;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
if (err instanceof error.TimeoutError) {
|
|
550
|
+
Logger.trace(`DriverHelper.clearInvisible - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
551
|
+
continue;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
Logger.error(`DriverHelper.clearInvisible - failed with an unexpected exception - ${err}`);
|
|
555
|
+
throw err;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
try {
|
|
559
|
+
await element.clear();
|
|
560
|
+
return;
|
|
561
|
+
} catch (err) {
|
|
562
|
+
if (err instanceof error.StaleElementReferenceError) {
|
|
563
|
+
await this.wait(polling);
|
|
564
|
+
continue;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
Logger.error(`DriverHelper.clearInvisible - failed with an unexpected exception - ${err}`);
|
|
568
|
+
throw err;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
throw new error.TimeoutError(`Exceeded maximum clearing attempts, to the '${elementLocator}' element`);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
public async enterValue(elementLocator: By, text: string, timeout: number = TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
|
|
576
|
+
Logger.trace(`DriverHelper.enterValue ${elementLocator} text: ${text}`);
|
|
577
|
+
|
|
578
|
+
await this.waitVisibility(elementLocator, timeout);
|
|
579
|
+
await this.clear(elementLocator);
|
|
580
|
+
await this.waitAttributeValue(elementLocator, 'value', '', timeout);
|
|
581
|
+
await this.type(elementLocator, text, timeout);
|
|
582
|
+
await this.waitAttributeValue(elementLocator, 'value', text, timeout);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
public async waitAndSwitchToFrame(iframeLocator: By, timeout: number) {
|
|
586
|
+
Logger.trace(`DriverHelper.waitAndSwitchToFrame ${iframeLocator}`);
|
|
587
|
+
|
|
588
|
+
await this.driver.wait(until.ableToSwitchToFrame(iframeLocator), timeout);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
public async waitAndGetText(elementLocator: By, timeout: number = TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM): Promise<string> {
|
|
592
|
+
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
593
|
+
const attempts: number = Math.ceil(timeout / polling);
|
|
594
|
+
|
|
595
|
+
Logger.trace(`DriverHelper.waitAndGetText ${elementLocator}`);
|
|
596
|
+
|
|
597
|
+
for (let i = 0; i < attempts; i++) {
|
|
598
|
+
let element: WebElement;
|
|
599
|
+
try {
|
|
600
|
+
element = await this.waitVisibility(elementLocator, polling);
|
|
601
|
+
} catch (err) {
|
|
602
|
+
if (i >= attempts) {
|
|
603
|
+
Logger.error(`DriverHelper.waitAndGetText - failed with exception, out of attempts - ${err}`);
|
|
604
|
+
throw err;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
if (err instanceof error.TimeoutError) {
|
|
608
|
+
Logger.trace(`DriverHelper.waitAndGetText - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
609
|
+
continue;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
Logger.error(`DriverHelper.waitAndGetText - failed with an unexpected exception - ${err}`);
|
|
613
|
+
throw err;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
try {
|
|
617
|
+
const innerText: string = await element.getText();
|
|
618
|
+
return innerText;
|
|
619
|
+
} catch (err) {
|
|
620
|
+
if (err instanceof error.StaleElementReferenceError) {
|
|
621
|
+
await this.wait(polling);
|
|
622
|
+
continue;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
Logger.error(`DriverHelper.waitAndGetText - failed with an unexpected exception - ${err}`);
|
|
626
|
+
throw err;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
throw new error.TimeoutError(`Exceeded maximum text obtaining attempts, from the '${elementLocator}' element`);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
public async waitAndGetValue(elementLocator: By, timeout: number): Promise<string> {
|
|
634
|
+
Logger.trace(`DriverHelper.waitAndGetValue ${elementLocator}`);
|
|
635
|
+
|
|
636
|
+
const elementValue: string = await this.waitAndGetElementAttribute(elementLocator, 'value', timeout);
|
|
637
|
+
return elementValue;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
public async waitUntilTrue(callback: any, timeout: number) {
|
|
641
|
+
Logger.trace('DriverHelper.waitUntilTrue');
|
|
642
|
+
|
|
643
|
+
await this.driver.wait(callback, timeout);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* @deprecated Method deprecated. Use the next method instead.
|
|
648
|
+
* @see BrowserTabsUtil.refreshPage()
|
|
649
|
+
*/
|
|
650
|
+
public async reloadPage() {
|
|
651
|
+
Logger.debug('DriverHelper.reloadPage');
|
|
652
|
+
|
|
653
|
+
await this.driver.navigate().refresh();
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* @deprecated Method deprecated. Use the next method instead.
|
|
658
|
+
* @see BrowserTabsUtil.navigateAndWaitToUrl()
|
|
659
|
+
*/
|
|
660
|
+
public async navigateAndWaitToUrl(url: string, timeout: number = TimeoutConstants.TS_SELENIUM_WAIT_FOR_URL) {
|
|
661
|
+
Logger.trace(`DriverHelper.navigateAndWaitToUrl ${url}`);
|
|
662
|
+
|
|
663
|
+
await this.navigateToUrl(url);
|
|
664
|
+
await this.waitURL(url, timeout);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* @deprecated Method deprecated. Use the next method instead.
|
|
669
|
+
* @see BrowserTabsUtil.navigateTo()
|
|
670
|
+
*/
|
|
671
|
+
public async navigateToUrl(url: string) {
|
|
672
|
+
Logger.debug(`DriverHelper.navigateToUrl ${url}`);
|
|
673
|
+
|
|
674
|
+
await this.driver.navigate().to(url);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* @deprecated Method deprecated. Use the next method instead.
|
|
679
|
+
* @see BrowserTabsUtil.waitURL()
|
|
680
|
+
*/
|
|
681
|
+
public async waitURL(expectedUrl: string, timeout: number) {
|
|
682
|
+
Logger.trace(`DriverHelper.waitURL ${expectedUrl}`);
|
|
683
|
+
|
|
684
|
+
await this.getDriver().wait(async () => {
|
|
685
|
+
const currentUrl: string = await this.getDriver().getCurrentUrl();
|
|
686
|
+
const urlEquals: boolean = currentUrl === expectedUrl;
|
|
687
|
+
|
|
688
|
+
if (urlEquals) {
|
|
689
|
+
return true;
|
|
690
|
+
}
|
|
691
|
+
}, timeout);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
public async scrollTo(elementLocator: By, timeout: number = TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
|
|
695
|
+
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
696
|
+
const attempts: number = Math.ceil(timeout / polling);
|
|
697
|
+
|
|
698
|
+
Logger.trace(`DriverHelper.scrollTo ${elementLocator}`);
|
|
699
|
+
|
|
700
|
+
for (let i = 0; i < attempts; i++) {
|
|
701
|
+
let element: WebElement;
|
|
702
|
+
try {
|
|
703
|
+
element = await this.waitPresence(elementLocator, polling);
|
|
704
|
+
} catch (err) {
|
|
705
|
+
if (i >= attempts) {
|
|
706
|
+
Logger.error(`DriverHelper.scrollTo - failed with exception, out of attempts - ${err}`);
|
|
707
|
+
throw err;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
if (err instanceof error.TimeoutError) {
|
|
711
|
+
Logger.trace(`DriverHelper.scrollTo - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
|
|
712
|
+
continue;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
Logger.error(`DriverHelper.scrollTo - failed with an unexpected exception - ${err}`);
|
|
716
|
+
throw err;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
try {
|
|
720
|
+
await this.getAction().mouseMove(element).perform();
|
|
721
|
+
return;
|
|
722
|
+
} catch (err) {
|
|
723
|
+
if (err instanceof error.StaleElementReferenceError) {
|
|
724
|
+
await this.wait(polling);
|
|
725
|
+
continue;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
Logger.error(`DriverHelper.scrollTo - failed with an unexpected exception - ${err}`);
|
|
729
|
+
throw err;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
throw new error.TimeoutError(`Exceeded maximum mouse move attempts, for the '${elementLocator}' element`);
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* @deprecated Method deprecated. Use the next method instead.
|
|
738
|
+
* @see BrowserTabsUtil.getCurrentUrl()
|
|
739
|
+
*/
|
|
740
|
+
public async getCurrentUrl(): Promise<string> {
|
|
741
|
+
return await this.driver.getCurrentUrl();
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
getDriver(): ThenableWebDriver {
|
|
745
|
+
Logger.trace('DriverHelper.getDriver');
|
|
746
|
+
|
|
747
|
+
return this.driver;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
public sleep(time: number) {
|
|
751
|
+
this.driver.sleep(time);
|
|
752
|
+
}
|
|
753
|
+
}
|