Rukavishnikova #14

Closed
kotenok-339 wants to merge 17 commits from Rukavishnikova into master
Showing only changes of commit 065d590693 - Show all commits

View File

@ -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();
}
}