Update SortBy.java
This commit is contained in:
parent
307e02ad68
commit
4d3f85fab9
@ -1,15 +1,15 @@
|
||||
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 SortBy {
|
||||
|
||||
public WebDriver driver;
|
||||
|
||||
public SortBy(WebDriver driver) {
|
||||
PageFactory.initElements(driver, this);
|
||||
this.driver = driver;
|
||||
}
|
||||
|
||||
@ -27,10 +27,39 @@ public class SortBy {
|
||||
}
|
||||
|
||||
public void sortByClick() {
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
sortingBy.click();
|
||||
}
|
||||
|
||||
public void sortByPopularClick() {
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user