Search in sources :

Example 46 with RemoteWebDriver

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

the class ScrollPluginTest method down_executesJavascript.

@Test
public void down_executesJavascript() {
    RemoteWebDriver mockedDriver = mock(RemoteWebDriver.class);
    ScrollPlugin scrollPlugin = new ScrollPlugin(mockedDriver);
    ScrollPlugin result = scrollPlugin.down();
    verify(mockedDriver).executeScript("window.scrollBy(0, 250);");
    assertThat(result).isSameAs(scrollPlugin);
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) Test(org.junit.Test)

Example 47 with RemoteWebDriver

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

the class ScrollPluginTest method top_executesJavascript.

@Test
public void top_executesJavascript() {
    RemoteWebDriver mockedDriver = mock(RemoteWebDriver.class);
    ScrollPlugin scrollPlugin = new ScrollPlugin(mockedDriver);
    ScrollPlugin result = scrollPlugin.top();
    verify(mockedDriver).executeScript("window.scrollTo(0, 0);");
    assertThat(result).isSameAs(scrollPlugin);
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) Test(org.junit.Test)

Example 48 with RemoteWebDriver

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

the class ScrollPluginTest method by_executesJavascript.

@Test
public void by_executesJavascript() {
    RemoteWebDriver mockedDriver = mock(RemoteWebDriver.class);
    ScrollPlugin scrollPlugin = new ScrollPlugin(mockedDriver);
    ScrollPlugin result = scrollPlugin.by(10, 20);
    verify(mockedDriver).executeScript("window.scrollBy(10, 20);");
    assertThat(result).isSameAs(scrollPlugin);
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) Test(org.junit.Test)

Example 49 with RemoteWebDriver

use of org.openqa.selenium.remote.RemoteWebDriver in project vorto by eclipse.

the class BasicRepositoryUITest method testCopyrightFooter.

/**
 * Tests if the copyright footer is there.
 */
@Test
public void testCopyrightFooter() {
    RemoteWebDriver webDriver = this.seleniumVortoHelper.getRemoteWebDriver();
    this.seleniumVortoHelper.allowCookies();
    WebElement copyrightFooter = webDriver.findElementByXPath("//li[@class='copyright']");
    Assert.assertTrue(copyrightFooter.isDisplayed());
    String copyrightText = copyrightFooter.getText();
    Assert.assertTrue("Text was: " + copyrightText, copyrightText.contains("Revision:"));
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) WebElement(org.openqa.selenium.WebElement) Test(org.junit.Test)

Example 50 with RemoteWebDriver

use of org.openqa.selenium.remote.RemoteWebDriver in project vorto by eclipse.

the class BasicRepositoryUITest method testLoginButton.

/**
 * Test if the login button is there and can be clicked.
 */
@Test
public void testLoginButton() {
    final RemoteWebDriver webDriver = this.seleniumVortoHelper.getRemoteWebDriver();
    webDriver.get(rootUrl);
    webDriver.findElementByLinkText("Login").click();
    webDriver.findElementsByXPath("//a[@href='github/login']");
    webDriver.findElementsByXPath("//a[@href='eidp/login']");
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) 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