@eclipse-che/che-e2e 7.73.0 → 7.74.0-dev-41d1364

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.
Files changed (222) hide show
  1. package/.eslintignore +10 -0
  2. package/.eslintrc.js +183 -0
  3. package/.prettierignore +10 -0
  4. package/.prettierrc.json +10 -0
  5. package/README.md +47 -47
  6. package/configs/inversify.config.ts +14 -10
  7. package/configs/inversify.types.ts +29 -29
  8. package/configs/mocharc.ts +21 -24
  9. package/constants/API_TEST_CONSTANTS.ts +67 -0
  10. package/constants/BASE_TEST_CONSTANTS.ts +80 -0
  11. package/constants/CHROME_DRIVER_CONSTANTS.ts +54 -0
  12. package/constants/FACTORY_TEST_CONSTANTS.ts +61 -0
  13. package/constants/MONACO_CONSTANTS.ts +25 -0
  14. package/constants/OAUTH_CONSTANTS.ts +67 -0
  15. package/constants/PLUGIN_TEST_CONSTANTS.ts +15 -0
  16. package/constants/REPORTER_CONSTANTS.ts +53 -0
  17. package/constants/TIMEOUT_CONSTANTS.ts +131 -0
  18. package/dist/configs/inversify.config.js +14 -8
  19. package/dist/configs/inversify.config.js.map +1 -1
  20. package/dist/configs/inversify.types.js +2 -2
  21. package/dist/configs/inversify.types.js.map +1 -1
  22. package/dist/configs/mocharc.js +13 -16
  23. package/dist/configs/mocharc.js.map +1 -1
  24. package/dist/constants/{APITestConstants.js → API_TEST_CONSTANTS.js} +13 -13
  25. package/dist/constants/API_TEST_CONSTANTS.js.map +1 -0
  26. package/dist/constants/{BaseTestConstants.js → BASE_TEST_CONSTANTS.js} +17 -16
  27. package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -0
  28. package/dist/constants/{ChromeDriverConstants.js → CHROME_DRIVER_CONSTANTS.js} +14 -14
  29. package/dist/constants/CHROME_DRIVER_CONSTANTS.js.map +1 -0
  30. package/dist/constants/{FactoryTestConstants.js → FACTORY_TEST_CONSTANTS.js} +15 -14
  31. package/dist/constants/FACTORY_TEST_CONSTANTS.js.map +1 -0
  32. package/dist/constants/{MonacoConstants.js → MONACO_CONSTANTS.js} +8 -8
  33. package/dist/constants/MONACO_CONSTANTS.js.map +1 -0
  34. package/dist/constants/{OAuthConstants.js → OAUTH_CONSTANTS.js} +15 -15
  35. package/dist/constants/OAUTH_CONSTANTS.js.map +1 -0
  36. package/dist/constants/{PluginsTestConstants.js → PLUGIN_TEST_CONSTANTS.js} +7 -7
  37. package/dist/constants/PLUGIN_TEST_CONSTANTS.js.map +1 -0
  38. package/dist/constants/{ReporterConstants.js → REPORTER_CONSTANTS.js} +13 -13
  39. package/dist/constants/REPORTER_CONSTANTS.js.map +1 -0
  40. package/dist/constants/{TimeoutConstants.js → TIMEOUT_CONSTANTS.js} +24 -24
  41. package/dist/constants/TIMEOUT_CONSTANTS.js.map +1 -0
  42. package/dist/driver/ChromeDriver.js +12 -16
  43. package/dist/driver/ChromeDriver.js.map +1 -1
  44. package/dist/index.js +9 -9
  45. package/dist/index.js.map +1 -1
  46. package/dist/pageobjects/dashboard/CreateWorkspace.js +18 -18
  47. package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
  48. package/dist/pageobjects/dashboard/Dashboard.js +27 -27
  49. package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
  50. package/dist/pageobjects/dashboard/Workspaces.js +42 -42
  51. package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
  52. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +44 -33
  53. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
  54. package/dist/pageobjects/git-providers/OauthPage.js +37 -35
  55. package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
  56. package/dist/pageobjects/ide/CheCodeLocatorLoader.js +10 -10
  57. package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
  58. package/dist/pageobjects/login/interfaces/ICheLoginPage.js +2 -2
  59. package/dist/pageobjects/login/interfaces/IOcpLoginPage.js +2 -2
  60. package/dist/pageobjects/login/kubernetes/DexLoginPage.js +10 -10
  61. package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -1
  62. package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +6 -6
  63. package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
  64. package/dist/pageobjects/login/openshift/OcpLoginPage.js +23 -23
  65. package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -1
  66. package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +7 -7
  67. package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
  68. package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +7 -7
  69. package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
  70. package/dist/pageobjects/login/openshift/RedHatLoginPage.js +11 -11
  71. package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
  72. package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +10 -10
  73. package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
  74. package/dist/pageobjects/openshift/OcpApplicationPage.js +7 -7
  75. package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -1
  76. package/dist/pageobjects/openshift/OcpImportFromGitPage.js +9 -9
  77. package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -1
  78. package/dist/pageobjects/openshift/OcpMainPage.js +15 -15
  79. package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
  80. package/dist/specs/MochaHooks.js +27 -24
  81. package/dist/specs/MochaHooks.js.map +1 -1
  82. package/dist/specs/SmokeTest.spec.js +17 -13
  83. package/dist/specs/SmokeTest.spec.js.map +1 -1
  84. package/dist/specs/api/ContainerOverridesAPI.spec.js +10 -1
  85. package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
  86. package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +31 -18
  87. package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
  88. package/dist/specs/api/EmptyWorkspaceAPI.spec.js +18 -12
  89. package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
  90. package/dist/specs/api/PodOverridesAPI.spec.js +12 -2
  91. package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
  92. package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +12 -8
  93. package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
  94. package/dist/specs/dashboard-samples/Quarkus.spec.js +13 -9
  95. package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
  96. package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +47 -43
  97. package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
  98. package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +17 -10
  99. package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
  100. package/dist/specs/factory/Factory.spec.js +28 -26
  101. package/dist/specs/factory/Factory.spec.js.map +1 -1
  102. package/dist/specs/factory/NoSetupRepoFactory.spec.js +41 -36
  103. package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
  104. package/dist/specs/factory/RefusedOAuthFactory.spec.js +37 -35
  105. package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
  106. package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +18 -5
  107. package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
  108. package/dist/tests-library/LoginTests.js +7 -7
  109. package/dist/tests-library/LoginTests.js.map +1 -1
  110. package/dist/tests-library/ProjectAndFileTests.js +9 -7
  111. package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
  112. package/dist/tests-library/WorkspaceHandlingTests.js +61 -78
  113. package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
  114. package/dist/utils/BrowserTabsUtil.js +29 -24
  115. package/dist/utils/BrowserTabsUtil.js.map +1 -1
  116. package/dist/utils/CheReporter.js +44 -44
  117. package/dist/utils/CheReporter.js.map +1 -1
  118. package/dist/utils/DevWorkspaceConfigurationHelper.js +19 -10
  119. package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
  120. package/dist/utils/DevfilesRegistryHelper.js +25 -19
  121. package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
  122. package/dist/utils/DriverHelper.js +126 -128
  123. package/dist/utils/DriverHelper.js.map +1 -1
  124. package/dist/utils/KubernetesCommandLineToolsExecutor.js +53 -46
  125. package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
  126. package/dist/utils/Logger.js +62 -39
  127. package/dist/utils/Logger.js.map +1 -1
  128. package/dist/utils/ScreenCatcher.js +18 -12
  129. package/dist/utils/ScreenCatcher.js.map +1 -1
  130. package/dist/utils/ShellExecutor.js +9 -0
  131. package/dist/utils/ShellExecutor.js.map +1 -1
  132. package/dist/utils/StringUtil.js +17 -9
  133. package/dist/utils/StringUtil.js.map +1 -1
  134. package/dist/utils/request-handlers/CheApiRequestHandler.js +36 -34
  135. package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
  136. package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +10 -6
  137. package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
  138. package/dist/utils/request-handlers/headers/IAuthorizationHeaderHandler.js +2 -2
  139. package/dist/utils/workspace/ApiUrlResolver.js +5 -5
  140. package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
  141. package/dist/utils/workspace/ITestWorkspaceUtil.js +2 -2
  142. package/dist/utils/workspace/TestWorkspaceUtil.js +36 -30
  143. package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
  144. package/dist/utils/workspace/WorkspaceStatus.js +2 -2
  145. package/dist/utils/workspace/WorkspaceStatus.js.map +1 -1
  146. package/driver/ChromeDriver.ts +45 -51
  147. package/driver/IDriver.ts +3 -3
  148. package/index.ts +9 -9
  149. package/package.json +59 -49
  150. package/pageobjects/dashboard/CreateWorkspace.ts +65 -56
  151. package/pageobjects/dashboard/Dashboard.ts +101 -100
  152. package/pageobjects/dashboard/Workspaces.ts +197 -166
  153. package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +151 -127
  154. package/pageobjects/git-providers/OauthPage.ts +177 -166
  155. package/pageobjects/ide/CheCodeLocatorLoader.ts +49 -46
  156. package/pageobjects/login/interfaces/ICheLoginPage.ts +3 -3
  157. package/pageobjects/login/interfaces/IOcpLoginPage.ts +3 -3
  158. package/pageobjects/login/kubernetes/DexLoginPage.ts +32 -31
  159. package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +16 -15
  160. package/pageobjects/login/openshift/OcpLoginPage.ts +62 -55
  161. package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +30 -25
  162. package/pageobjects/login/openshift/OcpUserLoginPage.ts +16 -19
  163. package/pageobjects/login/openshift/RedHatLoginPage.ts +49 -44
  164. package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +39 -35
  165. package/pageobjects/openshift/OcpApplicationPage.ts +21 -20
  166. package/pageobjects/openshift/OcpImportFromGitPage.ts +70 -68
  167. package/pageobjects/openshift/OcpMainPage.ts +69 -68
  168. package/resources/pod-overrides-airgap.yaml +37 -0
  169. package/specs/MochaHooks.ts +59 -50
  170. package/specs/SmokeTest.spec.ts +43 -36
  171. package/specs/api/ContainerOverridesAPI.spec.ts +33 -26
  172. package/specs/api/DevfileAcceptanceTestAPI.spec.ts +107 -94
  173. package/specs/api/EmptyWorkspaceAPI.spec.ts +62 -57
  174. package/specs/api/PodOverridesAPI.spec.ts +42 -32
  175. package/specs/dashboard-samples/EmptyWorkspace.spec.ts +31 -27
  176. package/specs/dashboard-samples/Quarkus.spec.ts +34 -30
  177. package/specs/dashboard-samples/RecommendedExtensions.spec.ts +192 -170
  178. package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +62 -55
  179. package/specs/factory/Factory.spec.ts +178 -166
  180. package/specs/factory/NoSetupRepoFactory.spec.ts +227 -210
  181. package/specs/factory/RefusedOAuthFactory.spec.ts +219 -203
  182. package/specs/miscellaneous/PredefinedNamespace.spec.ts +64 -50
  183. package/tests-library/LoginTests.ts +34 -32
  184. package/tests-library/ProjectAndFileTests.ts +21 -18
  185. package/tests-library/WorkspaceHandlingTests.ts +98 -108
  186. package/tsconfig.json +15 -15
  187. package/utils/BrowserTabsUtil.ts +104 -98
  188. package/utils/CheReporter.ts +142 -148
  189. package/utils/DevWorkspaceConfigurationHelper.ts +70 -61
  190. package/utils/DevfilesRegistryHelper.ts +67 -58
  191. package/utils/DriverHelper.ts +726 -701
  192. package/utils/KubernetesCommandLineToolsExecutor.ts +196 -172
  193. package/utils/Logger.ts +104 -75
  194. package/utils/ScreenCatcher.ts +59 -48
  195. package/utils/ShellExecutor.ts +19 -11
  196. package/utils/StringUtil.ts +40 -32
  197. package/utils/request-handlers/CheApiRequestHandler.ts +92 -87
  198. package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +32 -21
  199. package/utils/request-handlers/headers/IAuthorizationHeaderHandler.ts +3 -3
  200. package/utils/workspace/ApiUrlResolver.ts +31 -26
  201. package/utils/workspace/ITestWorkspaceUtil.ts +31 -31
  202. package/utils/workspace/TestWorkspaceUtil.ts +153 -142
  203. package/utils/workspace/WorkspaceStatus.ts +5 -5
  204. package/constants/APITestConstants.ts +0 -56
  205. package/constants/BaseTestConstants.ts +0 -65
  206. package/constants/ChromeDriverConstants.ts +0 -46
  207. package/constants/FactoryTestConstants.ts +0 -51
  208. package/constants/MonacoConstants.ts +0 -22
  209. package/constants/OAuthConstants.ts +0 -57
  210. package/constants/PluginsTestConstants.ts +0 -15
  211. package/constants/ReporterConstants.ts +0 -45
  212. package/constants/TimeoutConstants.ts +0 -113
  213. package/dist/constants/APITestConstants.js.map +0 -1
  214. package/dist/constants/BaseTestConstants.js.map +0 -1
  215. package/dist/constants/ChromeDriverConstants.js.map +0 -1
  216. package/dist/constants/FactoryTestConstants.js.map +0 -1
  217. package/dist/constants/MonacoConstants.js.map +0 -1
  218. package/dist/constants/OAuthConstants.js.map +0 -1
  219. package/dist/constants/PluginsTestConstants.js.map +0 -1
  220. package/dist/constants/ReporterConstants.js.map +0 -1
  221. package/dist/constants/TimeoutConstants.js.map +0 -1
  222. package/tslint.json +0 -126
