Search in sources :

Example 36 with RemoteWebDriver

use of org.openqa.selenium.remote.RemoteWebDriver in project flue2ent by DefinityLabs.

the class WebsiteTest method javaScript_returnsJavaScriptPlugin.

@Test
public void javaScript_returnsJavaScriptPlugin() {
    RemoteWebDriver mockedWebDriver = mock(RemoteWebDriver.class);
    Website website = Website.with(mockedWebDriver).visit(TEST_WEBSITE_URL);
    JavaScriptPlugin javaScriptPlugin = website.javaScript();
    assertThat(javaScriptPlugin).isNotNull();
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) Test(org.junit.Test)

Example 37 with RemoteWebDriver

use of org.openqa.selenium.remote.RemoteWebDriver in project flue2ent by DefinityLabs.

the class WebsiteTest method scroll_returnsScrollPlugin.

@Test
public void scroll_returnsScrollPlugin() {
    RemoteWebDriver mockedWebDriver = mock(RemoteWebDriver.class);
    Website website = Website.with(mockedWebDriver).visit(TEST_WEBSITE_URL);
    ScrollPlugin scrollPlugin = website.scroll();
    assertThat(scrollPlugin).isNotNull();
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) Test(org.junit.Test)

Example 38 with RemoteWebDriver

use of org.openqa.selenium.remote.RemoteWebDriver in project flue2ent by DefinityLabs.

the class WebsiteTest method screenshot_returnsScreenshotPlugin.

@Test
public void screenshot_returnsScreenshotPlugin() {
    RemoteWebDriver mockedWebDriver = mock(RemoteWebDriver.class);
    Website website = Website.with(mockedWebDriver).visit(TEST_WEBSITE_URL);
    ScreenshotPlugin screenshotPlugin = website.screenshot();
    assertThat(screenshotPlugin).isNotNull();
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) Test(org.junit.Test)

Example 39 with RemoteWebDriver

use of org.openqa.selenium.remote.RemoteWebDriver in project flue2ent by DefinityLabs.

the class WebsiteTest method page_returnsPagePlugin.

@Test
public void page_returnsPagePlugin() {
    RemoteWebDriver mockedWebDriver = mock(RemoteWebDriver.class);
    Website website = Website.with(mockedWebDriver).visit(TEST_WEBSITE_URL);
    PagePlugin pagePlugin = website.page();
    assertThat(pagePlugin).isNotNull();
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) Test(org.junit.Test)

Example 40 with RemoteWebDriver

use of org.openqa.selenium.remote.RemoteWebDriver in project flue2ent by DefinityLabs.

the class JavaScriptPluginTest method execute_callsExecuteScript.

@Test
public void execute_callsExecuteScript() {
    RemoteWebDriver mockedDriver = mock(RemoteWebDriver.class);
    Object response = new Object();
    when(mockedDriver.executeScript(anyString(), anyString())).thenReturn(response);
    JavaScriptPlugin javaScriptPlugin = new JavaScriptPlugin(mockedDriver);
    String script = "js script";
    Object result = javaScriptPlugin.execute(script, "paramOne");
    verify(mockedDriver).executeScript(script, "paramOne");
    assertThat(result).isSameAs(response);
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.junit.Test)

Aggregations

RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)101 URL (java.net.URL)39 Test (org.junit.Test)36 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)29 File (java.io.File)16 WebDriver (org.openqa.selenium.WebDriver)14 MalformedURLException (java.net.MalformedURLException)13 ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)13 ChromeOptions (org.openqa.selenium.chrome.ChromeOptions)12 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)12 IOException (java.io.IOException)11 Dimension (org.openqa.selenium.Dimension)9 InternetExplorerDriver (org.openqa.selenium.ie.InternetExplorerDriver)7 PhantomJSDriver (org.openqa.selenium.phantomjs.PhantomJSDriver)7 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)7 FirefoxProfile (org.openqa.selenium.firefox.FirefoxProfile)6 EventFiringWebDriver (org.openqa.selenium.support.events.EventFiringWebDriver)6 ArrayList (java.util.ArrayList)5 HashMap (java.util.HashMap)5 Before (org.junit.Before)5