Rukavishnikova #14
@ -1,43 +1,35 @@
|
|||||||
package ru.oriflame.tests;
|
package ru.oriflame.tests;
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.openqa.selenium.WebDriver;
|
import org.openqa.selenium.support.PageFactory;
|
||||||
import org.openqa.selenium.chrome.ChromeDriver;
|
import ru.oriflame.context.ChromeContext;
|
||||||
|
import ru.oriflame.context.Context;
|
||||||
import ru.oriflame.pages.MultiMedia;
|
import ru.oriflame.pages.MultiMedia;
|
||||||
|
|
||||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
|
||||||
|
|
||||||
public class MultiMediaTest {
|
public class MultiMediaTest {
|
||||||
|
|
||||||
public static WebDriver driver;
|
private final static String APP_URL = "http://investors.oriflame.com/";
|
||||||
public static MultiMedia multiMedia;
|
private static Context context;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setup() {
|
public static void setup() {
|
||||||
System.setProperty("webdriver.chrome.driver", "C:\\chromedriver\\chromedriver.exe");
|
context = new ChromeContext();
|
||||||
driver = new ChromeDriver();
|
context.start();
|
||||||
multiMedia = new MultiMedia(driver);
|
}
|
||||||
driver.manage().window().maximize();
|
|
||||||
driver.manage().timeouts().implicitlyWait(20, SECONDS);
|
@AfterClass
|
||||||
driver.get("http://investors.oriflame.com/");
|
public static void quit() {
|
||||||
|
context.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void checkVideoPlay() {
|
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();
|
multiMedia.playVideoElement();
|
||||||
driver.manage().timeouts().implicitlyWait(15, SECONDS);
|
Assert.assertTrue(multiMedia.assertVideoPlay());
|
||||||
multiMedia.closeButton();
|
|
||||||
String url = driver.getCurrentUrl();
|
|
||||||
Assert.assertTrue(url.contains("http://investors.oriflame.com"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@AfterClass
|
|
||||||
public static void closeChrome() {
|
|
||||||
driver.close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user