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
26 public class LabsPerformanceMediumAft extends WebDriverLegacyITBase {
27
28
29
30
31 public static final String BOOKMARK_URL = "/kr-krad/labs?viewId=Lab-PerformanceMedium";
32
33
34
35
36 public static final String BOOKMARK_URL_2 = "/kr-krad/labs?viewId=Lab-PerformanceMedium&pageId=Lab-Performance-Page1#Lab-Performance-Page2&methodToCall=start";
37
38 @Override
39 protected String getBookmarkUrl() {
40 return BOOKMARK_URL;
41 }
42
43 @Override
44 protected void navigate() throws Exception {
45 waitAndClickByLinkText("Performance Medium");
46 }
47
48 @Test
49 public void testPerformanceMediumBookmark() throws Exception {
50 testPerformanceMedium();
51 navigateToSecondPage();
52
53 passed();
54 }
55
56 @Test
57 public void testPerformanceMediumNav() throws Exception {
58 testPerformanceMedium();
59 navigateToSecondPage();
60 passed();
61 }
62
63 private void navigateToSecondPage() throws InterruptedException {
64 waitAndClickByLinkText("Page 2");
65 alertAccept();
66 waitForBottomButton();
67 }
68
69 private void waitForBottomButton() throws InterruptedException {
70 jiraAwareWaitFor(By.xpath("//button[contains(text(), 'Refresh - Non-Ajax')]"),11,"Timeout 11s - Button Not Present");
71 }
72
73 protected void testPerformanceMedium()throws Exception {
74 waitForBottomButton();
75 selectByName("inputField6","Option 2");
76 selectByName("inputField7","Option 2");
77 assertElementPresentByXpath("//select[@name='inputField8' and @disabled]");
78 assertElementPresentByXpath("//button[contains(text(),'Add')]");
79 assertElementPresentByXpath("//button[contains(text(),'Delete')]");
80 assertTextPresent("null ( ab extra )");
81 assertElementPresentByXpath("//input[@name='mediumCollection2[0].field1' and @value='ab extra']");
82 assertTextPresent("SubCollection 1");
83 }
84 }