Skip to content

Commit

Permalink
[java] There is no need to wait and assert on the same condition
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Nov 26, 2018
1 parent 4ef74d2 commit 6228b25
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ public void testShouldIssueClickEvents() {
driver.findElement(By.id("mouseclick")).click();

WebElement result = driver.findElement(By.id("result"));
wait.until(elementTextToEqual(result, "mouse click"));
assertThat(result.getText()).isEqualTo("mouse click");
wait.until($ -> result.getText().equals("mouse click"));
}

@Test
Expand All @@ -193,8 +192,7 @@ public void testShouldIssueMouseUpEvents() {
driver.findElement(By.id("mouseup")).click();

WebElement result = driver.findElement(By.id("result"));
wait.until(elementTextToEqual(result, "mouse up"));
assertThat(result.getText()).isEqualTo("mouse up");
wait.until($ -> result.getText().equals("mouse up"));
}

@Test
Expand All @@ -204,8 +202,7 @@ public void testMouseEventsShouldBubbleUpToContainingElements() {
driver.findElement(By.id("child")).click();

WebElement result = driver.findElement(By.id("result"));
wait.until(elementTextToEqual(result, "mouse down"));
assertThat(result.getText()).isEqualTo("mouse down");
wait.until($ -> result.getText().equals("mouse down"));
}

@Test
Expand Down

0 comments on commit 6228b25

Please sign in to comment.