From 065d590693cb8610fa45b1c83be6fdb79911d44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=BA=D0=B0=D1=82=D0=B5=D1=80=D0=B8=D0=BD=D0=B0?= Date: Sat, 8 Dec 2018 20:41:23 +0000 Subject: [PATCH] Update AnotherLinks.java --- .../java/ru/oriflame/pages/AnotherLinks.java | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/Rukavishnikova/src/test/java/ru/oriflame/pages/AnotherLinks.java b/Rukavishnikova/src/test/java/ru/oriflame/pages/AnotherLinks.java index 6bc6f04..5c75c73 100644 --- a/Rukavishnikova/src/test/java/ru/oriflame/pages/AnotherLinks.java +++ b/Rukavishnikova/src/test/java/ru/oriflame/pages/AnotherLinks.java @@ -1,20 +1,19 @@ package ru.oriflame.pages; +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.PageFactory; public class AnotherLinks { public WebDriver driver; public AnotherLinks(WebDriver driver) { - PageFactory.initElements(driver, this); this.driver = driver; } @FindBy(className = "shipping-info-link") - private WebElement delivery; + private WebElement form; @FindBy(linkText = "Контакты Сервисных Центров Орифлэйм") private WebElement contactsServicesCenters; @@ -22,15 +21,31 @@ public class AnotherLinks { @FindBy(css = "nav.w-grid > div:nth-child(1) > div:nth-child(1) > a:nth-child(1)") private WebElement oriLogo; - public void deliveryClicking () { - delivery.click(); - } + public void formClicking () { form.click(); } public void clickingContactsServicesCenters() { contactsServicesCenters.click(); } - public void clickingOrifalemLogo() { - oriLogo.click(); + public void clickingOrifalemLogo() { oriLogo.click(); } + + public boolean assertMainMenu() { return driver.findElement(By.cssSelector("#main > div")).isDisplayed(); } + + public boolean assertContactsServicesCenters() { + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + return driver.findElement(By.cssSelector("body > div.w-grid")).isDisplayed(); + } + + public boolean assertFormClick() { + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + return driver.findElement(By.cssSelector("#pdp-shipping-popup")).isDisplayed(); } }