/*******************************************************************************
 * This file is part of OpenNMS(R).
 *
 * Copyright (C) 2011-2014 The OpenNMS Group, Inc.
 * OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
 *
 * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
 *
 * OpenNMS(R) is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License,
 * or (at your option) any later version.
 *
 * OpenNMS(R) is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with OpenNMS(R).  If not, see:
 *      http://www.gnu.org/licenses/
 *
 * For more information contact:
 *     OpenNMS(R) Licensing <license@opennms.org>
 *     http://www.opennms.org/
 *     http://www.opennms.com/
 *******************************************************************************/

package org.opennms.smoketest;

import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class DistributedMapTest extends OpenNMSSeleniumTestCase {
    @Before
    public void setUp() throws Exception {
        super.setUp();
        clickAndWait("//a[@href='maps.htm']");
        clickAndWait("//div[@id='content']//a[contains(@href,'RemotePollerMap')]");
    }

    @Test
    public void a_testDistributedMap() throws Exception {
        assertEquals("Applications", selenium.getTable("css=td > table.0.2"));
        assertEquals("off", selenium.getValue("id=gwt-uid-6"));
        assertEquals("on", selenium.getValue("id=gwt-uid-1"));
    }

}

@@ -1352,16 +1352,47 @@
 Sorters;
+%0Aimport org.openqa.selenium.By;
 %0A%0A@FixMe
@@ -1587,109 +1587,41 @@
     
-clickAndWait(%22//a%5B@href='maps.htm'%5D%22);%0A        clickAndWait(%22//div%5B@id='content'%5D//a%5Bcontains(@href,'
+m_driver.get(BASE_URL + %22opennms/
 Remo
@@ -1635,11 +1635,18 @@
 rMap
-')%5D
+/index.jsp
 %22);%0A
@@ -1682,10 +1682,8 @@
 oid 
-a_
 test
@@ -1730,143 +1730,231 @@
     
-assertEquals(%22Applications%22, selenium.getTable(%22css=td %3E table.0.2%22));%0A        assertEquals(%22off%22, selenium.getValue(%22id=gwt-uid-6%22
+// first 5 checkboxes are checked by default%0A        for (int i=1; i %3C= 5; i++) %7B%0A            assertTrue(%22checkbox gwt-uid-%22 + i + %22 should be checked.%22, m_driver.findElement(By.id(%22gwt-uid-%22 + i)).isSelected(
 ));%0A
+        %7D%0A
     
@@ -1967,53 +1967,109 @@
 sert
-Equ
+F
 als
+e
 (%22
-on%22, selenium.getValue(%22id=gwt-uid-1%22
+checkbox gwt-uid-6 should be unchecked.%22, m_driver.findElement(By.id(%22gwt-uid-6%22)).isSelected(
 ));%0A

update to webdriver