tis-2017/kurnaev/src/test/java/page/AllGiveupsPage.java
2018-09-28 20:26:04 +04:00

42 lines
892 B
Java

package page;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.By;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.Select;
public class AllGiveupsPage
{
static WebDriver driver;
@FindBy(name = "status")
private WebElement statusDropdownMenu;
public AllGiveupsPage(WebDriver driver) {
this.driver = driver;
}
public void changeStatusDropdownMenuToDied() {
new Select(statusDropdownMenu).selectByIndex(4);
}
public static boolean isChangedStatusCorrectly() {
try {
return driver.findElement(By.name("status")).getText().indexOf("Мёртвые") >= 0;
}
catch (Exception e)
{
return false;
}
}
}