I'm trying to use asserts in selenium java. I read that for every validation, I need to use an assert as best practice.
I stumbled upon this code example:
WebElement button = wait.until(ExpectedConditions.visibilityOf(signInAndUpBtn));
Assert.assertTrue(button.isDisplayed(), "Sign In button should be visible on Home Page");
In this example, the assertion will never fail because it will fail previously on the wait. However, I want to combine the use of wait and assert, but I'm not sure what's the best way to do it.