From 4d3f85fab9c267518173abf847ca7fee4786ecaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=BA=D0=B0=D1=82=D0=B5=D1=80=D0=B8=D0=BD=D0=B0?= Date: Sat, 8 Dec 2018 20:58:31 +0000 Subject: [PATCH] Update SortBy.java --- .../test/java/ru/oriflame/pages/SortBy.java | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Rukavishnikova/src/test/java/ru/oriflame/pages/SortBy.java b/Rukavishnikova/src/test/java/ru/oriflame/pages/SortBy.java index 2277a09..245439b 100644 --- a/Rukavishnikova/src/test/java/ru/oriflame/pages/SortBy.java +++ b/Rukavishnikova/src/test/java/ru/oriflame/pages/SortBy.java @@ -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; + + } }