Update MultiMedia.java

This commit is contained in:
Екатерина 2018-12-08 21:21:48 +00:00
parent 53546b1ae7
commit ff9d57a5c6

View File

@ -1,31 +1,27 @@
package ru.oriflame.pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class MultiMedia {
public WebDriver driver;
public MultiMedia(WebDriver driver) {
PageFactory.initElements(driver, this);
this.driver = driver;
}
@FindBy(xpath = "//*[@id=\"block-block-5\"]/p/a")
private WebElement playVideo;
@FindBy(css = "body > div.mfp-wrap.mfp-close-btn-in.mfp-auto-cursor.mfp-ready > div > div > div > button")
private WebElement closeButton;
public void playVideoElement() {
playVideo.click();
}
public void closeButton() {
closeButton.click();
public boolean assertVideoPlay() {
return driver.findElement(By.cssSelector("body > div.mfp-wrap.mfp-close-btn-in.mfp-auto-cursor.mfp-ready > div > div > div > button")).isDisplayed();
}
}