From 19f429376e788f41dac566f6fe76a287662a0782 Mon Sep 17 00:00:00 2001 From: NatashaPirogova Date: Thu, 10 May 2018 10:00:51 +0400 Subject: [PATCH 1/2] END --- Pirogova/src/test/java/ExternalLinks.java | 45 ++++++ Pirogova/src/test/java/NavigationMenu.java | 135 ++++++++++++++++++ Pirogova/src/test/java/Search.java | 58 ++++++++ Pirogova/src/test/java/WorkWithDocument.java | 96 +++++++++++++ .../src/test/java/context/ChromeContext.java | 24 ++++ Pirogova/src/test/java/context/Context.java | 47 ++++++ .../src/test/java/context/FirefoxContext.java | 24 ++++ .../src/test/java/page/AboutCompanyPage.java | 22 +++ .../test/java/page/ActivitiesCompanyPage.java | 21 +++ Pirogova/src/test/java/page/ExternalPage.java | 21 +++ Pirogova/src/test/java/page/FAQPage.java | 15 ++ Pirogova/src/test/java/page/FooterPage.java | 20 +++ Pirogova/src/test/java/page/MainPage.java | 78 ++++++++++ .../src/test/java/page/MyFavoritesPage.java | 17 +++ Pirogova/src/test/java/page/SearchPage.java | 38 +++++ Pirogova/src/test/java/page/SubMenuPage.java | 91 ++++++++++++ 16 files changed, 752 insertions(+) create mode 100644 Pirogova/src/test/java/ExternalLinks.java create mode 100644 Pirogova/src/test/java/NavigationMenu.java create mode 100644 Pirogova/src/test/java/Search.java create mode 100644 Pirogova/src/test/java/WorkWithDocument.java create mode 100644 Pirogova/src/test/java/context/ChromeContext.java create mode 100644 Pirogova/src/test/java/context/Context.java create mode 100644 Pirogova/src/test/java/context/FirefoxContext.java create mode 100644 Pirogova/src/test/java/page/AboutCompanyPage.java create mode 100644 Pirogova/src/test/java/page/ActivitiesCompanyPage.java create mode 100644 Pirogova/src/test/java/page/ExternalPage.java create mode 100644 Pirogova/src/test/java/page/FAQPage.java create mode 100644 Pirogova/src/test/java/page/FooterPage.java create mode 100644 Pirogova/src/test/java/page/MainPage.java create mode 100644 Pirogova/src/test/java/page/MyFavoritesPage.java create mode 100644 Pirogova/src/test/java/page/SearchPage.java create mode 100644 Pirogova/src/test/java/page/SubMenuPage.java diff --git a/Pirogova/src/test/java/ExternalLinks.java b/Pirogova/src/test/java/ExternalLinks.java new file mode 100644 index 0000000..7caf6dc --- /dev/null +++ b/Pirogova/src/test/java/ExternalLinks.java @@ -0,0 +1,45 @@ +import context.ChromeContext; +import context.Context; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.openqa.selenium.Dimension; +import org.openqa.selenium.support.PageFactory; +import page.*; + +public class ExternalLinks { + private final static String APP_URL = "http://www.lukoil.ru/"; + private static Context context; + + @BeforeAll + public static void setup() { + context = new ChromeContext(); + context.start(); + context.getDriver().manage().window().setSize(new Dimension(1600, 900)); + } + + @AfterAll + public static void quit() { + context.close(); + } + @Test + public void elementFooterExternalLinksTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickFooterLinksElement(); + ExternalPage externalPage = PageFactory.initElements(context.getDriver(), ExternalPage.class); + Assertions.assertTrue(externalPage.isPageDisplayExternalFooter()); + } + @Test + public void elementSidebarExternalLinksTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickCompanySubmenu(); + SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); + Assertions.assertTrue(subPage.isPageDisplaySubmenu()); + subPage.clickSidebarExternalElement(); + ExternalPage externalPage = PageFactory.initElements(context.getDriver(), ExternalPage.class); + Assertions.assertTrue(externalPage.isPageDisplayExternalSidebar()); + } +} diff --git a/Pirogova/src/test/java/NavigationMenu.java b/Pirogova/src/test/java/NavigationMenu.java new file mode 100644 index 0000000..96dbaea --- /dev/null +++ b/Pirogova/src/test/java/NavigationMenu.java @@ -0,0 +1,135 @@ +import context.ChromeContext; +import context.Context; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.openqa.selenium.Dimension; +import org.openqa.selenium.support.PageFactory; +import page.*; + +public class NavigationMenu { + private final static String APP_URL = "http://www.lukoil.ru/"; + private static Context context; + + @BeforeAll + public static void setup() { + context = new ChromeContext(); + context.start(); + context.getDriver().manage().window().setSize(new Dimension(1600, 900)); + } + + @AfterAll + public static void quit() { + context.close(); + } + @Test + public void logotypeNavigationTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickCompanySubmenu(); + SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); + Assertions.assertTrue(subPage.isPageDisplaySubmenu()); + subPage.clickLogoElement(); + Assertions.assertTrue(page.isPageDisplayMain()); + } + @Test + public void menuMainNavigationTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickCompanyMenu(); + Assertions.assertTrue(page.isPageDisplayMenu()); + } + @Test + public void submenuMainNavigationTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickCompanySubmenu(); + SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); + Assertions.assertTrue(subPage.isPageDisplaySubmenu()); + + } + @Test + public void elementFooterNavigationTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickFooterElement(); + FooterPage footerPage = PageFactory.initElements(context.getDriver(), FooterPage.class); + Assertions.assertTrue(footerPage.isPageDisplayFooter()); + } + @Test + public void elementAdditionalInfoNavigationTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickCompanyMenu(); + Assertions.assertTrue(page.isPageDisplayMenu()); + page.clickAdditionalInfoMenu(); + AboutCompanyPage aboutPage = PageFactory.initElements(context.getDriver(), AboutCompanyPage.class); + Assertions.assertTrue(aboutPage.isPageDisplayAboutCompany()); + + } + @Test + public void elementNextPreviousNavigationTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickCompanyMenu(); + Assertions.assertTrue(page.isPageDisplayMenu()); + page.clickAdditionalInfoMenu(); + AboutCompanyPage aboutPage = PageFactory.initElements(context.getDriver(), AboutCompanyPage.class); + Assertions.assertTrue(aboutPage.isPageDisplayAboutCompany()); + aboutPage.clickNextElement(); + ActivitiesCompanyPage activitiesCompanyPage = PageFactory.initElements(context.getDriver(), ActivitiesCompanyPage.class); + Assertions.assertTrue(activitiesCompanyPage.isPageDisplayActivitiesCompany()); + activitiesCompanyPage.clickPreviousElement(); + Assertions.assertTrue(aboutPage.isPageDisplayAboutCompany()); + } + @Test + public void elementPlusNavigationTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickCompanySubmenu(); + SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); + Assertions.assertTrue(subPage.isPageDisplaySubmenu()); + subPage.clickPlus(); + Assertions.assertTrue(subPage.isPageDisplayPlus()); + SubMenuPage sub = PageFactory.initElements(context.getDriver(), SubMenuPage.class); + sub.clickPlus(); + Assertions.assertTrue(sub.isPageDisplayMinus()); + } + @Test + public void elementMinusNavigationTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickCompanySubmenu(); + SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); + Assertions.assertTrue(subPage.isPageDisplaySubmenu()); + subPage.clickPlus(); + Assertions.assertTrue(subPage.isPageDisplayPlus()); + SubMenuPage sub = PageFactory.initElements(context.getDriver(), SubMenuPage.class); + sub.clickPlus(); + Assertions.assertTrue(sub.isPageDisplayMinus()); + subPage.clickPlus(); + Assertions.assertTrue(subPage.isPageDisplayMinus()); + } + @Test + public void elementBreadcrumbsNavigationTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickCompanySubmenu(); + SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); + Assertions.assertTrue(subPage.isPageDisplaySubmenu()); + subPage.clickBreadcrumbsElement(); + Assertions.assertTrue(page.isPageDisplayMenu()); + } + @Test + public void elementSidebarHyperlinkNavigationTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickCompanySubmenu(); + SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); + Assertions.assertTrue(subPage.isPageDisplaySubmenu()); + subPage.clickHyperlink(); + FAQPage faqPage = PageFactory.initElements(context.getDriver(), FAQPage.class); + Assertions.assertTrue(faqPage.isPageDisplayFAQ()); + } +} diff --git a/Pirogova/src/test/java/Search.java b/Pirogova/src/test/java/Search.java new file mode 100644 index 0000000..f7c078b --- /dev/null +++ b/Pirogova/src/test/java/Search.java @@ -0,0 +1,58 @@ +import context.ChromeContext; +import context.Context; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.openqa.selenium.Dimension; +import org.openqa.selenium.support.PageFactory; +import page.MainPage; +import page.SearchPage; + +public class Search { + private final static String APP_URL = "http://www.lukoil.ru/"; + private static Context context; + + @BeforeAll + public static void setup() { + context = new ChromeContext(); + context.start(); + context.getDriver().manage().window().setSize(new Dimension(1600, 900)); + } + + @AfterAll + public static void quit() { + context.close(); + } + @Test + public void searchHeaderTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.insertSearchHeaderText("Проекты"); + page.submitSearchHeader(); + SearchPage searchPage = PageFactory.initElements(context.getDriver(), SearchPage.class); + Assertions.assertTrue(searchPage.checkSearch()); + } + @Test + public void searchHeaderTestWithFilter() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.insertSearchHeaderText("Проекты"); + page.submitSearchHeader(); + SearchPage searchPage = PageFactory.initElements(context.getDriver(), SearchPage.class); + Assertions.assertTrue(searchPage.checkSearch()); + searchPage.clickSearchFilterElement(); + Assertions.assertTrue(searchPage.checkSearch()); + } + @Test + public void searchHeaderTestWithSorting() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.insertSearchHeaderText("Проекты"); + page.submitSearchHeader(); + SearchPage searchPage = PageFactory.initElements(context.getDriver(), SearchPage.class); + Assertions.assertTrue(searchPage.checkSearch()); + searchPage.clickSearchSortingElement(); + Assertions.assertTrue(searchPage.checkSearch()); + } +} diff --git a/Pirogova/src/test/java/WorkWithDocument.java b/Pirogova/src/test/java/WorkWithDocument.java new file mode 100644 index 0000000..1eddc78 --- /dev/null +++ b/Pirogova/src/test/java/WorkWithDocument.java @@ -0,0 +1,96 @@ +import context.ChromeContext; +import context.Context; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.openqa.selenium.Dimension; +import org.openqa.selenium.support.PageFactory; +import page.MainPage; +import page.MyFavoritesPage; +import page.SubMenuPage; +import java.io.File; + +public class WorkWithDocument { + private final static String APP_URL = "http://www.lukoil.ru/"; + private static Context context; + private static String tmpPath; + @BeforeAll + public static void setup() { + context = new ChromeContext(); + context.start(); + context.getDriver().manage().window().setSize(new Dimension(1600, 900)); + tmpPath = context.getTmpPath(); + } + + @AfterAll + public static void quit() { + context.close(); + } + @Test + public void addToFavoritesTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickCompanyMenu(); + Assertions.assertTrue(page.isPageDisplayMenu()); + page.clickAddToFavoritesElement(); + Assertions.assertTrue(page.isMessageDisplay()); + } + @Test + public void myFavoritesTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickCompanySubmenu(); + SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); + Assertions.assertTrue(subPage.isPageDisplaySubmenu()); + subPage.clickMyFavoritesElement(); + MyFavoritesPage myFavoritesPage = PageFactory.initElements(context.getDriver(), MyFavoritesPage.class); + Assertions.assertTrue(myFavoritesPage.isPageDisplayMyFavorites()); + } + @Test + public void addToFavoritesDocumentTest() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickDocumentSubmenu(); + SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); + Assertions.assertTrue(subPage.isPageDisplayDocuments()); + subPage.clickAddDocumentToFavoritesElement(); + Assertions.assertTrue(subPage.isMessageDisplay()); + } + @Test + public void testOpenDocumentChrome() { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickDocumentSubmenu(); + SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); + Assertions.assertTrue(subPage.isPageDisplayDocuments()); + subPage.clickOpenDocumentElement(); + String fileName = subPage.getFileName(); + Assertions.assertTrue(subPage.checkOpen(fileName)); + } + @Test + public void testDownloandDocument() throws InterruptedException { + context.getDriver().get(APP_URL); + MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); + page.clickDocumentSubmenu(); + SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); + Assertions.assertTrue(subPage.isPageDisplayDocuments()); + subPage.clickDownloandDocumentElement(); + String fileName = subPage.getFileName(); + checkDownload(fileName,100,100); + } + private void checkDownload(String fileName,int timeout, int period) throws InterruptedException { + File f = new File(tmpPath +fileName); + int time=0; + while(!f.exists()&&time listResultSearch; + @FindBy(xpath = "//*[@id=\"topSearchForm\"]/input[1]") + private WebElement searchHeaderElement; + @FindBy(xpath = "//*[@id=\"main\"]/div/div[3]/div[1]/div/div/div/div/div[4]/button[2]") + private WebElement searchFilterElement; + @FindBy(xpath = "//*[@id=\"main\"]/div/div[3]/div[1]/div/div/div/div/div[5]/a[2]") + private WebElement searchSortingElement; + public SearchPage(WebDriver driver) { + this.driver = driver; + } + public void clickSearchFilterElement() { + searchFilterElement.click(); + } + public void clickSearchSortingElement() { + searchSortingElement.click(); + } + public boolean checkSearch() { + boolean checkSearch = false; + int count = listResultSearch.size(); + String strSearch = searchHeaderElement.getAttribute("value"); + for (int i = 0; i < count - 1; i++) { + if (listResultSearch.get(i).getText().contains(strSearch)) + checkSearch = true; + } + return true; + } + +} diff --git a/Pirogova/src/test/java/page/SubMenuPage.java b/Pirogova/src/test/java/page/SubMenuPage.java new file mode 100644 index 0000000..fca4b1a --- /dev/null +++ b/Pirogova/src/test/java/page/SubMenuPage.java @@ -0,0 +1,91 @@ +package page; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; +import java.io.File; + +public class SubMenuPage { + WebDriver driver; + @FindBy(xpath = "//*[@id=\"main\"]/div/div[3]/div[1]/div/div/div/div[3]/div[1]/a") + private WebElement plusElement; + @FindBy(xpath = "//*[@id=\"main\"]/div/div[3]/div[2]/div[1]/ul/li[2]/a/span") + private WebElement hyperlinkElement; + @FindBy(xpath = "//*[@id=\"header\"]/div[2]/div/div/div[1]/div/a") + private WebElement logotypeElement; + @FindBy(xpath = "//*[@id=\"main\"]/div/div[2]/div[1]/ol/li[2]/a") + private WebElement breadcrumbsElement; + @FindBy(xpath = "//*[@id=\"main\"]/div/div[3]/div[2]/div[2]/ul/li[2]/a/span") + private WebElement sidebarElementExternalLinks; + @FindBy(xpath = "//*[@id=\"main\"]/div/div[3]/div[2]/div[3]/ul/li[2]/a/span") + private WebElement myFavoritesElement; + @FindBy(xpath = "//*[@id=\"collapsable-div-9ecd7f1d-3608-4b3f-a869-dff93a057a2a\"]/ul/li[1]/div/a[1]") + private WebElement addDocumentToFavoritesElement; + @FindBy(xpath = "//*[@id=\"collapsable-div-9ecd7f1d-3608-4b3f-a869-dff93a057a2a\"]/ul/li[1]/div/a[3]") + private WebElement openDocumentElement; + @FindBy(xpath = "//*[@id=\"collapsable-div-9ecd7f1d-3608-4b3f-a869-dff93a057a2a\"]/ul/li[1]/div/a[2]") + private WebElement downloandDocumentElement; + public boolean isMessageDisplay() { + return driver.findElement(By.xpath("//*[@id=\"home\"]/div[8]/div/div/div/div/div/div[1]")).isDisplayed(); + } + public void clickBreadcrumbsElement() { + breadcrumbsElement.click(); + } + public void clickSidebarExternalElement() { + sidebarElementExternalLinks.click(); + } + public void clickMyFavoritesElement() { + myFavoritesElement.click(); + } + public void clickAddDocumentToFavoritesElement() { + addDocumentToFavoritesElement.click(); + } + public void clickOpenDocumentElement() { + openDocumentElement.click(); + } + public void clickDownloandDocumentElement() { + downloandDocumentElement.click(); + } + public void clickPlus() { + plusElement.click(); + } + public void clickHyperlink() { + hyperlinkElement.click(); + } + public void clickLogoElement() { + logotypeElement.click(); + } + public SubMenuPage(WebDriver driver) { + this.driver = driver; + } + public boolean isPageDisplaySubmenu() { + return driver.findElement(By.className("panel-heading")).isDisplayed(); + } + public boolean isPageDisplayPlus() { + return driver.findElement(By.cssSelector(".collapse.in")).isDisplayed(); + } + public boolean isPageDisplayMinus() { + return driver.findElement(By.cssSelector("div[aria-expanded='false']")).isDisplayed(); + } + public boolean isPageDisplayDocuments() { + return driver.findElement(By.xpath("//div[@class=\"page-title\"]/h1[@title=\"Внутренние документы\"]")).isDisplayed(); + } + public String getFileName() { + String fileName = openDocumentElement.getAttribute("href"); + fileName = fileName.substring(fileName.lastIndexOf("/") + 1); + return fileName; + } + + public boolean checkOpen(String str) { + boolean check = false; + File f = new File(str); + String s = driver.getCurrentUrl(); + if (s.contains(str)) + check = true; + return check; + } + + + +} \ No newline at end of file -- 2.34.1 From e10dbb0c75c3e2bcfc6f6fbcb6cb8bc9a1f0d766 Mon Sep 17 00:00:00 2001 From: NatashaPirogova Date: Fri, 11 May 2018 20:03:02 +0400 Subject: [PATCH 2/2] END --- Pirogova/src/test/java/ExternalLinks.java | 1 - Pirogova/src/test/java/NavigationMenu.java | 12 ------------ Pirogova/src/test/java/Search.java | 2 -- Pirogova/src/test/java/WorkWithDocument.java | 4 ---- 4 files changed, 19 deletions(-) diff --git a/Pirogova/src/test/java/ExternalLinks.java b/Pirogova/src/test/java/ExternalLinks.java index 7caf6dc..233ae95 100644 --- a/Pirogova/src/test/java/ExternalLinks.java +++ b/Pirogova/src/test/java/ExternalLinks.java @@ -37,7 +37,6 @@ public class ExternalLinks { MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickCompanySubmenu(); SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); - Assertions.assertTrue(subPage.isPageDisplaySubmenu()); subPage.clickSidebarExternalElement(); ExternalPage externalPage = PageFactory.initElements(context.getDriver(), ExternalPage.class); Assertions.assertTrue(externalPage.isPageDisplayExternalSidebar()); diff --git a/Pirogova/src/test/java/NavigationMenu.java b/Pirogova/src/test/java/NavigationMenu.java index 96dbaea..cc37420 100644 --- a/Pirogova/src/test/java/NavigationMenu.java +++ b/Pirogova/src/test/java/NavigationMenu.java @@ -29,7 +29,6 @@ public class NavigationMenu { MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickCompanySubmenu(); SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); - Assertions.assertTrue(subPage.isPageDisplaySubmenu()); subPage.clickLogoElement(); Assertions.assertTrue(page.isPageDisplayMain()); } @@ -62,7 +61,6 @@ public class NavigationMenu { context.getDriver().get(APP_URL); MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickCompanyMenu(); - Assertions.assertTrue(page.isPageDisplayMenu()); page.clickAdditionalInfoMenu(); AboutCompanyPage aboutPage = PageFactory.initElements(context.getDriver(), AboutCompanyPage.class); Assertions.assertTrue(aboutPage.isPageDisplayAboutCompany()); @@ -73,13 +71,10 @@ public class NavigationMenu { context.getDriver().get(APP_URL); MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickCompanyMenu(); - Assertions.assertTrue(page.isPageDisplayMenu()); page.clickAdditionalInfoMenu(); AboutCompanyPage aboutPage = PageFactory.initElements(context.getDriver(), AboutCompanyPage.class); - Assertions.assertTrue(aboutPage.isPageDisplayAboutCompany()); aboutPage.clickNextElement(); ActivitiesCompanyPage activitiesCompanyPage = PageFactory.initElements(context.getDriver(), ActivitiesCompanyPage.class); - Assertions.assertTrue(activitiesCompanyPage.isPageDisplayActivitiesCompany()); activitiesCompanyPage.clickPreviousElement(); Assertions.assertTrue(aboutPage.isPageDisplayAboutCompany()); } @@ -89,9 +84,7 @@ public class NavigationMenu { MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickCompanySubmenu(); SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); - Assertions.assertTrue(subPage.isPageDisplaySubmenu()); subPage.clickPlus(); - Assertions.assertTrue(subPage.isPageDisplayPlus()); SubMenuPage sub = PageFactory.initElements(context.getDriver(), SubMenuPage.class); sub.clickPlus(); Assertions.assertTrue(sub.isPageDisplayMinus()); @@ -102,12 +95,9 @@ public class NavigationMenu { MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickCompanySubmenu(); SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); - Assertions.assertTrue(subPage.isPageDisplaySubmenu()); subPage.clickPlus(); - Assertions.assertTrue(subPage.isPageDisplayPlus()); SubMenuPage sub = PageFactory.initElements(context.getDriver(), SubMenuPage.class); sub.clickPlus(); - Assertions.assertTrue(sub.isPageDisplayMinus()); subPage.clickPlus(); Assertions.assertTrue(subPage.isPageDisplayMinus()); } @@ -117,7 +107,6 @@ public class NavigationMenu { MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickCompanySubmenu(); SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); - Assertions.assertTrue(subPage.isPageDisplaySubmenu()); subPage.clickBreadcrumbsElement(); Assertions.assertTrue(page.isPageDisplayMenu()); } @@ -127,7 +116,6 @@ public class NavigationMenu { MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickCompanySubmenu(); SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); - Assertions.assertTrue(subPage.isPageDisplaySubmenu()); subPage.clickHyperlink(); FAQPage faqPage = PageFactory.initElements(context.getDriver(), FAQPage.class); Assertions.assertTrue(faqPage.isPageDisplayFAQ()); diff --git a/Pirogova/src/test/java/Search.java b/Pirogova/src/test/java/Search.java index f7c078b..40dd454 100644 --- a/Pirogova/src/test/java/Search.java +++ b/Pirogova/src/test/java/Search.java @@ -40,7 +40,6 @@ public class Search { page.insertSearchHeaderText("Проекты"); page.submitSearchHeader(); SearchPage searchPage = PageFactory.initElements(context.getDriver(), SearchPage.class); - Assertions.assertTrue(searchPage.checkSearch()); searchPage.clickSearchFilterElement(); Assertions.assertTrue(searchPage.checkSearch()); } @@ -51,7 +50,6 @@ public class Search { page.insertSearchHeaderText("Проекты"); page.submitSearchHeader(); SearchPage searchPage = PageFactory.initElements(context.getDriver(), SearchPage.class); - Assertions.assertTrue(searchPage.checkSearch()); searchPage.clickSearchSortingElement(); Assertions.assertTrue(searchPage.checkSearch()); } diff --git a/Pirogova/src/test/java/WorkWithDocument.java b/Pirogova/src/test/java/WorkWithDocument.java index 1eddc78..cbe7832 100644 --- a/Pirogova/src/test/java/WorkWithDocument.java +++ b/Pirogova/src/test/java/WorkWithDocument.java @@ -32,7 +32,6 @@ public class WorkWithDocument { context.getDriver().get(APP_URL); MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickCompanyMenu(); - Assertions.assertTrue(page.isPageDisplayMenu()); page.clickAddToFavoritesElement(); Assertions.assertTrue(page.isMessageDisplay()); } @@ -42,7 +41,6 @@ public class WorkWithDocument { MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickCompanySubmenu(); SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); - Assertions.assertTrue(subPage.isPageDisplaySubmenu()); subPage.clickMyFavoritesElement(); MyFavoritesPage myFavoritesPage = PageFactory.initElements(context.getDriver(), MyFavoritesPage.class); Assertions.assertTrue(myFavoritesPage.isPageDisplayMyFavorites()); @@ -53,7 +51,6 @@ public class WorkWithDocument { MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickDocumentSubmenu(); SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); - Assertions.assertTrue(subPage.isPageDisplayDocuments()); subPage.clickAddDocumentToFavoritesElement(); Assertions.assertTrue(subPage.isMessageDisplay()); } @@ -63,7 +60,6 @@ public class WorkWithDocument { MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickDocumentSubmenu(); SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class); - Assertions.assertTrue(subPage.isPageDisplayDocuments()); subPage.clickOpenDocumentElement(); String fileName = subPage.getFileName(); Assertions.assertTrue(subPage.checkOpen(fileName)); -- 2.34.1