1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs;
17
18 import org.junit.Test;
19 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20 import org.openqa.selenium.By;
21
22
23
24
25 public class LabsEnterKeySupportTables2Aft extends WebDriverLegacyITBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/labs?viewId=Lab-LayoutTest-EnterKeyTables2";
31
32 @Override
33 protected String getBookmarkUrl() {
34 return BOOKMARK_URL;
35 }
36
37 @Override
38 protected void navigate() throws Exception {
39 waitAndClickByLinkText("Enter Key Support - Tables 2");
40 }
41
42 protected void testDemoEnterKeySupportTables2() throws InterruptedException {
43
44 String value1 = waitAndGetAttributeByXpath("//table/tbody/tr[2]/td[2]/div/input", "value");
45 String value2 = waitAndGetAttributeByXpath("//table/tbody/tr[2]/td[3]/div/input", "value");
46 jGrowl("got first row values "+value1+" "+value2);
47 assertFalse(value1.equals("1"));
48 assertFalse(value2.equals("1"));
49
50
51 waitAndTypeByXpath("//table/tbody/tr[1]/td[2]/div/input", "1");
52 waitAndTypeByXpath("//table/tbody/tr[1]/td[3]/div/input","1");
53 pressEnterByXpath("//table/tbody/tr[1]/td[3]/div/input");
54
55
56 waitForElementVisibleBy(By.xpath("//table/tbody/tr[2]/td[3]/div/input"),"1");
57
58
59 String value3 = waitAndGetAttributeByXpath("//table/tbody/tr[2]/td[2]/div/input", "value");
60 String value4 = waitAndGetAttributeByXpath("//table/tbody/tr[2]/td[3]/div/input", "value");
61 jGrowl("got first row values "+value3+" "+value4);
62 assertTrue(value3.equals("1"));
63 assertTrue(value4.equals("1"));
64
65 pressEnterByXpath("//table/tbody/tr[2]/td[3]/div/input");
66 acceptAlert();
67 }
68
69 @Test
70 public void testDemoEnterKeySupportTables2Bookmark() throws Exception {
71 testDemoEnterKeySupportTables2();
72 passed();
73 }
74
75 @Test
76 public void testDemoEnterKeySupportTables2Nav() throws Exception {
77 testDemoEnterKeySupportTables2();
78 passed();
79 }
80 }