From 2600b2a477521fd8406233efb8e84c13db6193be Mon Sep 17 00:00:00 2001 From: Karol Frankiewicz Date: Thu, 17 Oct 2019 01:50:49 +0200 Subject: [PATCH 1/5] remove timeouts limitation - remove max timeout for login modifier and fix default timeout to be consistent with documentation; --- .../aet/job/common/modifiers/login/LoginModifierConfig.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/jobs/src/main/java/com/cognifide/aet/job/common/modifiers/login/LoginModifierConfig.java b/core/jobs/src/main/java/com/cognifide/aet/job/common/modifiers/login/LoginModifierConfig.java index c6077cfaa..4c37de76a 100644 --- a/core/jobs/src/main/java/com/cognifide/aet/job/common/modifiers/login/LoginModifierConfig.java +++ b/core/jobs/src/main/java/com/cognifide/aet/job/common/modifiers/login/LoginModifierConfig.java @@ -54,7 +54,7 @@ class LoginModifierConfig { private static final String FORCE_LOGIN = "force-login"; - private static final String DEFAULT_CHECK_TIMEOUT_PARAM = "1000"; + private static final String DEFAULT_CHECK_TIMEOUT_PARAM = "5000"; private static final String RETRIAL_NUMBER_PARAM = "retrial-number"; @@ -98,8 +98,6 @@ public LoginModifierConfig(Map params) throws ParametersExceptio .toInt(getParameter(params, RETRIAL_NUMBER_PARAM, DEFAULT_RETRIAL_NUMBER)); ParametersValidator.checkNotBlank(loginPage, "`login-page` parameter is mandatory"); - ParametersValidator.checkRange(delayBeforeLoginCheckOrReattempt, 0, 10000, - "Timeout duration should be greater than 0 and less than 10 seconds"); ParametersValidator .checkRange(retrialNumber, 1, Integer.MAX_VALUE, "Retrial number has to be at least 1"); } From f11895434927229c68e42fee7b169de0353cfa87 Mon Sep 17 00:00:00 2001 From: Karol Frankiewicz Date: Thu, 17 Oct 2019 02:13:00 +0200 Subject: [PATCH 2/5] remove timeouts limitation - remove max timeout for WebElements locator --- .../aet/job/common/modifiers/WebElementsLocatorParams.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/core/jobs/src/main/java/com/cognifide/aet/job/common/modifiers/WebElementsLocatorParams.java b/core/jobs/src/main/java/com/cognifide/aet/job/common/modifiers/WebElementsLocatorParams.java index 4de42b059..f4003e840 100644 --- a/core/jobs/src/main/java/com/cognifide/aet/job/common/modifiers/WebElementsLocatorParams.java +++ b/core/jobs/src/main/java/com/cognifide/aet/job/common/modifiers/WebElementsLocatorParams.java @@ -31,8 +31,6 @@ abstract public class WebElementsLocatorParams { protected static final String EXCLUDE_ELEMENT_PARAM = "exclude-elements"; - private static final long TIMEOUT_SECONDS_MAX_VALUE = 15L; - private static final long TIMEOUT_SECONDS_DEFAULT_VALUE = 1L; private By locator; @@ -75,9 +73,6 @@ private void initializeTimeOutParam(String timeoutString) throws ParametersExcep .convert(Long.valueOf(timeoutString), TimeUnit.MILLISECONDS); if (timeoutInSeconds < 0) { throw new ParametersException("'timeout' parameter value should be greater or equal zero."); - } else if (TIMEOUT_SECONDS_MAX_VALUE < timeoutInSeconds) { - throw new ParametersException("'timeout' parameter value can't be greater than " - + Long.toString(TIMEOUT_SECONDS_MAX_VALUE) + " seconds."); } } } From a44953fae8c0eea3ab23628659c138d740b9e08f Mon Sep 17 00:00:00 2001 From: Karol Frankiewicz Date: Thu, 17 Oct 2019 02:27:40 +0200 Subject: [PATCH 3/5] remove timeouts limitation - documentation update --- documentation/src/main/wiki/ClickModifier.md | 2 +- documentation/src/main/wiki/HideModifier.md | 2 +- documentation/src/main/wiki/ReplaceTextModifier.md | 2 +- documentation/src/main/wiki/ScreenCollector.md | 2 +- .../src/main/wiki/WaitForElementToBeVisibleModifier.md | 2 +- documentation/src/main/wiki/WaitForImageCompletionModifier.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/documentation/src/main/wiki/ClickModifier.md b/documentation/src/main/wiki/ClickModifier.md index 4aa4d085d..1e099d5f3 100644 --- a/documentation/src/main/wiki/ClickModifier.md +++ b/documentation/src/main/wiki/ClickModifier.md @@ -13,7 +13,7 @@ Module name: **click** | --------- | ------------- | ----------- | --------- | | `xpath` | | xpath of the element to be clicked | xpath or css | | `css` | | css selector of the element to be clicked | xpath or css | -| `timeout` | 1000ms | The timeout for the element to appear, in milliseconds. The max value of this parameter is 15000 milliseconds (15 seconds). | no (default will be used) | +| `timeout` | 1000ms | The timeout for the element to appear, in milliseconds. | no (default will be used) | ##### Example Usage diff --git a/documentation/src/main/wiki/HideModifier.md b/documentation/src/main/wiki/HideModifier.md index 6f18e9d73..9184384ad 100644 --- a/documentation/src/main/wiki/HideModifier.md +++ b/documentation/src/main/wiki/HideModifier.md @@ -15,7 +15,7 @@ Module name: **hide** | --------- | ----- | ----------- | --------- | | `xpath` | xpath_to_element | Xpath to element(s) to hide | xpath or css | | `css` | css_selector_to_element | css selector to element(s) to hide | xpath or css | -| `timeout` | 1000ms | The timeout for the element to appear, in milliseconds. The max value of this parameter is 15000 milliseconds (15 seconds). | no (default will be used) | +| `timeout` | 1000ms | The timeout for the element to appear, in milliseconds. | no (default will be used) | | `leaveBlankSpace` | boolean | Defines if element(s) should be invisible (effect as using `display=none`) or should be not displayed (effect as using `visibility=hidden`). When set to `true`, blank and transparent space is left in place of the hidden element, otherwise, element is completely removed from the view. When not defined, hide modifier behaves as if `leaveBlankSpace` property was set to `true`. | no | ##### Example Usage diff --git a/documentation/src/main/wiki/ReplaceTextModifier.md b/documentation/src/main/wiki/ReplaceTextModifier.md index adc0e62f7..1ac2c3fa9 100644 --- a/documentation/src/main/wiki/ReplaceTextModifier.md +++ b/documentation/src/main/wiki/ReplaceTextModifier.md @@ -16,7 +16,7 @@ Module name: **replaceText** | `attributeName` | default: "innerHTML" | attribute of selected element to be set, e.g. 'href' or 'value'; attribute value or inner HTML will be replaced/set to 'value' | no | | `xpath` | xpath_to_element | Xpath of element(s)| xpath or css | | `css` | css_selector_to_element | css selector of element(s) | xpath or css | -| `timeout` | 1000ms | The timeout to wait for the element to be present, in milliseconds. The max value of this parameter is 15000 milliseconds (15 seconds). | no (default will be used) | +| `timeout` | 1000ms | The timeout to wait for the element to be present, in milliseconds. | no (default will be used) | ##### Example Usage diff --git a/documentation/src/main/wiki/ScreenCollector.md b/documentation/src/main/wiki/ScreenCollector.md index 3f2dec74d..b5ae63bf3 100644 --- a/documentation/src/main/wiki/ScreenCollector.md +++ b/documentation/src/main/wiki/ScreenCollector.md @@ -20,7 +20,7 @@ Module name: **screen** | `xpath` | xpath_to_element | Xpath to element(s) | optional (either xpath or css) | | `css` | css_selector_to_element | css selector to element(s)| optional (either xpath or css) | | `exclude-elements` | css_selector_to_element | Elements found with that selector will be ignored by layout comparator (they won't affect its results) but will be rendered on the report as captured. | no | -| `timeout` | 1000ms | The timeout for the element to appear, in milliseconds. The max value of this parameter is 15000 milliseconds (15 seconds). | no (default will be used) this parameter applies only in conjunction with xpath or css param | +| `timeout` | 1000ms | The timeout for the element to appear, in milliseconds. | no (default will be used) this parameter applies only in conjunction with xpath or css param | ##### Example Usage diff --git a/documentation/src/main/wiki/WaitForElementToBeVisibleModifier.md b/documentation/src/main/wiki/WaitForElementToBeVisibleModifier.md index 89c0d5935..d93c4bab4 100644 --- a/documentation/src/main/wiki/WaitForElementToBeVisibleModifier.md +++ b/documentation/src/main/wiki/WaitForElementToBeVisibleModifier.md @@ -13,7 +13,7 @@ Module name: **wait-for-element-to-be-visible** | --------- | ------------- | ----------- | --------- | | `xpath` | | an xpath locator which identifies the web element to be found within a web page | xpath or css | | `css` | | a css selector which identifies the web element to be found within a web page | xpath or css | -| `timeout` | 1000ms | a value of timeout for the web element to appear, in milliseconds. The max value of this parameter is 15000 milliseconds (15 seconds). | no (the default value will be used) | +| `timeout` | 1000ms | a value of timeout for the web element to appear, in milliseconds. | no (the default value will be used) | ##### Example Usage diff --git a/documentation/src/main/wiki/WaitForImageCompletionModifier.md b/documentation/src/main/wiki/WaitForImageCompletionModifier.md index ddedd49df..e9b87dfc3 100644 --- a/documentation/src/main/wiki/WaitForImageCompletionModifier.md +++ b/documentation/src/main/wiki/WaitForImageCompletionModifier.md @@ -13,7 +13,7 @@ Module name: **wait-for-element-to-be-visible** | --------- | ------------- | ----------- | --------- | | `xpath` | | an xpath locator which identifies the image to be found and loaded within a web page | xpath or css | | `css` | | a css selector which identifies the image to be found and loaded within a web page | xpath or css | -| `timeout` | 1000ms | a value of timeout for the image to load, in milliseconds. The max value of this parameter is 15000 milliseconds (15 seconds). | no (the default will be used) | +| `timeout` | 1000ms | a value of timeout for the image to load, in milliseconds. | no (the default will be used) | ##### Example Usage From e3555eba58c1131be181245495bc5f7e1d3efad4 Mon Sep 17 00:00:00 2001 From: Karol Frankiewicz Date: Thu, 17 Oct 2019 02:43:53 +0200 Subject: [PATCH 4/5] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 899e18227..6187f395e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to AET will be documented in this file. **List of changes that are finished but not yet released in any final version.** - [PR-522](https://github.com/Cognifide/aet/pull/522) Improve performance of generating /configs/list. ([#519](https://github.com/Cognifide/aet/issues/519)) +- [PR-530](https://github.com/Cognifide/aet/pull/530) Remove max timeouts limitation for login and WebElements wait ([#99](https://github.com/Cognifide/aet/issues/99)) ## Version 3.3.0 From eeb947cf9c9533ca6806acf4e7a5659b393d2152 Mon Sep 17 00:00:00 2001 From: Karol Frankiewicz Date: Thu, 17 Oct 2019 03:12:40 +0200 Subject: [PATCH 5/5] remove timeouts limitation - tests update --- .../job/common/modifiers/click/ClickModifierTest.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/core/jobs/src/test/java/com/cognifide/aet/job/common/modifiers/click/ClickModifierTest.java b/core/jobs/src/test/java/com/cognifide/aet/job/common/modifiers/click/ClickModifierTest.java index fe1c07c89..38654ccb8 100644 --- a/core/jobs/src/test/java/com/cognifide/aet/job/common/modifiers/click/ClickModifierTest.java +++ b/core/jobs/src/test/java/com/cognifide/aet/job/common/modifiers/click/ClickModifierTest.java @@ -91,15 +91,7 @@ public void setParameters_whenInvalidXpathParamIsProvided_thenExceptionIsThrown( setupParams(PARAM_TIMEOUT_VALUE, "", null); tested.setParameters(params); } - - - @Test(expected = ParametersException.class) - public void setParameters_whenTooBgTimeoutParamIsProvided_thenExceptionIsThrown() - throws ParametersException { - setupParams("300000", PARAM_XPATH_VALUE, null); - tested.setParameters(params); - } - + @Test(expected = ParametersException.class) public void setParameters_whenNoParamsIsProvided_thenExceptionIsThrown() throws ParametersException {