Rukavishnikova #14

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

View File

@ -1,43 +1,35 @@
package ru.oriflame.tests;
import junit.framework.TestCase;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.PageFactory;
import ru.oriflame.context.ChromeContext;
import ru.oriflame.context.Context;
import ru.oriflame.pages.MultiMedia;
import static java.util.concurrent.TimeUnit.SECONDS;
public class MultiMediaTest {
public static WebDriver driver;
public static MultiMedia multiMedia;
private final static String APP_URL = "http://investors.oriflame.com/";
private static Context context;
@BeforeClass
public static void setup() {
System.setProperty("webdriver.chrome.driver", "C:\\chromedriver\\chromedriver.exe");
driver = new ChromeDriver();
multiMedia = new MultiMedia(driver);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(20, SECONDS);
driver.get("http://investors.oriflame.com/");
context = new ChromeContext();
context.start();
}
@AfterClass
public static void quit() {
context.close();
}
@Test
public void checkVideoPlay() {
TestCase.assertTrue("Testing if true holds", true);
context.getDriver().get(APP_URL);
MultiMedia multiMedia = PageFactory.initElements(context.getDriver(), MultiMedia.class);
multiMedia.playVideoElement();
driver.manage().timeouts().implicitlyWait(15, SECONDS);
multiMedia.closeButton();
String url = driver.getCurrentUrl();
Assert.assertTrue(url.contains("http://investors.oriflame.com"));
}
@AfterClass
public static void closeChrome() {
driver.close();
Assert.assertTrue(multiMedia.assertVideoPlay());
}
}