File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33import org .openqa .selenium .By ;
44import org .openqa .selenium .WebDriver ;
5+ import org .openqa .selenium .WebElement ;
6+ import org .openqa .selenium .support .ui .ExpectedConditions ;
7+ import org .openqa .selenium .support .ui .WebDriverWait ;
58import org .testng .Assert ;
69
10+ import java .time .Duration ;
11+
712public class MainPage extends BasePage {
813
914 public MainPage (WebDriver driver , String link ) {
@@ -14,6 +19,8 @@ public MainPage(WebDriver driver, String link) {
1419 private static final By VIDEO = By .xpath ("//video" );
1520
1621 public void clickUpButtonMain () {
22+ WebDriverWait wait = new WebDriverWait (driver , Duration .ofSeconds (5 ));
23+ WebElement upButton = wait .until (ExpectedConditions .elementToBeClickable (UP_BUTTON ));
1724 driver .findElement (UP_BUTTON ).click ();
1825 String upButtonHref = driver .findElement (UP_BUTTON ).getAttribute ("href" );
1926 Assert .assertEquals (upButtonHref , "https://epolif.ru/#" , "Up button href is incorrect" );
You can’t perform that action at this time.
0 commit comments