@@ -18,17 +18,17 @@ const inversify_types_1 = require("../configs/inversify.types");
18
18
  const selenium_webdriver_1 = require("selenium-webdriver");
19
19
  require("reflect-metadata");
20
20
  const Logger_1 = require("./Logger");
21
- const TimeoutConstants_1 = require("../constants/TimeoutConstants");
21
+ const TIMEOUT_CONSTANTS_1 = require("../constants/TIMEOUT_CONSTANTS");
22
22
  let DriverHelper = class DriverHelper {
23
23
  constructor(driver) {
24
24
  this.driver = driver.get();
25
25
  }
26
26
  getAction() {
27
- Logger_1.Logger.trace('DriverHelper.getAction');
27
+ Logger_1.Logger.trace();
28
28
  return this.driver.actions();
29
29
  }
30
30
  async isVisible(locator) {
31
- Logger_1.Logger.trace(`DriverHelper.isVisible ${locator}`);
31
+ Logger_1.Logger.trace(`${locator}`);
32
32
  try {
33
33
  const element = await this.driver.findElement(locator);
34
34
  return await element.isDisplayed();
@@ -38,15 +38,15 @@ let DriverHelper = class DriverHelper {
38
38
  }
39
39
  }
40
40
  async wait(milliseconds) {
41
- Logger_1.Logger.trace(`DriverHelper.wait (${milliseconds} milliseconds)`);
41
+ Logger_1.Logger.trace(`(${milliseconds} milliseconds)`);
42
42
  await this.driver.sleep(milliseconds);
43
43
  }
44
44
  async refreshPage() {
45
- Logger_1.Logger.trace(`DriverHelper.refreshPage`);
45
+ Logger_1.Logger.trace();
46
46
  await this.driver.navigate().refresh();
47
47
  }
48
- async waitVisibilityBoolean(locator, attempts = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_ATTEMPTS, polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING) {
49
- Logger_1.Logger.trace(`DriverHelper.waitVisibilityBoolean ${locator}`);
48
+ async waitVisibilityBoolean(locator, attempts = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_ATTEMPTS, polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING) {
49
+ Logger_1.Logger.trace(`${locator}`);
50
50
  for (let i = 0; i < attempts; i++) {
51
51
  const isVisible = await this.isVisible(locator);
52
52
  if (isVisible) {
@@ -56,8 +56,8 @@ let DriverHelper = class DriverHelper {
56
56
  }
57
57
  return false;
58
58
  }
59
- async waitDisappearanceBoolean(locator, attempts = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_ATTEMPTS, polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING) {
60
- Logger_1.Logger.trace(`DriverHelper.waitDisappearanceBoolean ${locator}`);
59
+ async waitDisappearanceBoolean(locator, attempts = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_ATTEMPTS, polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING) {
60
+ Logger_1.Logger.trace(`${locator}`);
61
61
  for (let i = 0; i < attempts; i++) {
62
62
  const isVisible = await this.isVisible(locator);
63
63
  if (!isVisible) {
@@ -67,10 +67,10 @@ let DriverHelper = class DriverHelper {
67
67
  }
68
68
  return false;
69
69
  }
70
- async waitVisibility(elementLocator, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
71
- const polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
70
+ async waitVisibility(elementLocator, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
71
+ const polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
72
72
  const attempts = Math.ceil(timeout / polling);
73
- Logger_1.Logger.trace(`DriverHelper.waitVisibility ${elementLocator}`);
73
+ Logger_1.Logger.trace(`${elementLocator}`);
74
74
  for (let i = 0; i < attempts; i++) {
75
75
  let element;
76
76
  try {
@@ -78,123 +78,122 @@ let DriverHelper = class DriverHelper {
78
78
  }
79
79
  catch (err) {
80
80
  if (i >= attempts - 1) {
81
- Logger_1.Logger.error(`DriverHelper.waitVisibility - failed with exception, out of attempts - ${err}`);
81
+ Logger_1.Logger.error(`failed with exception, out of attempts - ${err}`);
82
82
  throw err;
83
83
  }
84
84
  if (err instanceof selenium_webdriver_1.error.TimeoutError) {
85
- if (attempts !== 1) { // waitVisibility was spamming other methods when the number of attempts was 1 - only show message if attempts > 1
86
- Logger_1.Logger.trace(`DriverHelper.waitVisibility - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
85
+ if (attempts !== 1) {
86
+ // waitVisibility was spamming other methods when the number of attempts was 1 - only show message if attempts > 1
87
+ Logger_1.Logger.trace(`polling timed out attempt #${i + 1}, retrying with ${polling}ms timeout`);
87
88
  }
88
89
  continue;
89
90
  }
90
- if (err instanceof selenium_webdriver_1.error.NoSuchWindowError) { // sometimes waitVisibility fails with NoSuchWindowError when the check is run too soon before the page loads
91
- Logger_1.Logger.trace(`DriverHelper.waitVisibility - failed with NoSuchWindow exception. Attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
91
+ if (err instanceof selenium_webdriver_1.error.NoSuchWindowError) {
92
+ // sometimes waitVisibility fails with NoSuchWindowError when the check is run too soon before the page loads
93
+ Logger_1.Logger.trace(`failed with NoSuchWindow exception. Attempt #${i + 1}, retrying with ${polling}ms timeout`);
92
94
  continue;
93
95
  }
94
- Logger_1.Logger.error(`DriverHelper.waitVisibility - failed with an unexpected exception - ${err}`);
96
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
95
97
  throw err;
96
98
  }
97
99
  try {
98
100
  const visibleWebElement = await this.driver.wait(selenium_webdriver_1.until.elementIsVisible(element), polling);
99
- Logger_1.Logger.trace('DriverHelper.waitVisibility - Element is located and is visible.');
101
+ Logger_1.Logger.trace('element is located and is visible.');
100
102
  return visibleWebElement;
101
103
  }
102
104
  catch (err) {
103
105
  if (err instanceof selenium_webdriver_1.error.TimeoutError) {
104
- if (attempts !== 1) { // waitVisibility was spamming other methods when the number of attempts was 1 - only show message if attempts > 1
105
- Logger_1.Logger.trace(`DriverHelper.waitVisibility - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
106
+ if (attempts !== 1) {
107
+ // waitVisibility was spamming other methods when the number of attempts was 1 - only show message if attempts > 1
108
+ Logger_1.Logger.trace(`polling timed out attempt #${i + 1}, retrying with ${polling}ms timeout`);
106
109
  }
107
110
  continue;
108
111
  }
109
112
  if (err instanceof selenium_webdriver_1.error.StaleElementReferenceError) {
110
- Logger_1.Logger.debug(`DriverHelper.waitVisibility - Stale element error - ${err}`);
113
+ Logger_1.Logger.debug(`stale element error - ${JSON.stringify(err)}`);
111
114
  await this.wait(polling);
112
115
  continue;
113
116
  }
114
- Logger_1.Logger.error(`DriverHelper.waitVisibility - failed with an unexpected exception - ${err}`);
117
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
115
118
  throw err;
116
119
  }
117
120
  }
118
- throw new selenium_webdriver_1.error.TimeoutError(`Exceeded maximum visibility checkings attempts for '${elementLocator}' element, timeouted after ${timeout}`);
121
+ throw new selenium_webdriver_1.error.TimeoutError(`Exceeded maximum visibility checking attempts for '${elementLocator}' element, timeouted after ${timeout}`);
119
122
  }
120
- async waitPresence(elementLocator, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
121
- const polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
123
+ async waitPresence(elementLocator, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
124
+ const polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
122
125
  const attempts = Math.ceil(timeout / polling);
123
- Logger_1.Logger.trace(`DriverHelper.waitPresence ${elementLocator}`);
126
+ Logger_1.Logger.trace(`${elementLocator}`);
124
127
  for (let i = 0; i < attempts; i++) {
125
128
  try {
126
129
  return await this.driver.wait(selenium_webdriver_1.until.elementLocated(elementLocator), polling);
127
130
  }
128
131
  catch (err) {
129
132
  if (err instanceof selenium_webdriver_1.error.TimeoutError) {
130
- Logger_1.Logger.trace(`DriverHelper.waitPresence - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
133
+ Logger_1.Logger.trace(`polling timed out attempt #${i + 1}, retrying with ${polling}ms timeout`);
131
134
  continue;
132
135
  }
133
136
  if (err instanceof selenium_webdriver_1.error.StaleElementReferenceError) {
134
137
  await this.wait(polling);
135
138
  continue;
136
139
  }
137
- Logger_1.Logger.error(`DriverHelper.waitPresence - failed with an unexpected exception - ${err}`);
140
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
138
141
  throw err;
139
142
  }
140
143
  }
141
144
  throw new selenium_webdriver_1.error.TimeoutError(`Exceeded maximum presence checking attempts, problems with 'StaleElementReferenceError' of '${elementLocator}' element`);
142
145
  }
143
- async waitAllPresence(elementLocator, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
144
- const polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
146
+ async waitAllPresence(elementLocator, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
147
+ const polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
145
148
  const attempts = Math.ceil(timeout / polling);
146
- Logger_1.Logger.trace(`DriverHelper.waitAllPresence ${elementLocator}`);
149
+ Logger_1.Logger.trace(`${elementLocator}`);
147
150
  for (let i = 0; i < attempts; i++) {
148
151
  try {
149
152
  return await this.driver.wait(selenium_webdriver_1.until.elementsLocated(elementLocator), polling);
150
153
  }
151
154
  catch (err) {
152
155
  if (err instanceof selenium_webdriver_1.error.TimeoutError) {
153
- Logger_1.Logger.trace(`DriverHelper.waitAllPresence - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
156
+ Logger_1.Logger.trace(`polling timed out attempt #${i + 1}, retrying with ${polling}ms timeout`);
154
157
  continue;
155
158
  }
156
159
  if (err instanceof selenium_webdriver_1.error.StaleElementReferenceError) {
157
160
  await this.wait(polling);
158
161
  continue;
159
162
  }
160
- Logger_1.Logger.error(`DriverHelper.waitAllPresence - failed with an unexpected exception - ${err}`);
163
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
161
164
  throw err;
162
165
  }
163
166
  }
164
167
  throw new selenium_webdriver_1.error.TimeoutError(`Exceeded maximum presence checkings attempts, problems with 'StaleElementReferenceError' of '${elementLocator}' element`);
165
168
  }
166
169
  async waitAllVisibility(locators, timeout) {
167
- Logger_1.Logger.trace(`DriverHelper.waitAllVisibility ${locators}`);
170
+ Logger_1.Logger.trace(`${locators}`);
168
171
  for (const elementLocator of locators) {
169
172
  await this.waitVisibility(elementLocator, timeout);
170
173
  }
171
174
  }
172
- async waitDisappearance(elementLocator, attempts = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_ATTEMPTS, polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING) {
173
- Logger_1.Logger.trace(`DriverHelper.waitDisappearance ${elementLocator}`);
175
+ async waitDisappearance(elementLocator, attempts = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_ATTEMPTS, polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING) {
176
+ Logger_1.Logger.trace(`${elementLocator}`);
174
177
  const isDisappeared = await this.waitDisappearanceBoolean(elementLocator, attempts, polling);
175
178
  if (!isDisappeared) {
176
179
  throw new selenium_webdriver_1.error.TimeoutError(`Waiting attempts exceeded, element '${elementLocator}' is still visible`);
177
180
  }
178
181
  }
179
- async waitDisappearanceWithTimeout(elementLocator, timeout) {
180
- Logger_1.Logger.trace(`DriverHelper.waitDisappearanceWithTimeout ${elementLocator}`);
181
- await this.getDriver().wait(async () => {
182
- const isVisible = await this.isVisible(elementLocator);
183
- if (!isVisible) {
184
- return true;
182
+ async waitAllDisappearance(locators, attemptsPerLocator = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_ATTEMPTS, pollingPerLocator = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING) {
183
+ Logger_1.Logger.trace(`${locators}`);
184
+ try {
185
+ for (const elementLocator of locators) {
186
+ await this.waitDisappearance(elementLocator, attemptsPerLocator, pollingPerLocator);
185
187
  }
186
- }, timeout);
187
- }
188
- async waitAllDisappearance(locators, attemptsPerLocator = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_ATTEMPTS, pollingPerLocator = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING) {
189
- Logger_1.Logger.trace(`DriverHelper.waitAllDisappearance ${locators}`);
190
- for (const elementLocator of locators) {
191
- await this.waitDisappearance(elementLocator, attemptsPerLocator, pollingPerLocator);
188
+ }
189
+ catch (e) {
190
+ throw e;
192
191
  }
193
192
  }
194
- async waitAndClick(elementLocator, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
195
- const polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
193
+ async waitAndClick(elementLocator, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
194
+ const polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
196
195
  const attempts = Math.ceil(timeout / polling);
197
- Logger_1.Logger.trace(`DriverHelper.waitAndClick ${elementLocator}`);
196
+ Logger_1.Logger.trace(`${elementLocator}`);
198
197
  for (let i = 0; i < attempts; i++) {
199
198
  let element;
200
199
  try {
@@ -202,14 +201,14 @@ let DriverHelper = class DriverHelper {
202
201
  }
203
202
  catch (err) {
204
203
  if (i >= attempts - 1) {
205
- Logger_1.Logger.error(`DriverHelper.waitAndClick - failed with exception, out of attempts - ${err}`);
204
+ Logger_1.Logger.error(`failed with exception, out of attempts - ${err}`);
206
205
  throw err;
207
206
  }
208
207
  if (err instanceof selenium_webdriver_1.error.TimeoutError) {
209
- Logger_1.Logger.trace(`DriverHelper.waitAndClick - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
208
+ Logger_1.Logger.trace(`polling timed out attempt #${i + 1}, retrying with ${polling}ms timeout`);
210
209
  continue;
211
210
  }
212
- Logger_1.Logger.error(`DriverHelper.waitAndClick - failed with an unexpected exception - ${err}`);
211
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
213
212
  throw err;
214
213
  }
215
214
  try {
@@ -221,12 +220,12 @@ let DriverHelper = class DriverHelper {
221
220
  return err instanceof selenium_webdriver_1.error.ElementClickInterceptedError && i === attempts - 1;
222
221
  }
223
222
  if (err instanceof selenium_webdriver_1.error.StaleElementReferenceError || err instanceof selenium_webdriver_1.error.ElementClickInterceptedError) {
224
- Logger_1.Logger.debug(`DriverHelper.waitAndClick - ${elementLocator} - ${err}`);
223
+ Logger_1.Logger.debug(`${elementLocator} - ${JSON.stringify(err)}`);
225
224
  await this.wait(polling);
226
225
  continue;
227
226
  }
228
227
  if (isElementClickInterceptedOnLastAttempt(err, i)) {
229
- Logger_1.Logger.debug(`DriverHelper.waitAndClick - Element is not clickable, try to perform pointer click`);
228
+ Logger_1.Logger.debug('element is not clickable, try to perform pointer click');
230
229
  await this.getAction()
231
230
  .move({
232
231
  origin: await this.waitPresence(elementLocator)
@@ -235,16 +234,16 @@ let DriverHelper = class DriverHelper {
235
234
  .perform();
236
235
  return;
237
236
  }
238
- Logger_1.Logger.error(`DriverHelper.waitAndClick - failed with an unexpected exception - ${err}`);
237
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
239
238
  throw err;
240
239
  }
241
240
  }
242
241
  throw new selenium_webdriver_1.error.TimeoutError(`Exceeded maximum clicking attempts, the '${elementLocator}' element is not clickable`);
243
242
  }
244
- async waitAndGetElementAttribute(elementLocator, attribute, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
245
- const polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
243
+ async waitAndGetElementAttribute(elementLocator, attribute, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
244
+ const polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
246
245
  const attempts = Math.ceil(timeout / polling);
247
- Logger_1.Logger.trace(`DriverHelper.waitAndGetElementAttribute ${elementLocator} attribute: '${attribute}'`);
246
+ Logger_1.Logger.trace(`${elementLocator} attribute: '${attribute}'`);
248
247
  for (let i = 0; i < attempts; i++) {
249
248
  let element;
250
249
  try {
@@ -252,14 +251,14 @@ let DriverHelper = class DriverHelper {
252
251
  }
253
252
  catch (err) {
254
253
  if (i >= attempts - 1) {
255
- Logger_1.Logger.error(`DriverHelper.waitAndGetElementAttribute - failed with exception, out of attempts - ${err}`);
254
+ Logger_1.Logger.error(`failed with exception, out of attempts - ${err}`);
256
255
  throw err;
257
256
  }
258
257
  if (err instanceof selenium_webdriver_1.error.TimeoutError) {
259
- Logger_1.Logger.trace(`DriverHelper.waitAndGetElementAttribute - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
258
+ Logger_1.Logger.trace(`polling timed out attempt #${i + 1}, retrying with ${polling}ms timeout`);
260
259
  continue;
261
260
  }
262
- Logger_1.Logger.error(`DriverHelper.waitAndGetElementAttribute - failed with an unexpected exception - ${err}`);
261
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
263
262
  throw err;
264
263
  }
265
264
  try {
@@ -270,16 +269,16 @@ let DriverHelper = class DriverHelper {
270
269
  await this.wait(polling);
271
270
  continue;
272
271
  }
273
- Logger_1.Logger.error(`DriverHelper.waitAndGetElementAttribute - failed with an unexpected exception - ${err}`);
272
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
274
273
  throw err;
275
274
  }
276
275
  }
277
276
  throw new selenium_webdriver_1.error.TimeoutError(`Exceeded maximum gettin of the '${attribute}' attribute attempts, from the '${elementLocator}' element`);
278
277
  }
279
- async waitAndGetCssValue(elementLocator, cssAttribute, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
280
- const polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
278
+ async waitAndGetCssValue(elementLocator, cssAttribute, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
279
+ const polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
281
280
  const attempts = Math.ceil(timeout / polling);
282
- Logger_1.Logger.trace(`DriverHelper.waitAndGetCssValue ${elementLocator} cssAttribute: ${cssAttribute}`);
281
+ Logger_1.Logger.trace(`${elementLocator} cssAttribute: ${cssAttribute}`);
283
282
  for (let i = 0; i < attempts; i++) {
284
283
  let element;
285
284
  try {
@@ -287,14 +286,14 @@ let DriverHelper = class DriverHelper {
287
286
  }
288
287
  catch (err) {
289
288
  if (i >= attempts - 1) {
290
- Logger_1.Logger.error(`DriverHelper.waitAndGetCssValue - failed with exception, out of attempts - ${err}`);
289
+ Logger_1.Logger.error(`failed with exception, out of attempts - ${err}`);
291
290
  throw err;
292
291
  }
293
292
  if (err instanceof selenium_webdriver_1.error.TimeoutError) {
294
- Logger_1.Logger.trace(`DriverHelper.waitAndGetCssValue - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
293
+ Logger_1.Logger.trace(`polling timed out attempt #${i + 1}, retrying with ${polling}ms timeout`);
295
294
  continue;
296
295
  }
297
- Logger_1.Logger.error(`DriverHelper.waitAndGetCssValue - failed with an unexpected exception - ${err}`);
296
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
298
297
  throw err;
299
298
  }
300
299
  try {
@@ -305,27 +304,27 @@ let DriverHelper = class DriverHelper {
305
304
  await this.wait(polling);
306
305
  continue;
307
306
  }
308
- Logger_1.Logger.error(`DriverHelper.waitAndGetCssValue - failed with an unexpected exception - ${err}`);
307
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
309
308
  throw err;
310
309
  }
311
310
  }
312
311
  throw new selenium_webdriver_1.error.TimeoutError(`Exceeded maximum gettin of the '${cssAttribute}' css attribute attempts, from the '${elementLocator}' element`);
313
312
  }
314
313
  async waitAttributeValue(elementLocator, attribute, expectedValue, timeout) {
315
- Logger_1.Logger.trace(`DriverHelper.waitAttributeValue ${elementLocator}`);
314
+ Logger_1.Logger.trace(`${elementLocator}`);
316
315
  await this.driver.wait(async () => {
317
316
  const attributeValue = await this.waitAndGetElementAttribute(elementLocator, attribute, timeout);
318
317
  return expectedValue === attributeValue;
319
318
  }, timeout, `The '${attribute}' attribute value doesn't match with expected value '${expectedValue}'`);
320
319
  }
321
- async type(elementLocator, text, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
322
- const polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
320
+ async type(elementLocator, text, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
321
+ const polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
323
322
  const attempts = Math.ceil(timeout / polling);
324
323
  if (elementLocator.toString().toLocaleLowerCase().includes('password')) {
325
- Logger_1.Logger.trace(`DriverHelper.type ${elementLocator} text: ***`);
324
+ Logger_1.Logger.trace(`${elementLocator} text: ***`);
326
325
  }
327
326
  else {
328
- Logger_1.Logger.trace(`DriverHelper.type ${elementLocator} text: ${text}`);
327
+ Logger_1.Logger.trace(`${elementLocator} text: ${text}`);
329
328
  }
330
329
  for (let i = 0; i < attempts; i++) {
331
330
  let element;
@@ -334,14 +333,14 @@ let DriverHelper = class DriverHelper {
334
333
  }
335
334
  catch (err) {
336
335
  if (i >= attempts - 1) {
337
- Logger_1.Logger.error(`DriverHelper.type - failed with exception, out of attempts - ${err}`);
336
+ Logger_1.Logger.error(`failed with exception, out of attempts - ${err}`);
338
337
  throw err;
339
338
  }
340
339
  if (err instanceof selenium_webdriver_1.error.TimeoutError) {
341
- Logger_1.Logger.trace(`DriverHelper.type - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
340
+ Logger_1.Logger.trace(`polling timed out attempt #${i + 1}, retrying with ${polling}ms timeout`);
342
341
  continue;
343
342
  }
344
- Logger_1.Logger.error(`DriverHelper.type - failed with an unexpected exception - ${err}`);
343
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
345
344
  throw err;
346
345
  }
347
346
  try {
@@ -353,16 +352,16 @@ let DriverHelper = class DriverHelper {
353
352
  await this.wait(polling);
354
353
  continue;
355
354
  }
356
- Logger_1.Logger.error(`DriverHelper.type - failed with an unexpected exception - ${err}`);
355
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
357
356
  throw err;
358
357
  }
359
358
  }
360
359
  throw new selenium_webdriver_1.error.TimeoutError(`Exceeded maximum typing attempts, to the '${elementLocator}' element`);
361
360
  }
362
- async typeToInvisible(elementLocator, text, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
363
- const polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
361
+ async typeToInvisible(elementLocator, text, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
362
+ const polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
364
363
  const attempts = Math.ceil(timeout / polling);
365
- Logger_1.Logger.trace(`DriverHelper.typeToInvisible ${elementLocator} text: ${text}`);
364
+ Logger_1.Logger.trace(`${elementLocator} text: ${text}`);
366
365
  for (let i = 0; i < attempts; i++) {
367
366
  let element;
368
367
  try {
@@ -370,14 +369,14 @@ let DriverHelper = class DriverHelper {
370
369
  }
371
370
  catch (err) {
372
371
  if (i >= attempts - 1) {
373
- Logger_1.Logger.error(`DriverHelper.typeToInvisible - failed with exception, out of attempts - ${err}`);
372
+ Logger_1.Logger.error(`failed with exception, out of attempts - ${err}`);
374
373
  throw err;
375
374
  }
376
375
  if (err instanceof selenium_webdriver_1.error.TimeoutError) {
377
- Logger_1.Logger.trace(`DriverHelper.typeToInvisible - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
376
+ Logger_1.Logger.trace(`polling timed out attempt #${i + 1}, retrying with ${polling}ms timeout`);
378
377
  continue;
379
378
  }
380
- Logger_1.Logger.error(`DriverHelper.typeToInvisible - failed with an unexpected exception - ${err}`);
379
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
381
380
  throw err;
382
381
  }
383
382
  try {
@@ -389,16 +388,16 @@ let DriverHelper = class DriverHelper {
389
388
  await this.wait(polling);
390
389
  continue;
391
390
  }
392
- Logger_1.Logger.error(`DriverHelper.typeToInvisible - failed with an unexpected exception - ${err}`);
391
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
393
392
  throw err;
394
393
  }
395
394
  }
396
395
  throw new selenium_webdriver_1.error.TimeoutError(`Exceeded maximum typing attempts, to the '${elementLocator}' element`);
397
396
  }
398
- async clear(elementLocator, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
399
- const polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
397
+ async clear(elementLocator, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
398
+ const polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
400
399
  const attempts = Math.ceil(timeout / polling);
401
- Logger_1.Logger.trace(`DriverHelper.clear ${elementLocator}`);
400
+ Logger_1.Logger.trace(`${elementLocator}`);
402
401
  for (let i = 0; i < attempts; i++) {
403
402
  let element;
404
403
  try {
@@ -406,14 +405,14 @@ let DriverHelper = class DriverHelper {
406
405
  }
407
406
  catch (err) {
408
407
  if (i >= attempts - 1) {
409
- Logger_1.Logger.error(`DriverHelper.clear - failed with exception, out of attempts - ${err}`);
408
+ Logger_1.Logger.error(`failed with exception, out of attempts - ${err}`);
410
409
  throw err;
411
410
  }
412
411
  if (err instanceof selenium_webdriver_1.error.TimeoutError) {
413
- Logger_1.Logger.trace(`DriverHelper.clear - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
412
+ Logger_1.Logger.trace(`polling timed out attempt #${i + 1}, retrying with ${polling}ms timeout`);
414
413
  continue;
415
414
  }
416
- Logger_1.Logger.error(`DriverHelper.clear - failed with an unexpected exception - ${err}`);
415
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
417
416
  throw err;
418
417
  }
419
418
  try {
@@ -425,16 +424,16 @@ let DriverHelper = class DriverHelper {
425
424
  await this.wait(polling);
426
425
  continue;
427
426
  }
428
- Logger_1.Logger.error(`DriverHelper.clear - failed with an unexpected exception - ${err}`);
427
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
429
428
  throw err;
430
429
  }
431
430
  }
432
431
  throw new selenium_webdriver_1.error.TimeoutError(`Exceeded maximum clearing attempts, to the '${elementLocator}' element`);
433
432
  }
434
- async clearInvisible(elementLocator, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
435
- const polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
433
+ async clearInvisible(elementLocator, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
434
+ const polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
436
435
  const attempts = Math.ceil(timeout / polling);
437
- Logger_1.Logger.trace(`DriverHelper.clearInvisible ${elementLocator}`);
436
+ Logger_1.Logger.trace(`${elementLocator}`);
438
437
  for (let i = 0; i < attempts; i++) {
439
438
  let element;
440
439
  try {
@@ -442,14 +441,14 @@ let DriverHelper = class DriverHelper {
442
441
  }
443
442
  catch (err) {
444
443
  if (i >= attempts - 1) {
445
- Logger_1.Logger.error(`DriverHelper.clearInvisible - failed with exception, out of attempts - ${err}`);
444
+ Logger_1.Logger.error(`failed with exception, out of attempts - ${err}`);
446
445
  throw err;
447
446
  }
448
447
  if (err instanceof selenium_webdriver_1.error.TimeoutError) {
449
- Logger_1.Logger.trace(`DriverHelper.clearInvisible - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
448
+ Logger_1.Logger.trace(`polling timed out attempt #${i + 1}, retrying with ${polling}ms timeout`);
450
449
  continue;
451
450
  }
452
- Logger_1.Logger.error(`DriverHelper.clearInvisible - failed with an unexpected exception - ${err}`);
451
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
453
452
  throw err;
454
453
  }
455
454
  try {
@@ -461,18 +460,18 @@ let DriverHelper = class DriverHelper {
461
460
  await this.wait(polling);
462
461
  continue;
463
462
  }
464
- Logger_1.Logger.error(`DriverHelper.clearInvisible - failed with an unexpected exception - ${err}`);
463
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
465
464
  throw err;
466
465
  }
467
466
  }
468
467
  throw new selenium_webdriver_1.error.TimeoutError(`Exceeded maximum clearing attempts, to the '${elementLocator}' element`);
469
468
  }
470
- async enterValue(elementLocator, text, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
469
+ async enterValue(elementLocator, text, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
471
470
  if (elementLocator.toString().toLocaleLowerCase().includes('password')) {
472
- Logger_1.Logger.trace(`DriverHelper.enterValue ${elementLocator} text: ***`);
471
+ Logger_1.Logger.trace(`${elementLocator} text: ***`);
473
472
  }
474
473
  else {
475
- Logger_1.Logger.trace(`DriverHelper.enterValue ${elementLocator} text: ${text}`);
474
+ Logger_1.Logger.trace(`${elementLocator} text: ${text}`);
476
475
  }
477
476
  await this.waitVisibility(elementLocator, timeout);
478
477
  await this.clear(elementLocator);
@@ -481,13 +480,13 @@ let DriverHelper = class DriverHelper {
481
480
  await this.waitAttributeValue(elementLocator, 'value', text, timeout);
482
481
  }
483
482
  async waitAndSwitchToFrame(iframeLocator, timeout) {
484
- Logger_1.Logger.trace(`DriverHelper.waitAndSwitchToFrame ${iframeLocator}`);
483
+ Logger_1.Logger.trace(`${iframeLocator}`);
485
484
  await this.driver.wait(selenium_webdriver_1.until.ableToSwitchToFrame(iframeLocator), timeout);
486
485
  }
487
- async waitAndGetText(elementLocator, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
488
- const polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
486
+ async waitAndGetText(elementLocator, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
487
+ const polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
489
488
  const attempts = Math.ceil(timeout / polling);
490
- Logger_1.Logger.trace(`DriverHelper.waitAndGetText ${elementLocator}`);
489
+ Logger_1.Logger.trace(`${elementLocator}`);
491
490
  for (let i = 0; i < attempts; i++) {
492
491
  let element;
493
492
  try {
@@ -495,14 +494,14 @@ let DriverHelper = class DriverHelper {
495
494
  }
496
495
  catch (err) {
497
496
  if (i >= attempts - 1) {
498
- Logger_1.Logger.error(`DriverHelper.waitAndGetText - failed with exception, out of attempts - ${err}`);
497
+ Logger_1.Logger.error(`failed with exception, out of attempts - ${err}`);
499
498
  throw err;
500
499
  }
501
500
  if (err instanceof selenium_webdriver_1.error.TimeoutError) {
502
- Logger_1.Logger.trace(`DriverHelper.waitAndGetText - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
501
+ Logger_1.Logger.trace(`polling timed out attempt #${i + 1}, retrying with ${polling}ms timeout`);
503
502
  continue;
504
503
  }
505
- Logger_1.Logger.error(`DriverHelper.waitAndGetText - failed with an unexpected exception - ${err}`);
504
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
506
505
  throw err;
507
506
  }
508
507
  try {
@@ -513,24 +512,24 @@ let DriverHelper = class DriverHelper {
513
512
  await this.wait(polling);
514
513
  continue;
515
514
  }
516
- Logger_1.Logger.error(`DriverHelper.waitAndGetText - failed with an unexpected exception - ${err}`);
515
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
517
516
  throw err;
518
517
  }
519
518
  }
520
519
  throw new selenium_webdriver_1.error.TimeoutError(`Exceeded maximum text obtaining attempts, from the '${elementLocator}' element`);
521
520
  }
522
521
  async waitAndGetValue(elementLocator, timeout) {
523
- Logger_1.Logger.trace(`DriverHelper.waitAndGetValue ${elementLocator}`);
522
+ Logger_1.Logger.trace(`${elementLocator}`);
524
523
  return await this.waitAndGetElementAttribute(elementLocator, 'value', timeout);
525
524
  }
526
525
  async waitUntilTrue(callback, timeout) {
527
- Logger_1.Logger.trace('DriverHelper.waitUntilTrue');
526
+ Logger_1.Logger.trace();
528
527
  await this.driver.wait(callback, timeout);
529
528
  }
530
- async scrollTo(elementLocator, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
531
- const polling = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
529
+ async scrollTo(elementLocator, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
530
+ const polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
532
531
  const attempts = Math.ceil(timeout / polling);
533
- Logger_1.Logger.trace(`DriverHelper.scrollTo ${elementLocator}`);
532
+ Logger_1.Logger.trace(`${elementLocator}`);
534
533
  for (let i = 0; i < attempts; i++) {
535
534
  let element;
536
535
  try {
@@ -538,19 +537,18 @@ let DriverHelper = class DriverHelper {
538
537
  }
539
538
  catch (err) {
540
539
  if (i >= attempts - 1) {
541
- Logger_1.Logger.error(`DriverHelper.scrollTo - failed with exception, out of attempts - ${err}`);
540
+ Logger_1.Logger.error(`failed with exception, out of attempts - ${err}`);
542
541
  throw err;
543
542
  }
544
543
  if (err instanceof selenium_webdriver_1.error.TimeoutError) {
545
- Logger_1.Logger.trace(`DriverHelper.scrollTo - Polling timed out attempt #${(i + 1)}, retrying with ${polling}ms timeout`);
544
+ Logger_1.Logger.trace(`polling timed out attempt #${i + 1}, retrying with ${polling}ms timeout`);
546
545
  continue;
547
546
  }
548
- Logger_1.Logger.error(`DriverHelper.scrollTo - failed with an unexpected exception - ${err}`);
547
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
549
548
  throw err;
550
549
  }
551
550
  try {
552
- await this.getDriver()
553
- .executeScript('arguments[0].scrollIntoView(true);', element);
551
+ await this.getDriver().executeScript('arguments[0].scrollIntoView(true);', element);
554
552
  return;
555
553
  }
556
554
  catch (err) {
@@ -558,26 +556,26 @@ let DriverHelper = class DriverHelper {
558
556
  await this.wait(polling);
559
557
  continue;
560
558
  }
561
- Logger_1.Logger.error(`DriverHelper.scrollTo - failed with an unexpected exception - ${err}`);
559
+ Logger_1.Logger.error(`failed with an unexpected exception - ${err}`);
562
560
  throw err;
563
561
  }
564
562
  }
565
563
  throw new selenium_webdriver_1.error.TimeoutError(`Exceeded maximum mouse move attempts, for the '${elementLocator}' element`);
566
564
  }
567
- async scrollToAndClick(elementLocator, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
565
+ async scrollToAndClick(elementLocator, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
568
566
  await this.scrollTo(elementLocator, timeout);
569
567
  await this.waitAndClick(elementLocator, timeout);
570
568
  }
571
- async scrollToAndEnterValue(elementLocator, value, timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
569
+ async scrollToAndEnterValue(elementLocator, value, timeout = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) {
572
570
  await this.scrollTo(elementLocator, timeout);
573
571
  await this.enterValue(elementLocator, value, timeout);
574
572
  }
575
573
  // method is useful to debug page object elements
576
574
  async highLightElement(element) {
577
- await this.getDriver().executeScript('arguments[0].style.border=\'2px solid red\'', element);
575
+ await this.getDriver().executeScript('arguments[0].style.border="2px solid red"', element);
578
576
  }
579
577
  getDriver() {
580
- Logger_1.Logger.trace('DriverHelper.getDriver');
578
+ Logger_1.Logger.trace();
581
579
  return this.driver;
582
580
  }
583
581
  };