From 658e827bc63791498d6c9ddca139f3c25326c9cc Mon Sep 17 00:00:00 2001 From: StroevaJ Date: Sun, 13 May 2018 18:25:54 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stroeva/src/test/java/FilterTests.java | 4 ++-- Stroeva/src/test/java/page/SearchPage.java | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Stroeva/src/test/java/FilterTests.java b/Stroeva/src/test/java/FilterTests.java index 77eadb7..764e9a3 100644 --- a/Stroeva/src/test/java/FilterTests.java +++ b/Stroeva/src/test/java/FilterTests.java @@ -31,10 +31,10 @@ public class FilterTests { context.getDriver().get(APP_URL); SerialPage page = PageFactory.initElements(context.getDriver(), SerialPage.class); page.clickSearchButton(); - page.insertSearchText("Древние"); + page.insertSearchText("Супердевушка"); page.insertEnterSearchText(); SearchPage pageAn = PageFactory.initElements(context.getDriver(), SearchPage.class); - Assertions.assertTrue(pageAn.isSearchPresent("Древние")); + Assertions.assertTrue(pageAn.isListSearchPresent("Супердевушка")); } @Test diff --git a/Stroeva/src/test/java/page/SearchPage.java b/Stroeva/src/test/java/page/SearchPage.java index 4e1535d..1345127 100644 --- a/Stroeva/src/test/java/page/SearchPage.java +++ b/Stroeva/src/test/java/page/SearchPage.java @@ -4,12 +4,17 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import java.util.List; + public class SearchPage { WebDriver driver; @FindBy(xpath = "//*[@id=\"serials\"]/div/div[2]/div[1]") private WebElement searchElement; + @FindBy(css = ".post-title") + private List listSearchElement; + public SearchPage(WebDriver driver) { this.driver = driver; } @@ -17,4 +22,14 @@ public class SearchPage { public boolean isSearchPresent(String str) { return searchElement.getText().contains(str); } + + public boolean isListSearchPresent(String str) { + boolean bl=true; + for(int i=0; i