diff --git a/Kravchenko/pom.xml b/Kravchenko/pom.xml
new file mode 100644
index 0000000..463c8ac
--- /dev/null
+++ b/Kravchenko/pom.xml
@@ -0,0 +1,49 @@
+
+
+ 4.0.0
+ tis-2017
+ tis-2017
+ 1.0
+
+ UTF-8
+ 1.8
+ 1.8
+
+
+
+
+ org.seleniumhq.selenium
+ selenium-java
+ 3.6.0
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ 5.1.0-RC1
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 2.4
+
+
+ true
+
+ true
+ lib/
+ ru.ulstu.tis.Main
+
+
+ lib/
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Kravchenko/src/main/java/ru/ulstu/tis/Main.java b/Kravchenko/src/main/java/ru/ulstu/tis/Main.java
new file mode 100644
index 0000000..60b5db8
--- /dev/null
+++ b/Kravchenko/src/main/java/ru/ulstu/tis/Main.java
@@ -0,0 +1,7 @@
+package ru.ulstu.tis;
+
+public class Main {
+
+ public static void main(String[] args) {
+ }
+}
diff --git a/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (1).pdf b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (1).pdf
new file mode 100644
index 0000000..6769719
Binary files /dev/null and b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (1).pdf differ
diff --git a/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (1).pdf (1).crdownload b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (1).pdf (1).crdownload
new file mode 100644
index 0000000..7f5f8d3
Binary files /dev/null and b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (1).pdf (1).crdownload differ
diff --git a/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (1).pdf.crdownload b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (1).pdf.crdownload
new file mode 100644
index 0000000..617a0db
Binary files /dev/null and b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (1).pdf.crdownload differ
diff --git a/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (2).pdf b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (2).pdf
new file mode 100644
index 0000000..6769719
Binary files /dev/null and b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (2).pdf differ
diff --git a/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (3).pdf b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (3).pdf
new file mode 100644
index 0000000..6769719
Binary files /dev/null and b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (3).pdf differ
diff --git a/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (4).pdf b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (4).pdf
new file mode 100644
index 0000000..6769719
Binary files /dev/null and b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer (4).pdf differ
diff --git a/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer.pdf b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer.pdf
new file mode 100644
index 0000000..6769719
Binary files /dev/null and b/Kravchenko/src/main/resources/downloads/Настройка_браузера_Internet_Explorer.pdf differ
diff --git a/Kravchenko/src/main/resources/drivers/chromedriver b/Kravchenko/src/main/resources/drivers/chromedriver
new file mode 100644
index 0000000..02ff671
Binary files /dev/null and b/Kravchenko/src/main/resources/drivers/chromedriver differ
diff --git a/Kravchenko/src/main/resources/drivers/chromedriver.exe b/Kravchenko/src/main/resources/drivers/chromedriver.exe
new file mode 100644
index 0000000..28a4067
Binary files /dev/null and b/Kravchenko/src/main/resources/drivers/chromedriver.exe differ
diff --git a/Kravchenko/src/main/resources/drivers/geckodriver b/Kravchenko/src/main/resources/drivers/geckodriver
new file mode 100644
index 0000000..ba1da8c
Binary files /dev/null and b/Kravchenko/src/main/resources/drivers/geckodriver differ
diff --git a/Kravchenko/src/main/resources/drivers/geckodriver.exe b/Kravchenko/src/main/resources/drivers/geckodriver.exe
new file mode 100644
index 0000000..6208aa8
Binary files /dev/null and b/Kravchenko/src/main/resources/drivers/geckodriver.exe differ
diff --git a/Kravchenko/src/test/java/ExternalLinks.java b/Kravchenko/src/test/java/ExternalLinks.java
new file mode 100644
index 0000000..c9ac217
--- /dev/null
+++ b/Kravchenko/src/test/java/ExternalLinks.java
@@ -0,0 +1,73 @@
+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.sberbank-ast.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 OpenMapTest()
+ {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickMap();
+ ExternalPage externalPage = PageFactory.initElements(context.getDriver(), ExternalPage.class);
+ Assertions.assertTrue(externalPage.isPageDisplayExternalMap());
+ }
+
+ @Test
+ public void OpenSberkeyTest()
+ {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickSberkey();
+ ExternalPage externalPage = PageFactory.initElements(context.getDriver(), ExternalPage.class);
+ Assertions.assertTrue(externalPage.isPageDisplaySberkey());
+ }
+
+ @Test
+ public void ShareInFacebookTest()
+ {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickAboutUsElement();
+ AboutCompanyPage aboutPage = PageFactory.initElements(context.getDriver(), AboutCompanyPage.class);
+ aboutPage.clickShareElement();
+ aboutPage.isPageDisplaySubmitButton();
+ Assertions.assertTrue(aboutPage.isPageDisplaySubmitButton());
+
+
+
+ }
+
+ @Test
+ public void CommericalTendersTest()
+ {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickCommercialPurchases();
+ ExternalPage externalPage = PageFactory.initElements(context.getDriver(), ExternalPage.class);
+ Assertions.assertTrue(externalPage.isPageDisplayCommercial());
+
+ }
+
+
+}
diff --git a/Kravchenko/src/test/java/NavigationMenu.java b/Kravchenko/src/test/java/NavigationMenu.java
new file mode 100644
index 0000000..545abc9
--- /dev/null
+++ b/Kravchenko/src/test/java/NavigationMenu.java
@@ -0,0 +1,123 @@
+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.sberbank-ast.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.clickMoreInformation();
+ SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class);
+ subPage.clickLogoElement();
+ Assertions.assertTrue(page.isPageDisplayMain());
+
+ }
+ @Test
+ public void menuMainNavigationTest() {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickMenu();
+ Assertions.assertTrue(page.isPageDisplayMenu());
+ }
+ @Test
+ public void RegistrationTest() {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickRegistration();
+ SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class);
+ Assertions.assertTrue(subPage.isPageDisplayRegistration());
+
+ }
+ @Test
+ public void FeedbackTest() {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickFeedbackElement();
+ FeedbackPage feedPage = PageFactory.initElements(context.getDriver(), FeedbackPage.class);
+ Assertions.assertTrue(page.isPageDisplayFeedback());
+ }
+
+
+ @Test
+ public void ReestrTest(){
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickMoreInformation();
+ SearchPage searchPage = PageFactory.initElements(context.getDriver(), SearchPage.class);
+ searchPage.isPageDisplayReestr();
+
+ }
+
+ @Test
+ public void AccrediationTest(){
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickAccreditationElement();
+ Assertions.assertTrue(page.isPageDisplayAccreditation());
+
+ }
+
+ @Test
+ public void CheckNewsTest()
+ {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickHeadlineElement();
+ page.isPageDisplayArticle();
+
+ }
+
+ @Test
+ public void checkSearchButton()
+ {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickGreenSearchButton();
+ SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class);
+ Assertions.assertTrue(subPage.isRageDisplaySearch());
+ }
+
+ @Test
+ public void openTenderTest()
+ {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickFzElement();
+ page.isPageDisplayTender();
+
+ }
+
+ @Test
+ public void InfoQualityTest() {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickQuality();
+ AboutCompanyPage aboutPage = PageFactory.initElements(context.getDriver(), AboutCompanyPage.class);
+ Assertions.assertTrue(aboutPage.isPageDisplayQuality());
+
+ }
+
+
+
+}
diff --git a/Kravchenko/src/test/java/Search.java b/Kravchenko/src/test/java/Search.java
new file mode 100644
index 0000000..33f609f
--- /dev/null
+++ b/Kravchenko/src/test/java/Search.java
@@ -0,0 +1,80 @@
+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.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.support.PageFactory;
+import page.*;
+
+public class Search {
+ private final static String APP_URL = "http://www.sberbank-ast.ru/";
+ private static Context context;
+ String search = "Поставка";
+
+ @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(search);
+ page.submitSearchHeader();
+ SearchPage searchPage = PageFactory.initElements(context.getDriver(), SearchPage.class);
+ Assertions.assertTrue(searchPage.checkSearch(search));
+ }
+ @Test
+ public void searchHeaderTestWithFilter() throws RuntimeException{
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.insertSearchHeaderText(search);
+ page.submitSearchHeader();
+ SearchPage searchPage = PageFactory.initElements(context.getDriver(), SearchPage.class);
+ searchPage.clickSearchFilter();
+ Assertions.assertTrue(searchPage.checkSearch(search));
+ Assertions.assertTrue(searchPage.checkFilter());
+ }
+ @Test
+ public void searchHeaderTestWithSorting() {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.insertSearchHeaderText(search);
+ page.submitSearchHeader();
+ SearchPage searchPage = PageFactory.initElements(context.getDriver(), SearchPage.class);
+ searchPage.clickSearchSortingElement();
+ Assertions.assertTrue(searchPage.checkSearch(search));
+ }
+
+ @Test
+ public void searchInReestTest()
+ {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickReestrMenuElement();
+ SubMenuPage subPage = PageFactory.initElements(context.getDriver(), SubMenuPage.class);
+ subPage.insertSearchReestrText();
+ Assertions.assertTrue(subPage.isPageDisplayContractors());
+
+ }
+
+ @Test
+ public void searchSheduleTest()
+ {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickSheduleElement();
+ ShedulePage shedPage = PageFactory.initElements(context.getDriver(), ShedulePage.class);
+ shedPage.searchShedule();
+ }
+}
diff --git a/Kravchenko/src/test/java/WorkWithDocument.java b/Kravchenko/src/test/java/WorkWithDocument.java
new file mode 100644
index 0000000..f81e9cf
--- /dev/null
+++ b/Kravchenko/src/test/java/WorkWithDocument.java
@@ -0,0 +1,68 @@
+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.HelpPage;
+import page.MainPage;
+import page.SubMenuPage;
+import java.io.File;
+
+public class WorkWithDocument {
+ private final static String APP_URL = "http://www.sberbank-ast.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 testOpenDocumentChrome() {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickAnswerAndQuestionElement();
+ HelpPage helpage = PageFactory.initElements(context.getDriver(), HelpPage.class);
+ helpage.clickQuestionElement();
+
+ String fileName = helpage.getFileName();
+ helpage.clickOpenDocumentElement();
+ Assertions.assertTrue(helpage.checkOpen(fileName));
+ }
+ @Test
+ public void testDownloandDocument() throws InterruptedException {
+ context.getDriver().get(APP_URL);
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickLegMenu();
+ 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 prefs = new HashMap();
+
+ tmpPath = System.getProperty("user.dir") + "/src/main/resources/downloads/";
+
+ prefs.put("download.default_directory", tmpPath);
+ //prefs.put("plugins.always_open_pdf_externally", true);
+
+ options.setExperimentalOption("prefs",prefs);
+ driver = new ChromeDriver(options);
+ }
+
+ @Override
+ protected String getDriverExecutable(boolean isWindows) {
+ return isWindows ? WINDOWS_DRIVER : LINUX_DRIVER;
+ }
+
+ @Override
+ protected String getDriverType() {
+ return DRIVER_TYPE;
+ }
+}
diff --git a/Kravchenko/src/test/java/context/Context.java b/Kravchenko/src/test/java/context/Context.java
new file mode 100644
index 0000000..5dc8865
--- /dev/null
+++ b/Kravchenko/src/test/java/context/Context.java
@@ -0,0 +1,47 @@
+package context;
+
+import org.openqa.selenium.WebDriver;
+
+import java.util.concurrent.TimeUnit;
+
+public abstract class Context {
+ private final static String DRIVER_LOCATION = "drivers/%s";
+ protected WebDriver driver;
+ protected String tmpPath;
+
+ public WebDriver getDriver() {
+ if (driver != null) {
+ return driver;
+ }
+ throw new IllegalStateException("WebDriver is not initialized");
+ }
+
+ public void start() {
+ System.setProperty(getDriverType(), getDriverExecutablePath());
+ createDriver();
+ driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
+ }
+
+ public void close() {
+ driver.quit();
+ }
+
+ protected abstract void createDriver();
+
+ protected abstract String getDriverType();
+
+ protected abstract String getDriverExecutable(boolean windows);
+
+ private String getDriverExecutablePath() {
+ return Context.class.getClassLoader().getResource(
+ String.format(DRIVER_LOCATION, getDriverExecutable(isWindows()))).getFile();
+ }
+
+ private boolean isWindows() {
+ return System.getProperty("os.name").toLowerCase().contains("windows");
+ }
+ public String getTmpPath(){
+ return tmpPath;
+ }
+
+}
diff --git a/Kravchenko/src/test/java/context/FirefoxContext.java b/Kravchenko/src/test/java/context/FirefoxContext.java
new file mode 100644
index 0000000..1d5c163
--- /dev/null
+++ b/Kravchenko/src/test/java/context/FirefoxContext.java
@@ -0,0 +1,24 @@
+package context;
+
+import org.openqa.selenium.firefox.FirefoxDriver;
+
+public class FirefoxContext extends Context {
+ private final static String WINDOWS_DRIVER = "geckodriver.exe";
+ private final static String LINUX_DRIVER = "geckodriver";
+ private final static String DRIVER_TYPE = "webdriver.gecko.driver";
+
+ @Override
+ protected void createDriver() {
+ driver = new FirefoxDriver();
+ }
+
+ @Override
+ protected String getDriverExecutable(boolean isWindows) {
+ return isWindows ? WINDOWS_DRIVER : LINUX_DRIVER;
+ }
+
+ @Override
+ protected String getDriverType() {
+ return DRIVER_TYPE;
+ }
+}
diff --git a/Kravchenko/src/test/java/page/AboutCompanyPage.java b/Kravchenko/src/test/java/page/AboutCompanyPage.java
new file mode 100644
index 0000000..a82a29d
--- /dev/null
+++ b/Kravchenko/src/test/java/page/AboutCompanyPage.java
@@ -0,0 +1,47 @@
+package page;
+
+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.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+
+public class AboutCompanyPage {
+ private WebDriver driver ;
+ private WebDriverWait wait;
+ public AboutCompanyPage(WebDriver driver) {
+ this.driver = driver;
+ wait = new WebDriverWait(driver,30,500);
+ }
+
+ @FindBy(xpath = "//*[@id=\"blockFacebook\"]/div/span/iframe")
+ private WebElement shareFrame;
+
+ @FindBy(css = "#u_0_3 > button")
+ private WebElement shareButton;
+
+ public void clickShareElement(){
+
+ wait.until(ExpectedConditions.visibilityOf(shareFrame));
+ driver.switchTo().frame(shareFrame);
+ shareButton.click();
+ for (String winHandle : driver.getWindowHandles()) {
+ driver.switchTo().window(winHandle);
+ }
+
+ }
+
+
+ public boolean isPageDisplayQuality() {
+ return driver.findElement(By.cssSelector("#ctl00_phWorkZone_ContentItem_lblbody")).isDisplayed();
+ }
+
+ public boolean isPageDisplaySubmitButton()
+ {
+ return driver.findElement(By.cssSelector("#u_0_0")).isDisplayed();
+ }
+
+
+}
diff --git a/Kravchenko/src/test/java/page/ExternalPage.java b/Kravchenko/src/test/java/page/ExternalPage.java
new file mode 100644
index 0000000..45cec13
--- /dev/null
+++ b/Kravchenko/src/test/java/page/ExternalPage.java
@@ -0,0 +1,25 @@
+package page;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+
+public class ExternalPage {
+ WebDriver driver;
+
+ public ExternalPage(WebDriver driver) {
+ this.driver = driver;
+
+ }
+ public boolean isPageDisplayExternalMap() {
+ return driver.findElement(By.cssSelector("#scene")).isDisplayed();
+ }
+ public boolean isPageDisplaySberkey()
+ {
+ return driver.findElement(By.cssSelector("#FPgosuslugi")).isDisplayed();
+ }
+ public boolean isPageDisplayCommercial() {
+ return driver.findElement(By.cssSelector("#header > div > div > " +
+ "div.col-xs-8.col-md-8.master_open_logo_link > div > h3 > a")).isDisplayed();
+ }
+
+}
diff --git a/Kravchenko/src/test/java/page/FeedbackPage.java b/Kravchenko/src/test/java/page/FeedbackPage.java
new file mode 100644
index 0000000..097ecd6
--- /dev/null
+++ b/Kravchenko/src/test/java/page/FeedbackPage.java
@@ -0,0 +1,15 @@
+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 FeedbackPage {
+ WebDriver driver;
+
+ public boolean isPageDisplayFeedback() {
+ return driver.findElement(By.cssSelector("#aspnetForm > div.master_open_content > div > div.response_list")).isDisplayed();
+ }
+}
diff --git a/Kravchenko/src/test/java/page/HelpPage.java b/Kravchenko/src/test/java/page/HelpPage.java
new file mode 100644
index 0000000..82a730c
--- /dev/null
+++ b/Kravchenko/src/test/java/page/HelpPage.java
@@ -0,0 +1,50 @@
+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 HelpPage {
+ WebDriver driver;
+
+ public HelpPage(WebDriver driver) {
+ this.driver = driver;
+
+ }
+
+ @FindBy(css = "#XMLContainer > a:nth-child(11)")
+ private WebElement questElement;
+
+ @FindBy(css = "#XMLContainer > div:nth-child(13) > a:nth-child(11)")
+ private WebElement openDocumentElement;
+
+ public void clickQuestionElement()
+ {
+ questElement.click();
+ }
+
+ public void clickOpenDocumentElement() {
+
+ openDocumentElement.click();
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ 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
diff --git a/Kravchenko/src/test/java/page/MainPage.java b/Kravchenko/src/test/java/page/MainPage.java
new file mode 100644
index 0000000..ab06864
--- /dev/null
+++ b/Kravchenko/src/test/java/page/MainPage.java
@@ -0,0 +1,304 @@
+package page;
+
+import org.junit.jupiter.api.Assertions;
+import org.openqa.selenium.*;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.FindBy;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+
+public class MainPage {
+ String headline = "";
+ WebDriver driver;
+ private WebDriverWait wait;
+ @FindBy(css = "#response_slider_wrap iframe")
+ private WebElement feedbackFrame;
+
+ @FindBy(css = "#aspnetForm > div.master_open_content > div > " +
+ "div.container.default_search > div > div.col-xs-3.col-md-3 > input")
+ private WebElement moreInformationElement;
+
+ @FindBy(css = "#aspnetForm > div.master_open_menu2 > div > div > div > ul > li:nth-child(1) > a")
+ private WebElement SubmenuElement;
+
+ @FindBy(css = "#aspnetForm > div.master_open_menu2 > div > div > div > ul >" +
+ " li:nth-child(1) > ul > li:nth-child(1) > a")
+ private WebElement Submenu;
+
+ @FindBy(css = "#aspnetForm > div.master_open_menu2 > div > div > div > ul >" +
+ " li:nth-child(1) > ul > li:nth-child(3) > a")
+ private WebElement SubmenuLegislationElement;
+
+ @FindBy(css = "#aspnetForm > div.master_open_menu2 > div >" +
+ "div > div > ul > li:nth-child(1) > ul > li:nth-child(5) > a")
+ private WebElement AnswerAndQuestionElement;
+
+ @FindBy(css = "#ctl00_loginctrl_registration")
+ private WebElement RegistrationElement;
+
+ @FindBy(css = "#ctl00_OnResponseView1_Image1")
+ private WebElement FeedbackElement;
+
+ @FindBy(css = "#HyperLink1")
+ private WebElement AllFeedbackElement;
+
+ @FindBy(xpath = "//*[@id=\"aspnetForm\"]/div[7]/div/div[4]/div/div/div[4]/p/a[1]")
+ private WebElement AccreditationElement;
+
+ @FindBy(css = "#aspnetForm > div.master_open_footer > " +
+ "div > div.row.master_open_footer_first > div:nth-child(3) > p > a")
+ private WebElement MapElement;
+
+ @FindBy(css = "#aspnetForm > div.master_open_logo > div > div " +
+ "> div.col-xs-4.col-md-4.master_open_logo_support > h3 > a")
+ private WebElement helpElement;
+
+ @FindBy (css = "#aspnetForm > div.master_open_menu2 > div > div > div > ul > li:nth-child(3) > a")
+ private WebElement reestMenuElement;
+ @FindBy(css = "#ctl00_UnitedMenu_UnitedPanel > nav > " +
+ "ul > li:nth-child(3) > div > ul:nth-child(1) > li:nth-child(3) > a")
+ private WebElement commercialPurchases;
+
+
+ @FindBy(css = "#aspnetForm > div.master_open_menu2 > div > " +
+ "div > div > ul > li:nth-child(3) > ul > li:nth-child(1) > a")
+ private WebElement ContractorReestrElement;
+
+ @FindBy(css = "#aspnetForm > div.master_open_menu2 > div > div > div > ul > li:nth-child(5) > a")
+ private WebElement servicesElement;
+
+ @FindBy(css = "#ctl00_UnitedMenu_UnitedPanel > nav > ul > li:nth-child(2) > span")
+ private WebElement greenMenuElement;
+
+ @FindBy(css = "#ctl00_UnitedMenu_UnitedPanel > nav > ul > li:nth-child(2) >" +
+ " div > ul:nth-child(2) > li:nth-child(4) > a")
+ private WebElement aboutUsElement;
+
+ @FindBy(css = "#aspnetForm > div.master_open_menu2 > div > div > div >" +
+ " ul > li:nth-child(5) > ul > li:nth-child(9) > a")
+ private WebElement bankGuaranteeElement;
+ @FindBy(css = "#aspnetForm > div.master_open_content > div >" +
+ " div.default_services > div:nth-child(2) > div:nth-child(1) > a")
+ private WebElement sberkeyElement;
+
+ @FindBy(css = "#ctl00_UnitedMenu_UnitedPanel > nav > ul > li:nth-child(6) > span")
+ private WebElement learningElement;
+
+ @FindBy(css = "#ctl00_UnitedMenu_UnitedPanel > nav > ul > li:nth-child(6) " +
+ "> div > ul > li:nth-child(2) > a")
+ private WebElement sheduleElement;
+
+ @FindBy(css = "#ctl00_phWorkZone_ContentsPreviewM_gvMain > div:nth-child(1) > h4 > a")
+ private WebElement articleElement;
+
+ @FindBy(css = "#ctl00_phWorkZone_ContentItem_lblHeader")
+ private WebElement headElement;
+
+ @FindBy(css = "#ctl00_UnitedMenu_UnitedPanel > nav > ul > li:nth-child(1) > a")
+ private WebElement searchGreenButton;
+
+ @FindBy(css = "#ctl00_UnitedMenu_UnitedPanel > nav > ul > li:nth-child(3) > span")
+ private WebElement purchasesElement;
+
+ @FindBy(css = "#ctl00_UnitedMenu_UnitedPanel > nav > ul > li:nth-child(3) >" +
+ " div > ul:nth-child(1) > li:nth-child(2) > a")
+ private WebElement fzElement;
+
+ @FindBy(xpath = "//*[@id=\"177\"]")
+ private WebElement testElement;
+
+ @FindBy(xpath = "//*[@id=\"127\"]")
+ private WebElement numberPurchaseElement;
+
+ @FindBy(xpath= "//td[contains(., 'leaf:purchCode')]")
+ private WebElement checkNumberElement;
+
+ @FindBy(css = "#ctl00_UnitedMenu_UnitedPanel > nav > ul > li:nth-child(2) " +
+ "> div > ul:nth-child(2) > li:nth-child(2) > a")
+ private WebElement politicElement;
+ @FindBy(css = "#txtUnitedPurchaseSearch")
+ private WebElement searchHeaderElement;
+ @FindBy(css = "//*[@id=\"navbar-submenu\"]/div[1]/div[1]/div[2]/div[1]/div[2]/ul/li[5]/a")
+ private WebElement documentsSubmenuElement;
+ public MainPage(WebDriver driver) {
+ this.driver = driver;
+ wait = new WebDriverWait(driver,30,5000);
+ }
+
+ public void clickMoreInformation() {
+ moreInformationElement.click();
+ }
+
+ public void clickMenu() {
+ Actions action = new Actions(driver);
+ action.moveToElement(SubmenuElement).perform();
+ Submenu.click();
+ //companySubmenuElement.sendKeys(Keys.ENTER);
+ }
+
+ public void clickQuality() {
+ Actions action = new Actions(driver);
+ action.moveToElement(greenMenuElement).perform();
+ politicElement.click();
+ }
+ public void clickLegMenu()
+ {
+ Actions action = new Actions(driver);
+ action.moveToElement(SubmenuElement).perform();
+ SubmenuLegislationElement.click();
+ }
+
+ public void clickAnswerAndQuestionElement()
+ {
+ Actions action = new Actions(driver);
+ action.moveToElement(SubmenuElement).perform();
+ AnswerAndQuestionElement.click();
+ }
+ public void clickHelpElement()
+ {
+ helpElement.click();
+ }
+
+ public void clickRegistration() {
+ RegistrationElement.click();
+ }
+ public void clickFeedbackElement() {
+ FeedbackElement.click();
+ wait.until(ExpectedConditions.visibilityOf(feedbackFrame));
+ driver.switchTo().frame(feedbackFrame);
+ AllFeedbackElement.click();
+
+
+ }
+
+ public void clickAccreditationElement() {
+
+ int elementPosition = AccreditationElement.getLocation().getY();
+ String js = String.format("window.scroll(0, %s)", elementPosition-200);
+ ((JavascriptExecutor)driver).executeScript(js);
+ AccreditationElement.click();
+ }
+
+ public void clickMap() {
+
+ int elementPosition = MapElement.getLocation().getY();
+ String js = String.format("window.scroll(0, %s)", elementPosition-200);
+ ((JavascriptExecutor)driver).executeScript(js);
+ MapElement.click();
+ }
+
+ public void clickSberkey()
+ {
+ int elementPosition = sberkeyElement.getLocation().getY();
+ String js = String.format("window.scroll(0, %s)", elementPosition-200);
+ ((JavascriptExecutor)driver).executeScript(js);
+ sberkeyElement.click();
+ }
+
+ public void clickReestrMenuElement()
+ {
+ Actions action = new Actions(driver);
+ action.moveToElement(reestMenuElement).perform();
+ ContractorReestrElement.click();
+
+ }
+
+
+ public void insertSearchHeaderText(String text) {
+ searchHeaderElement.sendKeys(text);
+ }
+
+
+ public void clickAboutUsElement()
+ {
+ Actions action = new Actions(driver);
+ action.moveToElement(greenMenuElement).perform();
+ aboutUsElement.click();
+ }
+
+ public void clickSheduleElement()
+ {
+ Actions action = new Actions(driver);
+ action.moveToElement(learningElement).perform();
+ sheduleElement.click();
+ }
+
+ public void clickHeadlineElement()
+ {
+ int elementPosition = articleElement.getLocation().getY();
+ String js = String.format("window.scroll(0, %s)", elementPosition-200);
+ ((JavascriptExecutor)driver).executeScript(js);
+ try {
+ Thread.sleep(5000);
+
+ headline = articleElement.getText();
+ articleElement.click();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ public String clickFzElement()
+ {
+ Actions action = new Actions(driver);
+ action.moveToElement(purchasesElement).perform();
+ fzElement.click();
+ int elementPosition = testElement.getLocation().getY();
+ String js = String.format("window.scroll(0, %s)", elementPosition-200);
+ ((JavascriptExecutor)driver).executeScript(js);
+ String number = numberPurchaseElement.getText();
+ testElement.click();
+ return number;
+
+ }
+
+ public void clickCommercialPurchases(){
+ Actions action = new Actions(driver);
+ action.moveToElement(purchasesElement).perform();
+ commercialPurchases.click();
+ }
+
+
+ public boolean isPageDisplayTender()
+ {
+ String checkNumber = checkNumberElement.getText();
+ return checkNumber.equals(clickFzElement());
+ }
+
+
+ public boolean isPageDisplayArticle()
+ {
+ String checkheadline = headElement.getText();
+ return checkheadline.equals(headline);
+ }
+
+ public void clickGreenSearchButton()
+ {
+ searchGreenButton.click();
+ }
+ public boolean isPageDisplayFeedback() {
+ return driver.findElement(By.cssSelector("#aspnetForm > div.master_open_content > div > div.response_list")).isDisplayed();
+ }
+
+ public boolean isPageDisplayAccreditation() {
+ return driver.findElement(By.cssSelector("#XMLContainer > h2")).isDisplayed();
+ }
+ public boolean isPageDisplayMenu() {
+ return driver.findElement(By.cssSelector("#aspnetForm > div.master_open_content" +
+ " > div > h2:nth-child(2)")).isDisplayed();
+ }
+ public boolean isPageDisplayMain() {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }return driver.findElement(By.cssSelector("div.default_press:nth-child(1) > h2:nth-child(1)")).isDisplayed();
+ }
+
+ public void submitSearchHeader() {
+ searchHeaderElement.sendKeys(Keys.RETURN);
+
+ }
+
+}
diff --git a/Kravchenko/src/test/java/page/SearchPage.java b/Kravchenko/src/test/java/page/SearchPage.java
new file mode 100644
index 0000000..ef74d99
--- /dev/null
+++ b/Kravchenko/src/test/java/page/SearchPage.java
@@ -0,0 +1,81 @@
+package page;
+
+import jdk.nashorn.internal.runtime.NumberToString;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+public class SearchPage {
+ WebDriver driver;
+ @FindBy(css = ".page-result-search .list-group-item")
+ private List listResultSearch;
+
+ @FindBy(css = "#searchInput")
+ private WebElement searchHeaderElement;
+
+ @FindBy (css = "#filters > div > table > tbody > tr:nth-child(1) > " +
+ "td:nth-child(2) > button.element-in-one-row.simple-button.orange-background")
+ private WebElement addFilterButton;
+
+ @FindBy (css = "#specialFilters > table:nth-child(3) > tbody > tr:nth-child(1)" +
+ " > td:nth-child(2) > span:nth-child(1) > input")
+ private WebElement priceElement;
+
+ @FindBy (css = "#OkCansellBtns > input.simple-button.green-background")
+ private WebElement searchButton;
+
+ @FindBy(css = "#resultTbl > tbody > tr:nth-child(1) >" +
+ " td:nth-child(1) > div:nth-child(3) > span.es-el-amount")
+ private WebElement resultElement;
+
+ @FindBy(xpath = "//*[@id=\"main\"]/div/div[3]/div[1]/div/div/div/div/div[4]/button[2]")
+ private WebElement searchFilterElement;
+ @FindBy(css = "#sortControls > a:nth-child(6)")
+ private WebElement searchSortingElement;
+
+ double pr = 1000000;
+
+ public SearchPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public boolean isPageDisplayReestr(){
+ return driver.findElement(By.cssSelector("#aspnetForm > div.master_open_content >" +
+ " div > div > h2")).isDisplayed();
+ }
+ public void clickSearchFilter() {
+ addFilterButton.click();
+ String b = String.valueOf(pr);
+ priceElement.sendKeys(b);
+ searchButton.click();
+
+
+ }
+
+ public void clickSearchSortingElement() {
+ searchSortingElement.click();
+ }
+ public boolean checkSearch(String strSearch) {
+ boolean checkSearch = false;
+ int count = listResultSearch.size();
+ for (int i = 0; i < count - 1; i++) {
+ if (listResultSearch.get(i).getText().contains(strSearch))
+ checkSearch = true;
+ }
+ return true;
+ }
+
+
+ public boolean checkFilter()
+ {
+ double b = Math.round(Double.parseDouble(resultElement.getText().replaceAll(" ", "")));
+ return b > pr;
+
+ }
+
+
+}
diff --git a/Kravchenko/src/test/java/page/ShedulePage.java b/Kravchenko/src/test/java/page/ShedulePage.java
new file mode 100644
index 0000000..3cb4226
--- /dev/null
+++ b/Kravchenko/src/test/java/page/ShedulePage.java
@@ -0,0 +1,44 @@
+package page;
+
+import org.openqa.selenium.*;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.FindBy;
+
+public class ShedulePage
+{
+ WebDriver driver;
+ String typeText;
+ @FindBy(css = "#FilterContainer > table > tbody > tr > td > table > " +
+ "tbody > tr:nth-child(5) > td:nth-child(2) > input.btnBasic.btnType3.btnFilter")
+ private WebElement chooseTypeButton;
+
+ @FindBy(id = "spravIframe")
+ private WebElement listFrame;
+
+ @FindBy(xpath = "//*[@id=\"99\"]")
+ private WebElement typeElement;
+
+ @FindBy(css = "#ctl00_ctl00_phWorkZone_btnSearch")
+ private WebElement searchSheduleButton;
+
+ public void searchShedule()
+ {
+ chooseTypeButton.click();
+
+ try {
+ Thread.sleep(5000);
+ driver.switchTo().frame(listFrame);
+ typeElement.click();
+ typeText = typeElement.getText();
+ System.out.println(typeText);
+
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ searchSheduleButton.click();
+
+
+ }
+
+
+}
diff --git a/Kravchenko/src/test/java/page/SubMenuPage.java b/Kravchenko/src/test/java/page/SubMenuPage.java
new file mode 100644
index 0000000..120050a
--- /dev/null
+++ b/Kravchenko/src/test/java/page/SubMenuPage.java
@@ -0,0 +1,100 @@
+package page;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+;
+import java.io.File;
+import java.util.List;
+
+
+public class SubMenuPage {
+ WebDriver driver;
+ String text = "7736050003";
+ @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(css = "#ctl00_ctl00_A1")
+ private WebElement logotypeElement;
+
+ @FindBy(id = "ctl0#ctl00_A10_Img2")
+ private WebElement brElement;
+
+ @FindBy(css = "#ctl00_phWorkZone_PageContent_lblbody > div > div > div:nth-child(5) > div > h1")
+ private WebElement registElement;
+
+ @FindBy (css = "#FilterContainer > div > table > tbody > " +
+ "tr:nth-child(2) > td:nth-child(2) > input[type=\"text\"]")
+ private WebElement searchReestrElement;
+
+ @FindBy (css = "#ctl00_ctl00_phWorkZone_btnSearch")
+ private WebElement searchReestrButton;
+
+ @FindBy(css = "span.pager-button.pagerElem.currPageInPager")
+ private List paginationElements;
+
+
+ @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(css = "#aspnetForm > div.master_open_content > div > " +
+ "div.layout_ik > div.row.rowSeparated.textLikeEverywhere > div:nth-child(1) > a")
+ private WebElement downloandDocumentElement;
+
+ public boolean isPageDisplayRegistration() {
+ return driver.findElement(By.cssSelector("#ctl00_phWorkZone_PageContent_lblbody > " +
+ "div > div > div:nth-child(5) > div > h1")).isDisplayed();
+ }
+
+ public void insertSearchReestrText() {
+ searchReestrElement.sendKeys(text);
+ searchReestrButton.click();
+ }
+
+ public void clickDownloandDocumentElement() {
+ downloandDocumentElement.click();
+ }
+ public void clickLogoElement() {
+ logotypeElement.click();
+ }
+ public boolean isPageDisplayContractors()
+ {
+
+ String INN = driver.findElement(By.cssSelector("#INN")).getText();
+ return INN.equals(text);
+ }
+
+ public boolean isRageDisplaySearch()
+ {
+ return driver.findElement(By.cssSelector("#searchInput")).isDisplayed();
+ }
+
+ public SubMenuPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public boolean isPageDisplayDocuments() {
+ return driver.findElement(By.cssSelector("#aspnetForm > div.master_open_content >" +
+ " div > div.layout_ik > div:nth-child(2) > div > h1")).isDisplayed();
+ }
+ public String getFileName() {
+ String fileName = downloandDocumentElement.getAttribute("href");
+ fileName = fileName.substring(fileName.lastIndexOf("/") + 1);
+ return fileName;
+ }
+
+
+
+
+
+}
\ No newline at end of file