Update FilterByTest.java

This commit is contained in:
Almira 2018-12-13 13:38:10 +00:00
parent 9eb0b72a3a
commit 14862c7ce3

View File

@ -24,13 +24,13 @@ public class FilterByTest {
context.close();
}
@Test
@Test
public void selectTypeOfSport() {
context.getDriver().get(APP_URL);
FilterBy filterBy = PageFactory.initElements(context.getDriver(), FilterBy.class);
filterBy.typeOfSportClick();
filterBy.footballClick();
filterBy.AssertSelectTypeOfSport();
Assert.assertTrue(filterBy.AssertSelectTypeOfSport());
}
@Test
@ -42,7 +42,7 @@ public class FilterByTest {
filterBy.typeOfSportClick();
filterBy.tourneerClick();
filterBy.leagueOfNationClick();
filterBy.AssertTourneer();
Assert.assertTrue(filterBy.AssertTourneer());
}
@Test
@ -57,9 +57,9 @@ public class FilterByTest {
filterBy.tourneerClick();
filterBy.comandClick();
filterBy.AustriaClick();
filterBy.AssertComand();
Assert.assertTrue(filterBy.AssertComand());
}
@Test
@Test
public void useFilterForNewsOfMyComand() {
context.getDriver().get(APP_URL);
FilterBy filterBy = PageFactory.initElements(context.getDriver(), FilterBy.class);
@ -73,10 +73,7 @@ public class FilterByTest {
filterBy.AustriaClick();
filterBy.comandClick();
filterBy.saveParametersClick();
WebElement News = context.getDriver().findElement(By.cssSelector("#branding-layout > div.page-layout > div > div > div > div " +
"> aside > section:nth-child(3) > div > div > ul > li > a"));
String NewsText = News.getText();
Assert.assertEquals("Жеребьевка Евро-2020. Россия сыграет с Бельгией, Шотландией, Кипром, Казахстаном и Сан-Марино", NewsText);
Assert.assertTrue(filterBy.AssertUseFilterForNewsOfMyComand());
}
@ -86,11 +83,7 @@ public class FilterByTest {
FilterBy filterBy = PageFactory.initElements(context.getDriver(), FilterBy.class);
filterBy.selectTypeOfSportClick();
filterBy.BaseballClick();
WebElement News = context.getDriver().findElement(By.cssSelector("#branding-layout > div.page-layout > div > div > div > div > aside > section:nth-child(16) > div > div.users-news__tabs.tabs_state_horizontal.tabs.tabs_animate.tabs_animate_horizontal-slide > div.tabs__body >" +
" div.users-news__tabs-panel.users-news__top-panel.tabs__panel.tabs__panel_active " +
"> ul:nth-child(2) > li > a"));
String NewsText = News.getText();
Assert.assertEquals("МЛБ. Определились все участники плей-офф", NewsText);
Assert.assertTrue(filterBy.AssertUseFilterForNewsFromUsers());
}
@ -100,10 +93,7 @@ public class FilterByTest {
FilterBy filterBy = PageFactory.initElements(context.getDriver(), FilterBy.class);
filterBy.selectTypeClick();
filterBy.TurkeyClick();
WebElement NameOfTeam = context.getDriver().findElement(By.cssSelector("#branding-layout > div.page-layout > div > div > aside > section:nth-child(6) > div > div.gadget__tournament-data > div > div:nth-child(1) > " +
"div.accordion__body > table > tbody > tr:nth-child(2) > td:nth-child(2) > a"));
String NameOfTeamText = NameOfTeam.getText();
Assert.assertEquals("Истанбул", NameOfTeamText);
Assert.assertTrue(filterBy.AssertUseFilterForStatistics());
}