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