Skip to content

Commit

Permalink
test: Fix unstable test (#13436)
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur- committed Apr 7, 2022
1 parent 8be2b8a commit 2f0c96d
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.StaleElementReferenceException;

import com.vaadin.flow.component.button.testbench.ButtonElement;
import com.vaadin.flow.component.login.testbench.LoginFormElement;
Expand Down Expand Up @@ -394,11 +393,7 @@ protected void assertPublicEndpointReloadsPage() {
String timeBefore = getPublicView().findElement(By.id("time"))
.getText();
Assert.assertNotNull(timeBefore);
try {
getPublicView().callFunction("updateTime");
} catch (StaleElementReferenceException e) {
// Page reload causes the exception, ignore
}
executeScript("document.querySelector('public-view').updateTime()");
String timeAfter = getPublicView().findElement(By.id("time")).getText();
Assert.assertNotNull(timeAfter);
Assert.assertNotEquals(timeAfter, timeBefore);
Expand Down

0 comments on commit 2f0c96d

Please sign in to comment.