Can someone tell me if by using the following code is sufficient enough to verify that the actions performed have taken place. So by using a wait command for certain elements to be visible in the DOM, instead of using Assert.assertEquals()
(or similar), is it valid? Or would there be a better approach?
From my understanding, asserting an action is the way to prove the actions performed have been successful. Although if I was to wait for an element to be visible, is this somewhat the same?
@Test
public void openButton(){
WebDriverWait wait = new WebDriverWait(chrome, 30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("div.menu.navButton")));
WebElement menuBtn = chrome.findElementByCssSelector("div.menu.navButton");
menuBtn.click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("div.menuPopup.t-menuPopup-A")));
WebElement openBtn = chrome.findElementByCssSelector("div.menuItem.f-feature-A.j-openProject");
openBtn.click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input.t-searchInput-A.j-treeFilter-input[placeholder='Search']")));
WebElement xBtn = chrome.findElementByCssSelector("p.closeButton");
xBtn.click();
wait.until(ExpectedConditions.invisibilityOfElementLocated(By.cssSelector("p.closeButton")));
}