Rukavishnikova #14

Closed
kotenok-339 wants to merge 17 commits from Rukavishnikova into master
Showing only changes of commit 119520f2aa - Show all commits

View File

@ -1,21 +1,23 @@
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 MainPage {
public WebDriver driver;
public static WebDriver driver;
public MainPage(WebDriver driver) {
PageFactory.initElements(driver, this);
this.driver = driver;
}
@FindBy(xpath = "//*[@id=\"primary-navigation\"]/ul/li[2]/a")
private WebElement face;
@FindBy(css = "body > header > div > div.ui-header-bar > nav > div > div.ui-logo > a > span > svg")
private WebElement main;
@FindBy(css = "body > header > div > div.ui-sticky-bar.js-sticky-bar > div.w-sticky-bar-list.clearfix > ul > li:nth-child(3) > a")
private WebElement registr;
@ -25,22 +27,40 @@ public class MainPage {
@FindBy(css = "#hero-promo-slider > div.rsOverflow > div > div.rsSlide.rsActiveSlide > div > article > a > div.image-A1 > img")
private WebElement banner;
@FindBy(css = "#main > div > div:nth-child(2) > div > div > div > section.tab.ui-product-list.g-all.active > a:nth-child(1) > div.figure > img")
@FindBy(css = "#main > div:nth-child(5) > div > section > section > a:nth-child(1) > div.figure > img")
private WebElement product;
public void faceClick() {
face.click();
}
public void faceClick() { face.click(); }
public void registrClick() {
registr.click();
}
public void mainClick() { main.click(); }
public void registrClick() { registr.click(); }
public void podvalClick() {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
podval.click();
}
public void bannerClick() { banner.click(); }
public void productClick() { product.click(); }
public static boolean assertHeightMenu() { return driver.findElement(By.cssSelector("#main > div.w-top-area-banner.category-skincare.with-background.with-img > div.ui-banner-image > img")).isDisplayed(); }
public static boolean assertBanner() { return driver.findElement(By.cssSelector("#facets-search-results > section")).isDisplayed(); }
public static boolean assertProduct() { return driver.findElement(By.cssSelector("#pdp-image-slider > div.rsOverflow > div > div:nth-child(1) > div > img")).isDisplayed(); }
public static boolean assertRegister() { return driver.findElement(By.cssSelector("#main > div.w-content > div > div > p")).isDisplayed(); }
public static boolean assertDown() {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}return driver.findElement(By.cssSelector("#main > div > div > div")).isDisplayed(); }
}