From 54217223b63ba197bb5749848e420132c1d9ead1 Mon Sep 17 00:00:00 2001 From: StroevaJ Date: Mon, 7 May 2018 00:32:33 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=B2?= =?UTF-8?q?=D1=8B=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stroeva/src/test/java/AccountTests.java | 94 ++++++++++++++ Stroeva/src/test/java/FilterTests.java | 61 +++++++++ Stroeva/src/test/java/NavigationTests.java | 12 +- Stroeva/src/test/java/VideoTests.java | 95 ++++++++++++++ Stroeva/src/test/java/page/AccUserPage.java | 57 ++++++++ Stroeva/src/test/java/page/ExSerialPage.java | 122 ++++++++++++++++++ Stroeva/src/test/java/page/HolderPage.java | 2 +- Stroeva/src/test/java/page/LoginPage.java | 82 ++++++++++++ .../{FilterPage.java => NavFilterPage.java} | 4 +- Stroeva/src/test/java/page/SearchPage.java | 20 +++ Stroeva/src/test/java/page/SerialPage.java | 61 +++++++++ Stroeva/src/test/java/page/VKPage.java | 34 +++++ 12 files changed, 635 insertions(+), 9 deletions(-) create mode 100644 Stroeva/src/test/java/AccountTests.java create mode 100644 Stroeva/src/test/java/FilterTests.java create mode 100644 Stroeva/src/test/java/VideoTests.java create mode 100644 Stroeva/src/test/java/page/AccUserPage.java create mode 100644 Stroeva/src/test/java/page/ExSerialPage.java create mode 100644 Stroeva/src/test/java/page/LoginPage.java rename Stroeva/src/test/java/page/{FilterPage.java => NavFilterPage.java} (82%) create mode 100644 Stroeva/src/test/java/page/SearchPage.java create mode 100644 Stroeva/src/test/java/page/SerialPage.java create mode 100644 Stroeva/src/test/java/page/VKPage.java diff --git a/Stroeva/src/test/java/AccountTests.java b/Stroeva/src/test/java/AccountTests.java new file mode 100644 index 0000000..61773f5 --- /dev/null +++ b/Stroeva/src/test/java/AccountTests.java @@ -0,0 +1,94 @@ +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 AccountTests { + private final static String APP_URL = "http://amovies.cc/serials_2017/5812-mertv-na-99.html"; + + private static Context context; + + @BeforeAll + public static void setup() { + context = new ChromeContext(); + context.start(); + context.getDriver().manage().window().setSize(new Dimension(1366, 768)); + } + + @AfterAll + public static void quit() { + context.close(); + } + + @Test + public void testSignIn() { + context.getDriver().get(APP_URL); + LoginPage page = PageFactory.initElements(context.getDriver(), LoginPage.class); + page.login(); + Assertions.assertTrue(page.isUserPresent()); + page.clickAccUser(); + page.clickExitAccUser(); + } + + @Test + public void testSignInVK() throws InterruptedException { + context.getDriver().get(APP_URL); + LoginPage page = PageFactory.initElements(context.getDriver(), LoginPage.class); + page.clickSignIn(); + page.clickVkButton(); + VKPage pageVk = PageFactory.initElements(context.getDriver(), VKPage.class); + String str = context.getDriver().getWindowHandle(); + pageVk.switchToSocial(); + Assertions.assertTrue(pageVk.isUserPresent()); + pageVk.closeSocial(); + pageVk.switchToOld(str); + Thread.sleep(1000); + page.clickToCloseFormButton(); + } + + @Test + public void testEditAcc() throws InterruptedException { + context.getDriver().get(APP_URL); + LoginPage page = PageFactory.initElements(context.getDriver(), LoginPage.class); + page.login(); + page.clickAccUser(); + AccUserPage pageAn = PageFactory.initElements(context.getDriver(), AccUserPage.class); + pageAn.clearEmail(); + pageAn.editEmail("Test2018t@mail.ru"); + pageAn.clickToButtonSave(); + Assertions.assertTrue(pageAn.checkEmail("Test2018t@mail.ru")); + page.clickAccUser(); + page.clickExitAccUser(); + } + + @Test + public void testFavoritePage() { + context.getDriver().get(APP_URL); + LoginPage page = PageFactory.initElements(context.getDriver(), LoginPage.class); + page.login(); + page.clickAccUser(); + AccUserPage pageAn = PageFactory.initElements(context.getDriver(), AccUserPage.class); + pageAn.clickToFavorite(); + Assertions.assertTrue(pageAn.isFavoritePage()); + page.clickAccUser(); + page.clickExitAccUser(); + } + + @Test + public void testFuturePage() { + context.getDriver().get(APP_URL); + LoginPage page = PageFactory.initElements(context.getDriver(), LoginPage.class); + page.login(); + page.clickAccUser(); + AccUserPage pageAn = PageFactory.initElements(context.getDriver(), AccUserPage.class); + pageAn.clickToFuture(); + Assertions.assertTrue(pageAn.isFavoritePage()); + page.clickAccUser(); + page.clickExitAccUser(); + } +} diff --git a/Stroeva/src/test/java/FilterTests.java b/Stroeva/src/test/java/FilterTests.java new file mode 100644 index 0000000..3e5f077 --- /dev/null +++ b/Stroeva/src/test/java/FilterTests.java @@ -0,0 +1,61 @@ +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 FilterTests { + private final static String APP_URL = "http://amovies.cc/serials/"; + + private static Context context; + + @BeforeAll + public static void setup() { + context = new ChromeContext(); + context.start(); + context.getDriver().manage().window().setSize(new Dimension(1366, 768)); + } + + @AfterAll + public static void quit() { + context.close(); + } + + @Test + public void testSearch() { + context.getDriver().get(APP_URL); + SerialPage page = PageFactory.initElements(context.getDriver(), SerialPage.class); + page.clickSearchButton(); + page.insertSearchText("Древние"); + page.insertEnterSearchText(); + SearchPage pageAn = PageFactory.initElements(context.getDriver(), SearchPage.class); + Assertions.assertTrue(pageAn.isUserPresent()); + } + + @Test + public void testCountryList() throws InterruptedException { + context.getDriver().get(APP_URL); + SerialPage page = PageFactory.initElements(context.getDriver(), SerialPage.class); + page.clickCountry(); + Thread.sleep(2000); + page.clickSerial(); + ExSerialPage pageAn = PageFactory.initElements(context.getDriver(), ExSerialPage.class); + Assertions.assertTrue(pageAn.isCountryPresent()); + } + + @Test + public void testGenreList() throws InterruptedException { + context.getDriver().get(APP_URL); + SerialPage page = PageFactory.initElements(context.getDriver(), SerialPage.class); + page.clickGenre(); + Thread.sleep(2000); + page.clickSerial(); + ExSerialPage pageAn = PageFactory.initElements(context.getDriver(), ExSerialPage.class); + Assertions.assertTrue(pageAn.isGenrePresent()); + } +} diff --git a/Stroeva/src/test/java/NavigationTests.java b/Stroeva/src/test/java/NavigationTests.java index 04eb4cf..b3dc2d3 100644 --- a/Stroeva/src/test/java/NavigationTests.java +++ b/Stroeva/src/test/java/NavigationTests.java @@ -22,7 +22,7 @@ public class NavigationTests { @AfterAll public static void quit() { - //context.close(); + context.close(); } @Test @@ -47,7 +47,7 @@ public class NavigationTests { context.getDriver().get(APP_URL); MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickRating(); - FilterPage pageAn = PageFactory.initElements(context.getDriver(), FilterPage.class); + NavFilterPage pageAn = PageFactory.initElements(context.getDriver(), NavFilterPage.class); Assertions.assertTrue(pageAn.isUserPresent()); } @@ -56,7 +56,7 @@ public class NavigationTests { context.getDriver().get(APP_URL); MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickYear(); - FilterPage pageAn = PageFactory.initElements(context.getDriver(), FilterPage.class); + NavFilterPage pageAn = PageFactory.initElements(context.getDriver(), NavFilterPage.class); Assertions.assertTrue(pageAn.isUserPresent()); } @@ -65,7 +65,7 @@ public class NavigationTests { context.getDriver().get(APP_URL); MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickCountry(); - FilterPage pageAn = PageFactory.initElements(context.getDriver(), FilterPage.class); + NavFilterPage pageAn = PageFactory.initElements(context.getDriver(), NavFilterPage.class); Assertions.assertTrue(pageAn.isUserPresent()); } @@ -74,7 +74,7 @@ public class NavigationTests { context.getDriver().get(APP_URL); MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickGenre(); - FilterPage pageAn = PageFactory.initElements(context.getDriver(), FilterPage.class); + NavFilterPage pageAn = PageFactory.initElements(context.getDriver(), NavFilterPage.class); Assertions.assertTrue(pageAn.isUserPresent()); } @@ -83,7 +83,7 @@ public class NavigationTests { context.getDriver().get(APP_URL); MainPage page = PageFactory.initElements(context.getDriver(), MainPage.class); page.clickMenu(); - FilterPage pageAn = PageFactory.initElements(context.getDriver(), FilterPage.class); + NavFilterPage pageAn = PageFactory.initElements(context.getDriver(), NavFilterPage.class); Assertions.assertTrue(pageAn.isUserPresent()); } } diff --git a/Stroeva/src/test/java/VideoTests.java b/Stroeva/src/test/java/VideoTests.java new file mode 100644 index 0000000..9675fbf --- /dev/null +++ b/Stroeva/src/test/java/VideoTests.java @@ -0,0 +1,95 @@ +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.ExSerialPage; +import page.LoginPage; +import page.SearchPage; +import page.SerialPage; + +public class VideoTests { + private final static String APP_URL = "http://amovies.cc/serials_2017/5812-mertv-na-99.html"; + + private static Context context; + + @BeforeAll + public static void setup() { + context = new ChromeContext(); + context.start(); + context.getDriver().manage().window().setSize(new Dimension(1366, 768)); + } + + @AfterAll + public static void quit() { + context.close(); + } + + @Test + public void testOpenFilter() { + context.getDriver().get(APP_URL); + ExSerialPage page = PageFactory.initElements(context.getDriver(), ExSerialPage.class); + String str = page.getGenre(); + page.clickGenre(); + SerialPage pageAn = PageFactory.initElements(context.getDriver(), SerialPage.class); + pageAn.clickSerial(); + Assertions.assertTrue(page.checkGenre(str)); + } + + @Test + public void testAddToFavorite() { + context.getDriver().get(APP_URL); + ExSerialPage page = PageFactory.initElements(context.getDriver(), ExSerialPage.class); + LoginPage loginPage = PageFactory.initElements(context.getDriver(), LoginPage.class); + loginPage.login(); + page.clickToFavorite(); + Assertions.assertTrue(page.isFavoritePresent()); + page.clickToFavorite(); + loginPage.clickAccUser(); + loginPage.clickExitAccUser(); + } + + @Test + public void testAddToFuture() { + context.getDriver().get(APP_URL); + ExSerialPage page = PageFactory.initElements(context.getDriver(), ExSerialPage.class); + LoginPage loginPage = PageFactory.initElements(context.getDriver(), LoginPage.class); + loginPage.login(); + page.clickToFuture(); + Assertions.assertTrue(page.isFuturePresent()); + page.clickToFuture(); + loginPage.clickAccUser(); + loginPage.clickExitAccUser(); + } + + @Test + public void testRating() { + context.getDriver().get(APP_URL); + ExSerialPage page = PageFactory.initElements(context.getDriver(), ExSerialPage.class); + LoginPage loginPage = PageFactory.initElements(context.getDriver(), LoginPage.class); + loginPage.login(); + int count = page.getRatingUpNum(); + page.clickRating(); + Assertions.assertTrue(page.getRatingUpNum() >= count ); + loginPage.clickAccUser(); + loginPage.clickExitAccUser(); + } + + @Test + public void testComment() throws InterruptedException { + context.getDriver().get(APP_URL); + ExSerialPage page = PageFactory.initElements(context.getDriver(), ExSerialPage.class); + LoginPage loginPage = PageFactory.initElements(context.getDriver(), LoginPage.class); + loginPage.login(); + page.clickCommentButton(); + page.commentWrite("Отличный фильм!"); + page.clickCommentAdd(); + Thread.sleep(2000); + Assertions.assertTrue(page.isCommentPresent()); + loginPage.clickAccUser(); + loginPage.clickExitAccUser(); + } +} diff --git a/Stroeva/src/test/java/page/AccUserPage.java b/Stroeva/src/test/java/page/AccUserPage.java new file mode 100644 index 0000000..8ec7439 --- /dev/null +++ b/Stroeva/src/test/java/page/AccUserPage.java @@ -0,0 +1,57 @@ +package page; + +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +public class AccUserPage { + WebDriver driver; + @FindBy(xpath = "//*[@id=\"userinfo\"]/div[2]/div[4]/div/div[1]/span[2]/input") + private WebElement email; + + @FindBy(css = ".submit-user") + private WebElement buttonSave; + + @FindBy(xpath = "//a[@href='/like/']") + private WebElement favoritButton; + + @FindBy(css = ".short-film") + private WebElement favoritElement; + + @FindBy(xpath = "//a[@href='/tosee/']") + private WebElement futureButton; + + public AccUserPage(WebDriver driver) { + this.driver = driver; + } + + public void editEmail(String str) { + email.sendKeys(str); + } + + public void clickToButtonSave() { + buttonSave.click(); + } + + public void clickToFavorite() { + favoritButton.click(); + } + + public void clickToFuture() { + futureButton.click(); + } + + public boolean checkEmail(String str){ + if(email.getAttribute("value").equals(str)) + return true; + else return false; + } + + public void clearEmail() { + email.clear(); + } + + public boolean isFavoritePage() { + return favoritElement.isDisplayed(); + } +} diff --git a/Stroeva/src/test/java/page/ExSerialPage.java b/Stroeva/src/test/java/page/ExSerialPage.java new file mode 100644 index 0000000..574b352 --- /dev/null +++ b/Stroeva/src/test/java/page/ExSerialPage.java @@ -0,0 +1,122 @@ +package page; + +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import java.util.List; + +public class ExSerialPage { + WebDriver driver; + + @FindBy(xpath = "//a[@href='http://amovies.cc/russia/']") + private WebElement countrySerialElement; + + @FindBy(xpath = "//a[@href='http://amovies.cc/boeviki_2018/']") + private WebElement genreSerialElement; + + @FindBy(xpath = "//*[@id=\"dle-content\"]/article/span/div[1]/div[1]/div[4]/div/div[1]/div[2]/a[1]") + private WebElement genreAnySerialElement; + + @FindBy(xpath = "//*[@id=\"dle-content\"]/article/span/div[1]/div[1]/div[4]/div/div[1]/div[2]") + private List genreListElement; + + @FindBy(id = "film-favorite") + private WebElement toFavorites; + + @FindBy(id = "film-future") + private WebElement toFuture; + + @FindBy(css = "#film-favorite.in") + private WebElement toFavoritesIn; + + @FindBy(css = "#film-future.in") + private WebElement toFutureIn; + + @FindBy(id = "rating-btn") + private WebElement rating; + + @FindBy(id = "rating-up") + private WebElement ratingUp; + + @FindBy(css = ".write-comm") + private WebElement commentButton; + + @FindBy(id = "comments") + private WebElement commentWrite; + + @FindBy(css = ".fbutton") + private WebElement commentAdd; + + @FindBy(xpath = "//a[@href='http://amovies.cc/user/test2018/']") + private WebElement checkComment; + + public ExSerialPage(WebDriver driver) { + this.driver = driver; + } + + public void clickGenre() { + genreAnySerialElement.click(); + } + + public String getGenre() { + return genreAnySerialElement.getText(); + } + + public boolean checkGenre(String genre) { + for (WebElement el: + genreListElement) { + if(el.getText().contains(genre)) + return true; + } + return false; + } + + public void clickToFavorite() { + toFavorites.click(); + } + + public void clickToFuture() { + toFuture.click(); + } + + public void clickRating() { + rating.click(); + } + + public int getRatingUpNum() { + return Integer.parseInt(ratingUp.getText()); + } + + public void clickCommentButton() { + commentButton.click(); + } + + public void commentWrite(String str) { + commentWrite.sendKeys(str); + } + + public void clickCommentAdd() { + commentAdd.click(); + } + + public boolean isCountryPresent() { + return countrySerialElement.isDisplayed(); + } + + public boolean isGenrePresent() { + return genreSerialElement.isDisplayed(); + } + + public boolean isFavoritePresent() { + return toFavoritesIn.isDisplayed(); + } + + public boolean isFuturePresent() { + return toFutureIn.isDisplayed(); + } + + public boolean isCommentPresent() { + return checkComment.isDisplayed(); + } +} diff --git a/Stroeva/src/test/java/page/HolderPage.java b/Stroeva/src/test/java/page/HolderPage.java index e2b5d51..258bf94 100644 --- a/Stroeva/src/test/java/page/HolderPage.java +++ b/Stroeva/src/test/java/page/HolderPage.java @@ -7,7 +7,7 @@ import org.openqa.selenium.support.FindBy; public class HolderPage { WebDriver driver; - @FindBy(css = ".holder") + @FindBy(css = ".box-text") private WebElement holderElement; public HolderPage(WebDriver driver) { diff --git a/Stroeva/src/test/java/page/LoginPage.java b/Stroeva/src/test/java/page/LoginPage.java new file mode 100644 index 0000000..5c281ff --- /dev/null +++ b/Stroeva/src/test/java/page/LoginPage.java @@ -0,0 +1,82 @@ +package page; + +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import java.util.List; + +public class LoginPage { + WebDriver driver; + + @FindBy(css = ".login") + private WebElement signIn; + + @FindBy(id = "login_name") + private WebElement login; + + @FindBy(id = "login_password") + private WebElement pass; + + @FindBy(css = ".login-button") + private WebElement buttonLogin; + + @FindBy(css = ".user") + private WebElement user; + + @FindBy(css = ".ulogin-button-vkontakte") + private WebElement vkButton; + + @FindBy(xpath = "//a[@href='/index.php?action=logout']") + private WebElement exitButton; + + @FindBy(css = ".fa.fa-times.overlay-close") + private WebElement closeFormButton; + + public LoginPage(WebDriver driver) { + this.driver = driver; + } + + public void clickSignIn() { + signIn.click(); + } + + public void insertLogin(String str) { + login.sendKeys(str); + } + + public void insertPass(String str) { + pass.sendKeys(str); + } + + public void clickToButtonLogin() { + buttonLogin.click(); + } + + public void login(){ + clickSignIn(); + insertLogin("test2018"); + insertPass("q1w2e3r4t5"); + clickToButtonLogin(); + } + + public void clickAccUser() { + user.click(); + } + + public void clickExitAccUser() { + exitButton.click(); + } + + public void clickToCloseFormButton() { + closeFormButton.click(); + } + + public boolean isUserPresent() { + return user.isDisplayed(); + } + + public void clickVkButton() { + vkButton.click(); + } +} diff --git a/Stroeva/src/test/java/page/FilterPage.java b/Stroeva/src/test/java/page/NavFilterPage.java similarity index 82% rename from Stroeva/src/test/java/page/FilterPage.java rename to Stroeva/src/test/java/page/NavFilterPage.java index e1bea9b..50d5ab1 100644 --- a/Stroeva/src/test/java/page/FilterPage.java +++ b/Stroeva/src/test/java/page/NavFilterPage.java @@ -4,13 +4,13 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; -public class FilterPage { +public class NavFilterPage { WebDriver driver; @FindBy(id = "dle-content") private WebElement ratingElement; - public FilterPage(WebDriver driver) { + public NavFilterPage(WebDriver driver) { this.driver = driver; } diff --git a/Stroeva/src/test/java/page/SearchPage.java b/Stroeva/src/test/java/page/SearchPage.java new file mode 100644 index 0000000..81989c0 --- /dev/null +++ b/Stroeva/src/test/java/page/SearchPage.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 SearchPage { + WebDriver driver; + + @FindBy(css = ".res-search") + private WebElement searchElement; + + public SearchPage(WebDriver driver) { + this.driver = driver; + } + + public boolean isUserPresent() { + return searchElement.isDisplayed(); + } +} diff --git a/Stroeva/src/test/java/page/SerialPage.java b/Stroeva/src/test/java/page/SerialPage.java new file mode 100644 index 0000000..3f6d82e --- /dev/null +++ b/Stroeva/src/test/java/page/SerialPage.java @@ -0,0 +1,61 @@ +package page; + +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 SerialPage { + WebDriver driver; + + @FindBy(id = "show-search") + private WebElement searchButton; + + @FindBy(id = "story") + private WebElement searchText; + + @FindBy(xpath = "/html/body/div[1]/div[2]/div[3]/div[1]/div[2]/div/div/div[2]/button[2]") + private WebElement countryList; + + @FindBy(css = "#dle-content .short-film") + private WebElement serialElement; + + @FindBy(xpath = "/html/body/div[1]/div[2]/div[3]/div[2]/div[2]/div/div/div[2]/button[3]") + private WebElement genreList; + + public SerialPage(WebDriver driver) { + this.driver = driver; + } + + public void clickSearchButton() { + searchButton.click(); + } + + public void insertSearchText(String str) { + searchText.sendKeys(str); + } + + public void insertEnterSearchText() { + searchText.sendKeys(Keys.ENTER); + } + + public void clickCountry() { + countryList.click(); + } + + public void clickSerial() { + serialElement.click(); + } + + public void clickGenre() { + genreList.click(); + } + + + +// public boolean isUserPresent() { +// return holderElement.isDisplayed(); +// } +} diff --git a/Stroeva/src/test/java/page/VKPage.java b/Stroeva/src/test/java/page/VKPage.java new file mode 100644 index 0000000..6570988 --- /dev/null +++ b/Stroeva/src/test/java/page/VKPage.java @@ -0,0 +1,34 @@ +package page; + +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +public class VKPage { + WebDriver driver; + + @FindBy(id = "login_submit") + private WebElement element; + + public VKPage(WebDriver driver) { + this.driver = driver; + } + + public boolean isUserPresent() { + return element.isDisplayed(); + } + + public void switchToSocial(){ + for (String winHandle : driver.getWindowHandles()) { + driver.switchTo().window(winHandle); + } + } + + public void switchToOld(String str){ + driver.switchTo().window(str); + } + + public void closeSocial(){ + driver.close(); + } +}