diff --git a/Skalkin/.gitignore b/Skalkin/.gitignore
new file mode 100644
index 0000000..3bac491
--- /dev/null
+++ b/Skalkin/.gitignore
@@ -0,0 +1,156 @@
+
+# Created by https://www.gitignore.io/api/intellij,java,maven,gradle,eclipse,netbeans
+
+### Intellij ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
+
+*.iml
+nb-configuration.xml
+
+## Directory-based project format:
+.idea/
+.target
+# if you remove the above rule, at least ignore the following:
+
+# User-specific stuff:
+# .idea/workspace.xml
+# .idea/tasks.xml
+# .idea/dictionaries
+# .idea/shelf
+
+# Sensitive or high-churn files:
+# .idea/dataSources.ids
+# .idea/dataSources.xml
+# .idea/sqlDataSources.xml
+# .idea/dynamic.xml
+# .idea/uiDesigner.xml
+
+# Gradle:
+# .idea/gradle.xml
+# .idea/libraries
+
+# Mongo Explorer plugin:
+# .idea/mongoSettings.xml
+
+## File-based project format:
+*.ipr
+*.iws
+
+## Plugin-specific files:
+
+# IntelliJ
+/out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+
+### Java ###
+*.class
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.ear
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+
+### Maven ###
+target/
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+pom.xml.next
+release.properties
+dependency-reduced-pom.xml
+buildNumber.properties
+.mvn/timing.properties
+
+
+### Gradle ###
+.gradle
+build/
+
+# Ignore Gradle GUI config
+gradle-app.setting
+
+# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
+!gradle-wrapper.jar
+
+# Cache of project
+.gradletasknamecache
+
+
+### Eclipse ###
+
+.metadata
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.settings/
+.loadpath
+
+# Eclipse Core
+.project
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# PyDev specific (Python IDE for Eclipse)
+*.pydevproject
+
+# CDT-specific (C/C++ Development Tooling)
+.cproject
+
+# JDT-specific (Eclipse Java Development Tools)
+.classpath
+
+# Java annotation processor (APT)
+.factorypath
+
+# PDT-specific (PHP Development Tools)
+.buildpath
+
+# sbteclipse plugin
+.target
+
+# TeXlipse plugin
+.texlipse
+
+# STS (Spring Tool Suite)
+.springBeans
+
+
+### NetBeans ###
+nbproject/private/
+build/
+nbbuild/
+dist/
+nbdist/
+nbactions.xml
+.nb-gradle/
+
+*.log
+
+csv/
\ No newline at end of file
diff --git a/Skalkin/README.md b/Skalkin/README.md
new file mode 100644
index 0000000..635e81b
--- /dev/null
+++ b/Skalkin/README.md
@@ -0,0 +1,2 @@
+Selenium WebDriver example project
+
diff --git a/Skalkin/pom.xml b/Skalkin/pom.xml
new file mode 100644
index 0000000..756ca36
--- /dev/null
+++ b/Skalkin/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/Skalkin/src/main/java/ru/ulstu/tis/Main.java b/Skalkin/src/main/java/ru/ulstu/tis/Main.java
new file mode 100644
index 0000000..aa6f1d2
--- /dev/null
+++ b/Skalkin/src/main/java/ru/ulstu/tis/Main.java
@@ -0,0 +1,8 @@
+package ru.ulstu.tis;
+
+public class Main {
+
+ public static void main(String[] args) {
+ System.out.println("666");
+ }
+}
diff --git a/Skalkin/src/main/resources/drivers/chromedriver b/Skalkin/src/main/resources/drivers/chromedriver
new file mode 100644
index 0000000..02ff671
Binary files /dev/null and b/Skalkin/src/main/resources/drivers/chromedriver differ
diff --git a/Skalkin/src/main/resources/drivers/chromedriver.exe b/Skalkin/src/main/resources/drivers/chromedriver.exe
new file mode 100644
index 0000000..28a4067
Binary files /dev/null and b/Skalkin/src/main/resources/drivers/chromedriver.exe differ
diff --git a/Skalkin/src/main/resources/drivers/geckodriver b/Skalkin/src/main/resources/drivers/geckodriver
new file mode 100644
index 0000000..ba1da8c
Binary files /dev/null and b/Skalkin/src/main/resources/drivers/geckodriver differ
diff --git a/Skalkin/src/main/resources/drivers/geckodriver.exe b/Skalkin/src/main/resources/drivers/geckodriver.exe
new file mode 100644
index 0000000..6208aa8
Binary files /dev/null and b/Skalkin/src/main/resources/drivers/geckodriver.exe differ
diff --git a/Skalkin/src/test/java/AutorizationTests.java b/Skalkin/src/test/java/AutorizationTests.java
new file mode 100644
index 0000000..8d59658
--- /dev/null
+++ b/Skalkin/src/test/java/AutorizationTests.java
@@ -0,0 +1,76 @@
+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 AutorizationTests {
+ private final static String APP_URL = "https://www.kinopoisk.ru/";
+ private final static String APP_URL_MOVIE = "https://www.kinopoisk.ru/film/mstiteli-voyna-beskonechnosti-2018-843649/";
+
+ 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 testLoginSocial(){
+ context.getDriver().get(APP_URL);//Открыта страница фильма
+
+ LoginPage page = PageFactory.initElements(context.getDriver(), LoginPage.class);//Выбрать пункт меню
+ page.clickButtonLogin();
+ page.isFrameLogin();
+ page.frameLogin();
+ page.isButtonVK();
+ page.clickButtonVK();
+ page.frameDefault();
+
+ VKPage pageVk = PageFactory.initElements(context.getDriver(), VKPage.class);
+ pageVk.setOldWindow();
+ pageVk.switchToSocial();
+ Assertions.assertTrue(pageVk.isVkPagePresent());
+ pageVk.closeWindow();
+ pageVk.switchToOldWindow();
+ }
+
+ @Test
+ public void testLoginEmail() throws InterruptedException {
+ context.getDriver().get(APP_URL);//Открыта страница фильма
+
+ LoginPage page = PageFactory.initElements(context.getDriver(), LoginPage.class);//Выбрать пункт меню
+ page.clickButtonLogin();
+ page.isFrameLogin();
+ page.frameLogin();
+ page.insertEmail("sefyijupsi@tutye.com");
+ page.insertPassword("q1w2e3r4t5y6");
+ Thread.sleep(500);
+ page.insertSignInEnter();
+ page.frameDefault();
+
+ Assertions.assertTrue(page.isAutorization());
+ context.getDriver().get("https://www.kinopoisk.ru/logout/");
+ }
+
+ @Test
+ public void testLike(){
+ context.getDriver().get(APP_URL_MOVIE);//Открыта страница фильма
+
+ MoviePage page = PageFactory.initElements(context.getDriver(), MoviePage.class);//Выбрать пункт меню
+ page.clickLike();
+
+ Assertions.assertTrue(page.isErrorLike());
+ }
+}
\ No newline at end of file
diff --git a/Skalkin/src/test/java/NavigationTests.java b/Skalkin/src/test/java/NavigationTests.java
new file mode 100644
index 0000000..a4d2710
--- /dev/null
+++ b/Skalkin/src/test/java/NavigationTests.java
@@ -0,0 +1,124 @@
+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 NavigationTests {
+ private final static String APP_URL = "https://www.kinopoisk.ru/";
+ private final static String APP_URL_MOVIE = "https://www.kinopoisk.ru/film/koma-2018-933208/";
+ private final static String APP_URL_ACTOR = "https://www.kinopoisk.ru/name/1189311/";
+
+ 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 testSubPageTop() {
+ context.getDriver().get(APP_URL);//Открыта любая страница сайта, кроме специальных
+
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);
+ page.clickSubMenu();
+
+ AfishaPage pageAfisha = PageFactory.initElements(context.getDriver(), AfishaPage.class);
+ Assertions.assertTrue(pageAfisha.isTopViewElementPresent());//Корректно отображена выбранная страница
+ }
+
+ @Test
+ public void testLogo() {
+ context.getDriver().get(APP_URL);//Открыта любая страница сайта, кроме специальных
+
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);//Выбрать пункт меню
+ page.clickLogo();
+
+ Assertions.assertTrue(page.isMainPagePresent());//Корректно отображена выбранная страница
+ }
+
+ @Test
+ public void testInfoMovie() {
+ context.getDriver().get(APP_URL_MOVIE);//Открыта страница фильма
+
+ MoviePage pageMovie = PageFactory.initElements(context.getDriver(), MoviePage.class);//Выбрать пункт меню
+ pageMovie.clickInfo();
+
+ ActorPage pageActor = PageFactory.initElements(context.getDriver(), ActorPage.class);
+ Assertions.assertTrue(pageActor.isActorPagePresent());//Корректно отображена выбранная страница
+ }
+
+ @Test
+ public void testInfoActor() {
+ context.getDriver().get(APP_URL_ACTOR);//Открыта страница фильма
+
+ ActorPage pageActor = PageFactory.initElements(context.getDriver(), ActorPage.class);//Выбрать пункт меню
+ pageActor.clickInfo();
+
+ MoviePage pageMovie = PageFactory.initElements(context.getDriver(), MoviePage.class);
+ Assertions.assertTrue(pageMovie.isMoviePagePresent());//Корректно отображена выбранная страница
+ }
+
+ @Test
+ public void testDownMenu() {
+ context.getDriver().get(APP_URL);//Открыта страница фильма
+
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);//Выбрать пункт меню
+ page.clickDownMenu();
+
+ RandomSearchPage pageSearch = PageFactory.initElements(context.getDriver(), RandomSearchPage.class);
+ Assertions.assertTrue(pageSearch.isRandomMovieFormPresent());//Корректно отображена выбранная страница
+ }
+
+ @Test
+ public void testRightMenu() {
+ context.getDriver().get(APP_URL);//Открыта страница фильма
+
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);//Выбрать пункт меню
+ page.clickRightMenu();
+
+ MoviePage pageMovie = PageFactory.initElements(context.getDriver(), MoviePage.class);
+ Assertions.assertTrue(pageMovie.isMoviePagePresent());//Корректно отображена выбранная страница
+ }
+
+ @Test
+ public void testSocialMovieMenu() {
+ context.getDriver().get(APP_URL_MOVIE);//Открыта страница фильма
+
+ MoviePage pageMovie = PageFactory.initElements(context.getDriver(), MoviePage.class);//Выбрать пункт меню
+ pageMovie.clickSocial();
+
+ VKPage pageVk = PageFactory.initElements(context.getDriver(), VKPage.class);
+ pageVk.setOldWindow();
+ pageVk.switchToSocial();
+ Assertions.assertTrue(pageVk.isVkPagePresent());
+ pageVk.closeWindow();
+ pageVk.switchToOldWindow();
+ }
+
+ @Test
+ public void testSocialActorMenu() {
+ context.getDriver().get(APP_URL_ACTOR);//Открыта страница фильма
+
+ ActorPage pageActor = PageFactory.initElements(context.getDriver(), ActorPage.class);//Выбрать пункт меню
+ pageActor.clickSocial();
+
+ VKPage pageVk = PageFactory.initElements(context.getDriver(), VKPage.class);
+ pageVk.setOldWindow();
+ pageVk.switchToSocial();
+ Assertions.assertTrue(pageVk.isVkPagePresent());
+ pageVk.closeWindow();
+ pageVk.switchToOldWindow();
+ }
+}
diff --git a/Skalkin/src/test/java/SearchTests.java b/Skalkin/src/test/java/SearchTests.java
new file mode 100644
index 0000000..bfd291e
--- /dev/null
+++ b/Skalkin/src/test/java/SearchTests.java
@@ -0,0 +1,153 @@
+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.*;
+import page.search.*;
+
+public class SearchTests {
+ private final static String APP_URL = "https://www.kinopoisk.ru/";
+ private final static String APP_URL_SEARCH = "https://www.kinopoisk.ru/s/";
+
+ 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 testSimpleSearch() {
+ context.getDriver().get(APP_URL);//Открыта любая страница сайта, кроме специальных
+
+ MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class);//Выбрать пункт меню
+ page.insertSearch("Кома");
+ page.enterSearch();
+
+ SearchExtendedResultPage pageTo = PageFactory.initElements(context.getDriver(), SearchExtendedResultPage.class);//Корректно отображена выбранная страница
+ Assertions.assertTrue(pageTo.isKomaFromResultElementPresent());
+ }
+
+ @Test
+ public void testExtendedSearch() {
+ context.getDriver().get(APP_URL_SEARCH);//Открыта любая страница сайта, кроме специальных
+
+ SearchExtendedPage page = PageFactory.initElements(context.getDriver(), SearchExtendedPage.class);//Выбрать пункт меню
+ page.insertNameSearch("Кома");
+ page.openCountry();
+ page.clickCountry();
+ page.enterSearch();
+
+ SearchExtendedResultPage pageResult = PageFactory.initElements(context.getDriver(), SearchExtendedResultPage.class);//Корректно отображена выбранная страница
+ Assertions.assertTrue(pageResult.isKomaFromResultElementPresent());
+ }
+
+ @Test
+ public void testSearchByCreators() throws InterruptedException {
+ context.getDriver().get(APP_URL_SEARCH);//Открыта любая страница сайта, кроме специальных
+
+ SearchByCreatorsPage page = PageFactory.initElements(context.getDriver(), SearchByCreatorsPage.class);//Выбрать пункт меню
+ page.insertNameSearch("Безруков");
+ Thread.sleep(2500);
+ page.clickDown();
+ page.clickEnter();
+ Thread.sleep(1000);
+ page.enterSearch();
+
+ SearchByCreatorsResultPage pageResult = PageFactory.initElements(context.getDriver(), SearchByCreatorsResultPage.class);//Корректно отображена выбранная страница
+ Assertions.assertTrue(pageResult.isBrigadaFromResultCreatorsPresent());
+ }
+
+ @Test
+ public void testSearchByPeople() {
+ context.getDriver().get(APP_URL_SEARCH);//Открыта любая страница сайта, кроме специальных
+
+ SearchByPeoplePage page = PageFactory.initElements(context.getDriver(), SearchByPeoplePage.class);//Выбрать пункт меню
+ page.insertNameSearch("Безруков");
+ page.enterSearch();
+
+ SearchExtendedResultPage pageResult = PageFactory.initElements(context.getDriver(), SearchExtendedResultPage.class);//Корректно отображена выбранная страница
+ Assertions.assertTrue(pageResult.isBezrukovFromResultElementPresent());
+ }
+
+ @Test
+ public void testSearchInText() {
+ context.getDriver().get(APP_URL_SEARCH);//Открыта любая страница сайта, кроме специальных
+
+ SearchInTextPage page = PageFactory.initElements(context.getDriver(), SearchInTextPage.class);//Выбрать пункт меню
+ page.insertNameSearch("Веном");
+ page.enterSearch();
+
+ SearchInTextResultPage pageResult = PageFactory.initElements(context.getDriver(), SearchInTextResultPage.class);//Корректно отображена выбранная страница
+ String str = pageResult.getNewsElementToString();
+
+ Assertions.assertTrue(pageResult.isListElementPresent("Веном"));
+ }
+
+ @Test
+ public void testSearchByUsers() {
+ context.getDriver().get(APP_URL_SEARCH);//Открыта любая страница сайта, кроме специальных
+
+ SearchByUsersPage page = PageFactory.initElements(context.getDriver(), SearchByUsersPage.class);//Выбрать пункт меню
+ page.insertNameSearch("Антон");
+ page.enterSearch();
+
+ SearchExtendedResultPage pageResult = PageFactory.initElements(context.getDriver(), SearchExtendedResultPage.class);//Корректно отображена выбранная страница
+ Assertions.assertTrue(pageResult.isUsersResultElementPresent("Антон"));
+ }
+
+ @Test
+ public void testSearchByKeyword() {
+ context.getDriver().get(APP_URL_SEARCH);//Открыта любая страница сайта, кроме специальных
+
+ SearchByKeywordPage page = PageFactory.initElements(context.getDriver(), SearchByKeywordPage.class);//Выбрать пункт меню
+ page.insertNameSearch("Война");
+ page.enterSearch();
+
+ SearchByKeywordResultPage pageResult = PageFactory.initElements(context.getDriver(), SearchByKeywordResultPage.class);//Корректно отображена выбранная страница
+ Assertions.assertTrue(pageResult.isFirstResultElementPresent("Война"));
+ }
+
+ @Test
+ public void testSearchMovieByWord() throws InterruptedException {
+ context.getDriver().get(APP_URL_SEARCH);//Открыта любая страница сайта, кроме специальных
+
+ SearchMovieByWordPage page = PageFactory.initElements(context.getDriver(), SearchMovieByWordPage.class);//Выбрать пункт меню
+ page.insertNameSearch("Магия");
+ Thread.sleep(500);
+ page.clickDown();
+ Thread.sleep(500);
+ page.clickDown();
+ Thread.sleep(500);
+ page.clickEnter();
+ Thread.sleep(1000);
+ page.enterSearch();
+
+ SearchByCreatorsResultPage pageResult = PageFactory.initElements(context.getDriver(), SearchByCreatorsResultPage.class);//Корректно отображена выбранная страница
+ Assertions.assertTrue(pageResult.isFirstResultByWordPresent());
+ }
+
+ @Test
+ public void testSearchByStudio() throws InterruptedException {
+ context.getDriver().get(APP_URL_SEARCH);//Открыта любая страница сайта, кроме специальных
+
+ SearchByStudioPage page = PageFactory.initElements(context.getDriver(), SearchByStudioPage.class);//Выбрать пункт меню
+ page.insertNameSearch("Disney");
+ Thread.sleep(1000);
+ page.enterSearch();
+
+ SearchByKeywordResultPage pageResult = PageFactory.initElements(context.getDriver(), SearchByKeywordResultPage.class);//Корректно отображена выбранная страница
+ Assertions.assertTrue(pageResult.isFirstResultElementPresent("Disney"));
+ }
+}
diff --git a/Skalkin/src/test/java/context/ChromeContext.java b/Skalkin/src/test/java/context/ChromeContext.java
new file mode 100644
index 0000000..aa8c420
--- /dev/null
+++ b/Skalkin/src/test/java/context/ChromeContext.java
@@ -0,0 +1,25 @@
+package context;
+
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.firefox.FirefoxDriver;
+
+public class ChromeContext extends Context {
+ private final static String WINDOWS_DRIVER = "chromedriver.exe";
+ private final static String LINUX_DRIVER = "chromedriver";
+ private final static String DRIVER_TYPE = "webdriver.chrome.driver";
+
+ @Override
+ protected void createDriver() {
+ driver = new ChromeDriver();
+ }
+
+ @Override
+ protected String getDriverExecutable(boolean isWindows) {
+ return isWindows ? WINDOWS_DRIVER : LINUX_DRIVER;
+ }
+
+ @Override
+ protected String getDriverType() {
+ return DRIVER_TYPE;
+ }
+}
diff --git a/Skalkin/src/test/java/context/Context.java b/Skalkin/src/test/java/context/Context.java
new file mode 100644
index 0000000..928d5dd
--- /dev/null
+++ b/Skalkin/src/test/java/context/Context.java
@@ -0,0 +1,43 @@
+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;
+
+ 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");
+ }
+}
diff --git a/Skalkin/src/test/java/context/FirefoxContext.java b/Skalkin/src/test/java/context/FirefoxContext.java
new file mode 100644
index 0000000..1d5c163
--- /dev/null
+++ b/Skalkin/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/Skalkin/src/test/java/page/ActorPage.java b/Skalkin/src/test/java/page/ActorPage.java
new file mode 100644
index 0000000..a514686
--- /dev/null
+++ b/Skalkin/src/test/java/page/ActorPage.java
@@ -0,0 +1,31 @@
+package page;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+public class ActorPage {
+ WebDriver driver;
+
+ @FindBy(css = "#BestFilmList a")
+ private WebElement infoElement;
+
+ @FindBy(css = ".ya-share2__list a")
+ private WebElement socialElement;
+
+ public ActorPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public void clickInfo() {
+ infoElement.click();
+ }
+
+ public void clickSocial() {
+ socialElement.click();
+ }
+
+ public boolean isActorPagePresent() {
+ return infoElement.isDisplayed();
+ }
+}
diff --git a/Skalkin/src/test/java/page/AfishaPage.java b/Skalkin/src/test/java/page/AfishaPage.java
new file mode 100644
index 0000000..e9bd411
--- /dev/null
+++ b/Skalkin/src/test/java/page/AfishaPage.java
@@ -0,0 +1,23 @@
+package page;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.FindBy;
+
+public class AfishaPage {
+ WebDriver driver;
+
+ @FindBy(css = ".tableTopViewSeansMain")
+ private WebElement topViewElement;
+
+ public AfishaPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public boolean isTopViewElementPresent() {
+ return topViewElement.isDisplayed();
+ }
+}
diff --git a/Skalkin/src/test/java/page/LoginPage.java b/Skalkin/src/test/java/page/LoginPage.java
new file mode 100644
index 0000000..0655788
--- /dev/null
+++ b/Skalkin/src/test/java/page/LoginPage.java
@@ -0,0 +1,112 @@
+package page;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.FindBy;
+
+public class LoginPage {
+ WebDriver driver;
+
+ @FindBy(css = ".header-fresh-user-partial-component__login-button")
+ private WebElement buttonLogin;
+
+ @FindBy(css = ".social-auth__item.social-auth__item_code_vk")
+ private WebElement buttonVK;
+
+ @FindBy(css = ".header-fresh-user-partial-component__avatar")
+ private WebElement elementAvatar;
+
+ @FindBy(name = "login")
+ private WebElement elementEmail;
+
+ @FindBy(name = "password")
+ private WebElement elementPassword;
+
+ @FindBy(css = ".link.link_secondary.auth__signup-link")
+ private WebElement elementRegister;
+
+ @FindBy(css = ".kp2-authapi-iframe")
+ private WebElement signInFrame;
+
+ @FindBy(xpath = "//a[@href='/logout/']")
+ private WebElement buttonLogout;
+
+ public LoginPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public void clickButtonLogin() {
+ buttonLogin.click();
+ }
+
+ public void clickButtonVK() {
+ buttonVK.click();
+ }
+
+ public void clickButtonLogout() {
+ buttonLogout.click();
+ }
+
+ public void insertEmail(String str) {
+ elementEmail.sendKeys(str);
+ }
+
+ public void insertPassword(String str) {
+ elementPassword.sendKeys(str);
+ }
+
+ public void insertSignInEnter() {
+ elementPassword.sendKeys(Keys.ENTER);
+ }
+
+ public void isButtonVK() {
+ while(true){
+ try{
+ if(driver.findElement(By.cssSelector(".social-auth__item.social-auth__item_code_vk")).isDisplayed()){
+ return;
+ } else {
+ Thread.sleep(500);
+ }
+ }catch(Exception ex){ }
+ }
+ }
+
+ public void isFrameLogin() {
+ while(true){
+ try{
+ if(driver.findElement(By.name("kp2-authapi-iframe")).isDisplayed()){
+ return;
+ } else {
+ Thread.sleep(500);
+ }
+ }catch(Exception ex){ }
+ }
+ }
+
+ public void isButtonLogin() {
+ while(true){
+ try{
+ if(driver.findElement(By.name("kp2-authapi-iframe")).isDisplayed()){
+ return;
+ } else {
+ Thread.sleep(500);
+ }
+ }catch(Exception ex){ }
+ }
+ }
+
+ public void frameDefault(){
+ driver.switchTo().defaultContent();
+ }
+
+ public void frameLogin(){
+ driver.switchTo().frame(signInFrame);
+ }
+
+ public boolean isAutorization() {
+ return elementAvatar.isDisplayed();
+ }
+}
diff --git a/Skalkin/src/test/java/page/MainPage.java b/Skalkin/src/test/java/page/MainPage.java
new file mode 100644
index 0000000..bd23de2
--- /dev/null
+++ b/Skalkin/src/test/java/page/MainPage.java
@@ -0,0 +1,72 @@
+package page;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+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;
+
+import java.io.Console;
+import java.util.concurrent.TimeUnit;
+
+public class MainPage {
+ WebDriver driver;
+
+ @FindBy(css = ".kp-logo-partial-component")
+ private WebElement logoElement;
+
+ @FindBy(css = ".header-fresh-dropdown-partial-component__sidebar-link")
+ private WebElement menuElement;
+
+ @FindBy(css = ".header-fresh-partial-component__navigation-item")
+ private WebElement mainElement;
+
+ @FindBy(css = "#partial_component__footer a")
+ private WebElement downMenuElement;
+
+ @FindBy(css = "#rigth_box_weekend_rus dd a")
+ private WebElement rightMenuElement;
+
+ @FindBy(css = ".header-fresh-search-partial-component__field")
+ private WebElement searchElement;
+
+ @FindBy(id = "index_news")
+ private WebElement newsBaners;
+
+ public MainPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public void clickSubMenu() {
+ Actions builder = new Actions(driver);
+ builder.moveToElement(mainElement).perform();
+ menuElement.sendKeys(Keys.RETURN);
+ }
+
+ public void clickLogo() {
+ logoElement.click();
+ }
+
+ public void clickDownMenu() {
+ downMenuElement.click();
+ }
+
+ public void clickRightMenu() {
+ rightMenuElement.click();
+ }
+
+ public void insertSearch(String str) {
+ searchElement.sendKeys(str);
+ }
+
+ public void enterSearch() {
+ searchElement.sendKeys(Keys.ENTER);
+ }
+
+ public boolean isMainPagePresent() {
+ return newsBaners.isDisplayed();
+ }
+}
diff --git a/Skalkin/src/test/java/page/MoviePage.java b/Skalkin/src/test/java/page/MoviePage.java
new file mode 100644
index 0000000..e76cacb
--- /dev/null
+++ b/Skalkin/src/test/java/page/MoviePage.java
@@ -0,0 +1,45 @@
+package page;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+public class MoviePage {
+ WebDriver driver;
+
+ @FindBy(css = "#actorList a")
+ private WebElement infoElement;
+
+ @FindBy(css = ".ya-share2__list a")
+ private WebElement socialElement;
+
+ @FindBy(id = "btn_fav_film")
+ private WebElement buttonLike;
+
+ @FindBy(id = "ui_notice_container")
+ private WebElement infoError;
+
+ public MoviePage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public void clickInfo() {
+ infoElement.click();
+ }
+
+ public void clickSocial() {
+ socialElement.click();
+ }
+
+ public void clickLike() {
+ buttonLike.click();
+ }
+
+ public boolean isErrorLike() {
+ return infoError.isDisplayed();
+ }
+
+ public boolean isMoviePagePresent() {
+ return infoElement.isDisplayed();
+ }
+}
diff --git a/Skalkin/src/test/java/page/RandomSearchPage.java b/Skalkin/src/test/java/page/RandomSearchPage.java
new file mode 100644
index 0000000..f996f4c
--- /dev/null
+++ b/Skalkin/src/test/java/page/RandomSearchPage.java
@@ -0,0 +1,20 @@
+package page;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+public class RandomSearchPage {
+ WebDriver driver;
+
+ @FindBy(css = ".randomMovie")
+ private WebElement randomMovieForm;
+
+ public RandomSearchPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public boolean isRandomMovieFormPresent() {
+ return randomMovieForm.isDisplayed();
+ }
+}
diff --git a/Skalkin/src/test/java/page/VKPage.java b/Skalkin/src/test/java/page/VKPage.java
new file mode 100644
index 0000000..323e219
--- /dev/null
+++ b/Skalkin/src/test/java/page/VKPage.java
@@ -0,0 +1,40 @@
+package page;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+public class VKPage {
+ WebDriver driver;
+ private String oldWindow;
+
+ @FindBy(id = "login_submit")
+ private WebElement formLoginVk;
+
+ public VKPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public void switchToSocial(){
+ for (String winHandle : driver.getWindowHandles()) {
+ driver.switchTo().window(winHandle);
+ }
+ }
+
+ public void setOldWindow() {
+ this.oldWindow = driver.getWindowHandle();
+ }
+
+ public void switchToOldWindow(){
+ if(oldWindow != "")
+ driver.switchTo().window(oldWindow);
+ }
+
+ public void closeWindow() {
+ driver.close();
+ }
+
+ public boolean isVkPagePresent() {
+ return formLoginVk.isDisplayed();
+ }
+}
diff --git a/Skalkin/src/test/java/page/search/SearchByCreatorsPage.java b/Skalkin/src/test/java/page/search/SearchByCreatorsPage.java
new file mode 100644
index 0000000..91a4c07
--- /dev/null
+++ b/Skalkin/src/test/java/page/search/SearchByCreatorsPage.java
@@ -0,0 +1,42 @@
+package page.search;
+
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import java.util.List;
+
+public class SearchByCreatorsPage {
+ WebDriver driver;
+
+ @FindBy(id = "btn_search_6")
+ private WebElement buttonElement;
+
+ @FindBy(id = "cr_search_field_1")
+ private WebElement nameElement;
+
+ public SearchByCreatorsPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public void insertNameSearch(String str) {
+ nameElement.sendKeys(str);
+ }
+
+ public void clickDown() {
+ nameElement.sendKeys(Keys.ARROW_DOWN);
+ }
+
+ public void clickEnter() {
+ nameElement.sendKeys(Keys.ENTER);
+ }
+
+ public void enterSearch() {
+ buttonElement.click();
+ }
+
+// public boolean isUserPresent() {
+// return topBaners.isDisplayed();
+// }
+}
diff --git a/Skalkin/src/test/java/page/search/SearchByCreatorsResultPage.java b/Skalkin/src/test/java/page/search/SearchByCreatorsResultPage.java
new file mode 100644
index 0000000..c5a09c6
--- /dev/null
+++ b/Skalkin/src/test/java/page/search/SearchByCreatorsResultPage.java
@@ -0,0 +1,34 @@
+package page.search;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+public class SearchByCreatorsResultPage {
+ WebDriver driver;
+
+ @FindBy(css = ".search_adv")
+ private WebElement resultCreatorsElement;
+
+ @FindBy(xpath = "//a[@href='/film/brigada-2002-77039/sr/1/']")
+ private WebElement brigadaFromResultCreatorsElement;
+
+ @FindBy(xpath = "//a[@href='/film/garri-potter-i-filosofskiy-kamen-2001-689/sr/1/']")
+ private WebElement firstResultByWordElement;
+
+ public SearchByCreatorsResultPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public boolean isFirstResultByWordPresent() {
+ return firstResultByWordElement.isDisplayed();
+ }
+
+ public boolean isBrigadaFromResultCreatorsPresent() {
+ return brigadaFromResultCreatorsElement.isDisplayed();
+ }
+
+ public boolean isResultCreatorsPresent() {
+ return resultCreatorsElement.isDisplayed();
+ }
+}
diff --git a/Skalkin/src/test/java/page/search/SearchByKeywordPage.java b/Skalkin/src/test/java/page/search/SearchByKeywordPage.java
new file mode 100644
index 0000000..7f5c343
--- /dev/null
+++ b/Skalkin/src/test/java/page/search/SearchByKeywordPage.java
@@ -0,0 +1,28 @@
+package page.search;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+public class SearchByKeywordPage {
+ WebDriver driver;
+
+ @FindBy(css = "#keyword_search .submit.nice_button")
+ private WebElement buttonElement;
+
+ @FindBy(id = "find_keyword")
+ private WebElement nameElement;
+
+ public SearchByKeywordPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public void insertNameSearch(String str) {
+ nameElement.sendKeys(str);
+ }
+
+ public void enterSearch() {
+ buttonElement.click();
+ }
+
+}
diff --git a/Skalkin/src/test/java/page/search/SearchByKeywordResultPage.java b/Skalkin/src/test/java/page/search/SearchByKeywordResultPage.java
new file mode 100644
index 0000000..672e425
--- /dev/null
+++ b/Skalkin/src/test/java/page/search/SearchByKeywordResultPage.java
@@ -0,0 +1,38 @@
+package page.search;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import java.util.List;
+
+public class SearchByKeywordResultPage {
+ WebDriver driver;
+
+ @FindBy(css = ".news")
+ private WebElement newsElement;
+
+ @FindBy(xpath = "//*[@id=\'block_left_pad\']/div/table/tbody/tr/td/table[2]/tbody/tr/td/table[1]/tbody/tr")
+ private List listResultElement;
+
+ public SearchByKeywordResultPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public boolean isFirstResultElementPresent(String text) { //
+ boolean matched = true;
+
+ for (int i = 0; i < listResultElement.size()-1; i++) {
+ String str = listResultElement.get(i).getText();
+ if((i-2) % 3 == 0 && !str.toLowerCase().contains(text.toLowerCase())){
+ matched = false;
+ //break;
+ }
+ }
+ return matched;
+ }
+
+ public boolean isNewsElementPresent() {
+ return newsElement.isDisplayed();
+ }
+}
diff --git a/Skalkin/src/test/java/page/search/SearchByPeoplePage.java b/Skalkin/src/test/java/page/search/SearchByPeoplePage.java
new file mode 100644
index 0000000..9139556
--- /dev/null
+++ b/Skalkin/src/test/java/page/search/SearchByPeoplePage.java
@@ -0,0 +1,27 @@
+package page.search;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+public class SearchByPeoplePage {
+ WebDriver driver;
+
+ @FindBy(css = ".el_8.submit.nice_button")
+ private WebElement buttonElement;
+
+ @FindBy(id = "find_people")
+ private WebElement nameElement;
+
+ public SearchByPeoplePage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public void insertNameSearch(String str) {
+ nameElement.sendKeys(str);
+ }
+
+ public void enterSearch() {
+ buttonElement.click();
+ }
+}
diff --git a/Skalkin/src/test/java/page/search/SearchByStudioPage.java b/Skalkin/src/test/java/page/search/SearchByStudioPage.java
new file mode 100644
index 0000000..687cd8c
--- /dev/null
+++ b/Skalkin/src/test/java/page/search/SearchByStudioPage.java
@@ -0,0 +1,27 @@
+package page.search;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+public class SearchByStudioPage {
+ WebDriver driver;
+
+ @FindBy(css = "#studio_search .submit.nice_button")
+ private WebElement buttonElement;
+
+ @FindBy(id = "find_studio")
+ private WebElement nameElement;
+
+ public SearchByStudioPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public void insertNameSearch(String str) {
+ nameElement.sendKeys(str);
+ }
+
+ public void enterSearch() {
+ buttonElement.click();
+ }
+}
diff --git a/Skalkin/src/test/java/page/search/SearchByUsersPage.java b/Skalkin/src/test/java/page/search/SearchByUsersPage.java
new file mode 100644
index 0000000..c2d1d60
--- /dev/null
+++ b/Skalkin/src/test/java/page/search/SearchByUsersPage.java
@@ -0,0 +1,27 @@
+package page.search;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+public class SearchByUsersPage {
+ WebDriver driver;
+
+ @FindBy(css = ".el_9.submit.nice_button")
+ private WebElement buttonElement;
+
+ @FindBy(id = "name")
+ private WebElement nameElement;
+
+ public SearchByUsersPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public void insertNameSearch(String str) {
+ nameElement.sendKeys(str);
+ }
+
+ public void enterSearch() {
+ buttonElement.click();
+ }
+}
diff --git a/Skalkin/src/test/java/page/search/SearchByUsersResultPage.java b/Skalkin/src/test/java/page/search/SearchByUsersResultPage.java
new file mode 100644
index 0000000..0c1a87e
--- /dev/null
+++ b/Skalkin/src/test/java/page/search/SearchByUsersResultPage.java
@@ -0,0 +1,20 @@
+package page.search;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+public class SearchByUsersResultPage {
+ WebDriver driver;
+
+ @FindBy(id = "profileInfoWrap")
+ private WebElement element;
+
+ public SearchByUsersResultPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public boolean isUserPresent() {
+ return element.isDisplayed();
+ }
+}
diff --git a/Skalkin/src/test/java/page/search/SearchExtendedPage.java b/Skalkin/src/test/java/page/search/SearchExtendedPage.java
new file mode 100644
index 0000000..4f54719
--- /dev/null
+++ b/Skalkin/src/test/java/page/search/SearchExtendedPage.java
@@ -0,0 +1,43 @@
+package page.search;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import java.util.List;
+
+public class SearchExtendedPage {
+ WebDriver driver;
+
+ @FindBy(css = ".el_18.submit.nice_button")
+ private WebElement buttonElement;
+
+ @FindBy(id = "find_film")
+ private WebElement nameElement;
+
+ @FindBy(id = "country")
+ private WebElement countryElement;
+
+ @FindBy(css = "#country option")
+ private List countryToElement;
+
+ public SearchExtendedPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public void insertNameSearch(String str) {
+ nameElement.sendKeys(str);
+ }
+
+ public void openCountry() {
+ countryElement.click();
+ }
+
+ public void clickCountry() {
+ countryToElement.get(1).click();
+ }
+
+ public void enterSearch() {
+ buttonElement.click();
+ }
+}
diff --git a/Skalkin/src/test/java/page/search/SearchExtendedResultPage.java b/Skalkin/src/test/java/page/search/SearchExtendedResultPage.java
new file mode 100644
index 0000000..75c035d
--- /dev/null
+++ b/Skalkin/src/test/java/page/search/SearchExtendedResultPage.java
@@ -0,0 +1,53 @@
+package page.search;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import java.util.List;
+
+public class SearchExtendedResultPage {
+ WebDriver driver;
+
+ @FindBy(css = ".search_results_top")
+ private WebElement resultTopElement;
+
+ @FindBy(xpath = "//a[@href='/film/koma-2018-933208/sr/1/']")
+ private WebElement komaFromResultElement;
+
+ @FindBy(xpath = "//a[@href='/name/224620/sr/1/']")
+ private WebElement bezrukovFromResultElement;
+
+ @FindBy(css = ".element")
+ private List usersListResultElement;
+
+
+
+ public SearchExtendedResultPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public boolean isUsersResultElementPresent(String text) {
+ boolean matched = true;
+
+ for (int i = 0; i < usersListResultElement.size(); i++) {
+ if(!usersListResultElement.get(i).getText().toLowerCase().contains(text.toLowerCase())){
+ matched = false;
+ break;
+ }
+ }
+ return matched;
+ }
+
+ public boolean isBezrukovFromResultElementPresent() {
+ return bezrukovFromResultElement.isDisplayed();
+ }
+
+ public boolean isKomaFromResultElementPresent() {
+ return komaFromResultElement.isDisplayed();
+ }
+
+ public boolean isResultTopElementPresent() {
+ return resultTopElement.isDisplayed();
+ }
+}
diff --git a/Skalkin/src/test/java/page/search/SearchInTextPage.java b/Skalkin/src/test/java/page/search/SearchInTextPage.java
new file mode 100644
index 0000000..b9ba338
--- /dev/null
+++ b/Skalkin/src/test/java/page/search/SearchInTextPage.java
@@ -0,0 +1,27 @@
+package page.search;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+public class SearchInTextPage {
+ WebDriver driver;
+
+ @FindBy(css = ".el_12.submit.nice_button")
+ private WebElement buttonElement;
+
+ @FindBy(id = "txt_search_input")
+ private WebElement nameElement;
+
+ public SearchInTextPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public void insertNameSearch(String str) {
+ nameElement.sendKeys(str);
+ }
+
+ public void enterSearch() {
+ buttonElement.click();
+ }
+}
diff --git a/Skalkin/src/test/java/page/search/SearchInTextResultPage.java b/Skalkin/src/test/java/page/search/SearchInTextResultPage.java
new file mode 100644
index 0000000..c235576
--- /dev/null
+++ b/Skalkin/src/test/java/page/search/SearchInTextResultPage.java
@@ -0,0 +1,41 @@
+package page.search;
+
+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 SearchInTextResultPage {
+ WebDriver driver;
+
+ @FindBy(css = ".textorangebig")
+ private WebElement headerElement;
+
+ @FindBy(css = ".news")
+ private WebElement newsElement; //
+
+ @FindBy(xpath = "//*[@id='block_left_pad']/div/table/tbody/tr/td/table[2]/tbody/tr/td/table[2]/tbody/tr")
+ private List listNewsElement;
+
+ public SearchInTextResultPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public String getNewsElementToString(){
+ return newsElement.getText();
+ }
+
+ public boolean isListElementPresent(String text) {
+ boolean matched = true;
+
+ for (int i = 4; i < listNewsElement.size(); i++) {
+ if((i-1) % 3 == 0 && !listNewsElement.get(i).getText().toLowerCase().contains(text.toLowerCase())){
+ matched = false;
+ break;
+ }
+ }
+ return matched;
+ }
+}
diff --git a/Skalkin/src/test/java/page/search/SearchMovieByWordPage.java b/Skalkin/src/test/java/page/search/SearchMovieByWordPage.java
new file mode 100644
index 0000000..08a2d26
--- /dev/null
+++ b/Skalkin/src/test/java/page/search/SearchMovieByWordPage.java
@@ -0,0 +1,36 @@
+package page.search;
+
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+public class SearchMovieByWordPage {
+ WebDriver driver;
+
+ @FindBy(id = "search_button")
+ private WebElement buttonElement;
+
+ @FindBy(id = "search_field_1")
+ private WebElement nameElement;
+
+ public SearchMovieByWordPage(WebDriver driver) {
+ this.driver = driver;
+ }
+
+ public void insertNameSearch(String str) {
+ nameElement.sendKeys(str);
+ }
+
+ public void clickDown() {
+ nameElement.sendKeys(Keys.ARROW_DOWN);
+ }
+
+ public void clickEnter() {
+ nameElement.sendKeys(Keys.ENTER);
+ }
+
+ public void enterSearch() {
+ buttonElement.click();
+ }
+}