/**
 * Copyright 2005-2015 The Kuali Foundation
 *
 * Licensed under the Educational Community License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.opensource.org/licenses/ecl2.php
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kuali.rice.krad.labs;

import org.junit.Test;
import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;

/**
 * @author Kuali Rice Team (rice.collab@kuali.org)
 */
public class LabsEnterKeySupportTables2Aft extends WebDriverLegacyITBase {

    /**
     * /kr-krad/labs?viewId=Lab-LayoutTest-EnterKeyTables2
     */
    public static final String BOOKMARK_URL = "/kr-krad/labs?viewId=Lab-LayoutTest-EnterKeyTables2";
   
    @Override
    protected String getBookmarkUrl() {
        return BOOKMARK_URL;
    }

    @Override
    protected void navigate() throws Exception {
    	waitAndClickByLinkText("Enter Key Support - Tables 2");
    }

    protected void testDemoEnterKeySupportTables2() throws InterruptedException {
    	waitAndTypeByXpath("//table/tbody/tr/td[2]/div/input","1");
    	waitAndTypeByXpath("//table/tbody/tr/td[3]/div/input","1");
    	pressEnterByXpath("//table/tbody/tr/td[3]/div/input");
    	pressEnterByXpath("//table/tbody/tr[2]/td[3]/div/input");
    	acceptAlert();
    }

    @Test
    public void testDemoEnterKeySupportTables2Bookmark() throws Exception {
    	testDemoEnterKeySupportTables2();
        passed();
    }

    @Test
    public void testDemoEnterKeySupportTables2Nav() throws Exception {
    	testDemoEnterKeySupportTables2();
        passed();
    }
}

@@ -736,16 +736,47 @@
 yITBase;
+%0Aimport org.openqa.selenium.By;
 %0A%0A/**%0A *
@@ -1387,25 +1387,470 @@
 ption %7B%0A    
-%09
+    //verify the result of the first result row%0A        String value1 = waitAndGetAttributeByXpath(%22//table/tbody/tr%5B2%5D/td%5B2%5D/div/input%22, %22value%22);%0A        String value2 = waitAndGetAttributeByXpath(%22//table/tbody/tr%5B2%5D/td%5B3%5D/div/input%22, %22value%22);%0A        jGrowl(%22got first row values %22+value1+%22 %22+value2);%0A        assertFalse(value1.equals(%221%22));%0A        assertFalse(value2.equals(%221%22));%0A%0A        //fill in values and send the enter key%0A        
 waitAndTypeB
@@ -1869,24 +1869,27 @@
 ble/tbody/tr
+%5B1%5D
 /td%5B2%5D/div/i
@@ -1886,32 +1886,33 @@
 d%5B2%5D/div/input%22,
+ 
 %221%22);%0A    %09waitA
@@ -1901,25 +1901,28 @@
 , %221%22);%0A    
-%09
+    
 waitAndTypeB
@@ -1937,32 +1937,35 @@
 //table/tbody/tr
+%5B1%5D
 /td%5B3%5D/div/input
@@ -1968,33 +1968,36 @@
 nput%22,%221%22);%0A    
-%09
+    
 pressEnterByXpat
@@ -2015,16 +2015,19 @@
 tbody/tr
+%5B1%5D
 /td%5B3%5D/d
@@ -2038,21 +2038,540 @@
 nput%22);%0A
+%0A
     
-%09
+    //wait for first result row%0A        waitForElementVisibleBy(By.xpath(%22//table/tbody/tr%5B2%5D/td%5B3%5D/div/input%22),%221%22);%0A%0A        //verify the result of the first result row%0A        String value3 = waitAndGetAttributeByXpath(%22//table/tbody/tr%5B2%5D/td%5B2%5D/div/input%22, %22value%22);%0A        String value4 = waitAndGetAttributeByXpath(%22//table/tbody/tr%5B2%5D/td%5B3%5D/div/input%22, %22value%22);%0A        jGrowl(%22got first row values %22+value3+%22 %22+value4);%0A        assertTrue(value3.equals(%221%22));%0A        assertTrue(value4.equals(%221%22));%0A%0A        
 pressEnt
@@ -2624,17 +2624,20 @@
 %22);%0A    
-%09
+    
 acceptAl

Fix for AFT Failure