Skip to content

Commit 5053090

Browse files
Changes for webapp as well
1 parent e91cdc7 commit 5053090

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

java/spring/webappWithTests/Application/sampleWebApp.FunctionalTests/src/main/java/functional_tests/SampleFunctionalTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ public void testAssertTitleWithSelenium() throws InterruptedException, Assertion
3232
System.out.println(isAlertPresent());
3333
driver.switchTo().alert().accept();
3434
}
35-
int numRetries = 5;
36-
for (int i = 0; i < numRetries; i++)
35+
36+
37+
long currentTimestamp = (new Date()).getTime();
38+
long endTimestamp = currentTimestamp + 60*10*1000;
39+
40+
while(currentTimestamp <= endTimestamp + 10000)
3741
{
3842
try
3943
{
@@ -43,11 +47,10 @@ public void testAssertTitleWithSelenium() throws InterruptedException, Assertion
4347
}
4448
catch(AssertionError e)
4549
{
46-
if(i == (numRetries - 1))
50+
if(currentTimestamp > endTimestamp) {
4751
{
4852
throw e;
4953
}
50-
Thread.sleep(5000);
5154
}
5255
}
5356
}

0 commit comments

Comments
 (0)