Skip to content

Commit

Permalink
Merge pull request #304 from Cognifide/bugfix/timeout-based-tests-sta…
Browse files Browse the repository at this point in the history
…bilization

Timeout-based integration tests stabilization for Chrome
  • Loading branch information
tkaik authored Aug 7, 2018
2 parents dc9b2f7 + fb295a8 commit c0e606d
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ java.util.Date date = new java.util.Date();
</div>
</div>
<script>
setTimeout(function(){ document.getElementById("date-panel").style.display = 'none'; }, 3000);
setTimeout(function(){ document.getElementById("date-panel").style.display = 'none'; }, 10000);
</script>
<%@ include file="/includes/bodyContent.jsp" %>
<%@ include file="/includes/footer.jsp" %>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</div>
</div>
<script>
setTimeout(function(){ document.getElementById("test-element").style.display = ''; }, 4000);
setTimeout(function(){ document.getElementById("test-element").style.display = ''; }, 8000);
</script>

<%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</div>
</div>
<script>
setTimeout(function(){ document.getElementById("test-element").style.display = ''; }, 4000);
setTimeout(function(){ document.getElementById("test-element").style.display = ''; }, 11000);
</script>

<%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@
elementToChange.innerHTML = 'Final Text That is displayed after timeout while page elements are still loading.';
}
++COUNTER;
}, t * 600);
}, t * 1000);
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
@Modules(GuiceModule.class)
public class HomePageTilesTest {

private static final int TESTS = 113;
private static final int TESTS = 115;

private static final int EXPECTED_TESTS_SUCCESS = 66;
private static final int EXPECTED_TESTS_SUCCESS = 68;

private static final int EXPECTED_TESTS_WARN = 5;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ Feature: Tests Results Filtering
Scenario: Filtering Tests Results: layout
Given I have opened sample tests report page
When I search for tests containing "layout"
Then There are 13 tiles visible
And Statistics text contains "13 ( 3 / 0 / 10 / 0 )"
Then There are 15 tiles visible
And Statistics text contains "15 ( 4 / 0 / 11 / 0 )"

Scenario: Filtering Tests Results: jserrors
Given I have opened sample tests report page
Expand Down Expand Up @@ -98,4 +98,4 @@ Feature: Tests Results Filtering
Given I have opened sample tests report page
When I search for tests containing "wait-for-image-completion"
Then There are 4 tiles visible
And Statistics text contains "4 ( 2 / 0 / 2 / 0 )"
And Statistics text contains "4 ( 1 / 0 / 3 / 0 )"
2 changes: 1 addition & 1 deletion integration-tests/test-suite/partials/sleep-modifier.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<collect>
<open />
<resolution width="1500" />
<sleep duration="6000" />
<sleep duration="10000" />
<screen />
</collect>
<compare>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<collect>
<open />
<resolution width="1500" />
<wait-for-element-to-be-visible css="#test-element" timeout = "6000"/>
<wait-for-element-to-be-visible css="#test-element" timeout = "10000"/>
<screen />
</collect>
<compare>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<test name="S-modifier-Wait-For-Image-Completion">
<collect>
<open />
<resolution width="1500" />
<resolution width="1500" height="800"/>
<wait-for-image-completion xpath="//img[@id = 'image-to-wait-for']" timeout = "15000"/>
<screen />
</collect>
Expand All @@ -39,8 +39,8 @@
<test name="F-modifier-Wait-For-Image-Completion-not-visible">
<collect>
<open />
<resolution width="1500" />
<wait-for-image-completion css="#image-to-wait-for" timeout = "100"/>
<resolution width="1500" />
<wait-for-image-completion css="#image-to-wait-for" timeout="100"/>
<screen />
</collect>
<compare>
Expand All @@ -54,7 +54,7 @@
<test name="S-modifier-Wait-For-Image-Completion-slow-image">
<collect>
<open />
<resolution width="1500" />
<resolution width="1500" />
<!-- image is served with additional latency -->
<wait-for-image-completion css="#image-to-wait-for" timeout = "7000"/>
<screen />
Expand All @@ -67,11 +67,12 @@
</urls>
</test>

<test name="F-modifier-Wait-For-Image-Completion-slow-image">
<!-- Should pass because Chrome waits for images in the <open> phase -->
<test name="S-modifier-Wait-For-Image-Completion-slow-image-short-timeout">
<collect>
<open />
<!-- image is served with additional latency -->
<wait-for-image-completion xpath="//img[@id = 'image-to-wait-for']" timeout = "3000"/>
<wait-for-image-completion xpath="//img[@id = 'image-to-wait-for']" timeout = "1"/>
<screen />
</collect>
<compare>
Expand Down

0 comments on commit c0e606d

Please sign in to comment.