package org.opennms.smoketest;

import java.net.URL;

import org.junit.After;
import org.junit.Before;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

import com.thoughtworks.selenium.SeleneseTestBase;

public class OpenNMSSeleniumTestCase extends SeleneseTestBase {

    @Before
    public void setUp() throws Exception {
        DesiredCapabilities capability = DesiredCapabilities.firefox();
        WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);
//      WebDriver driver = new FirefoxDriver();

        String baseUrl = "http://localhost:8980/";
        selenium = new WebDriverBackedSelenium(driver, baseUrl);
        selenium.open("/opennms/login.jsp");
        selenium.type("name=j_username", "admin");
        selenium.type("name=j_password", "admin");
        selenium.click("name=Login");
        selenium.waitForPageToLoad("30000");
        selenium.click("link=admin");
        selenium.waitForPageToLoad("30000");
    }

    @After
    public void tearDown() throws Exception {
        selenium.stop();
    }

}

@@ -29,30 +29,8 @@
 t;%0A%0A
-import java.net.URL;%0A%0A
 impo
@@ -45,24 +45,24 @@
 unit.After;%0A
+
 import org.j
@@ -217,114 +217,8 @@
 ver;
-%0Aimport org.openqa.selenium.remote.DesiredCapabilities;%0Aimport org.openqa.selenium.remote.RemoteWebDriver;
 %0A%0Aim
@@ -379,32 +379,34 @@
 ows Exception %7B%0A
+//
         DesiredC
@@ -457,24 +457,26 @@
 .firefox();%0A
+//
         WebD
@@ -564,18 +564,18 @@
 ility);%0A
-//
+  
       We

switch to the firefox driver