1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.library.clientresponsiveness;
17
18 import org.junit.Test;
19
20 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21
22
23
24
25 public class LibraryClientResponsivenessEnterKeySupportAft extends WebDriverLegacyITBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-EnterKeySupport";
31
32 @Override
33 protected String getBookmarkUrl() {
34 return BOOKMARK_URL;
35 }
36
37 @Override
38 protected void navigate() throws Exception {
39 waitAndClickLibraryLink();
40 waitAndClickByLinkText("Client Responsiveness");
41 waitAndClickByLinkText("Enter Key Support");
42 }
43
44 protected void testClientResponsivenessEnterKeySupportDefaultViewKey() throws Exception {
45 waitAndClickByXpath("//section[@id='Demo-EnterKeySupport-Example1']/a");
46 switchToWindow("Kuali Default View Key");
47 pressEnterByName("field1");
48 acceptAlertIfPresent();
49 switchToWindow("Kuali");
50 }
51
52 protected void testClientResponsivenessEnterKeySupportDefaultPageKey() throws Exception {
53 waitAndClickByXpath("//a[@id='Demo-EnterKeySupport-Example2_tab']");
54 waitAndClickByXpath("//section[@id='Demo-EnterKeySupport-Example2']/a");
55 switchToWindow("Kuali Default Page Key");
56 pressEnterByName("field1");
57 acceptAlertIfPresent();
58 waitAndClickByXpath("//a[@name='Demo-EnterKeySupport-Example2-Page2']");
59 pressEnterByName("field2");
60 acceptAlertIfPresent();
61 switchToWindow("Kuali");
62 }
63
64 protected void testClientResponsivenessEnterKeySupportDefaultGroupKey() throws Exception {
65 waitAndClickByXpath("//a[@id='Demo-EnterKeySupport-Example3_tab']");
66 pressEnterByName("inputField1");
67 acceptAlertIfPresent();
68 pressEnterByName("inputField2");
69 acceptAlertIfPresent();
70 pressEnterByName("inputField3");
71 acceptAlertIfPresent();
72 }
73
74 protected void testClientResponsivenessEnterKeySupportCollectionLineEnterKey() throws Exception {
75 waitAndClickByXpath("//a[@id='Demo-EnterKeySupport-Example4_tab']");
76 pressEnterByXpath("//tbody[@role='alert']/tr/td/div/input");
77 waitForTextPresent("Adding Line...");
78 }
79
80 @Test
81 public void testClientResponsivenessEnterKeySupportBookmark() throws Exception {
82 testClientResponsivenessEnterKeySupportAll();
83 }
84
85 @Test
86 public void testClientResponsivenessEnterKeySupportNav() throws Exception {
87 testClientResponsivenessEnterKeySupportAll();
88 }
89
90 private void testClientResponsivenessEnterKeySupportAll() throws Exception {
91 testClientResponsivenessEnterKeySupportDefaultViewKey();
92 testClientResponsivenessEnterKeySupportDefaultPageKey();
93 testClientResponsivenessEnterKeySupportDefaultGroupKey();
94 testClientResponsivenessEnterKeySupportCollectionLineEnterKey();
95 passed();
96 }
97 }