Rukavishnikova #14

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

View File

@ -1,15 +1,15 @@
package ru.oriflame.pages; package ru.oriflame.pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement; import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class SortBy { public class SortBy {
public WebDriver driver; public WebDriver driver;
public SortBy(WebDriver driver) { public SortBy(WebDriver driver) {
PageFactory.initElements(driver, this);
this.driver = driver; this.driver = driver;
} }
@ -27,10 +27,39 @@ public class SortBy {
} }
public void sortByClick() { public void sortByClick() {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
sortingBy.click(); sortingBy.click();
} }
public void sortByPopularClick() { public void sortByPopularClick() {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
byPopular.click(); byPopular.click();
} }
public boolean assertShowMenuSort() {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return driver.findElement(By.cssSelector("#main > div:nth-child(5) > div > section > div.w-filter-bar > div > div > div.w-sort-box.fixed > ul")).isDisplayed();
}
public boolean assertcheckLinkBySort() {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return driver.findElement(By.cssSelector("#main > div:nth-child(5) > div > section > div.w-filter-bar > div > div > div.w-filtering-info.g-all > div.w-filtered-facets > span")).getText().indexOf("популярности") >= 0;
}
} }