42 lines
800 B
Java
42 lines
800 B
Java
package page;
|
|
|
|
import org.openqa.selenium.WebDriver;
|
|
import org.openqa.selenium.WebElement;
|
|
import org.openqa.selenium.support.FindBy;
|
|
|
|
public class MoviePage {
|
|
WebDriver driver;
|
|
|
|
@FindBy(css = "#actorList a")
|
|
private WebElement infoElement;
|
|
|
|
@FindBy(css = ".ya-share2__list a")
|
|
private WebElement socialElement;
|
|
|
|
public void clickInfo() {
|
|
infoElement.click();
|
|
|
|
}
|
|
|
|
public void clickSocial() {
|
|
socialElement.click();
|
|
|
|
}
|
|
|
|
public void switchToSocial(){
|
|
|
|
for (String winHandle : driver.getWindowHandles()) {
|
|
driver.switchTo().window(winHandle);
|
|
}
|
|
}
|
|
|
|
|
|
public MoviePage(WebDriver driver) {
|
|
this.driver = driver;
|
|
}
|
|
|
|
public boolean isUserPresent() {
|
|
return infoElement.isDisplayed();
|
|
}
|
|
}
|