1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.mainmenu.test;
17
18 import edu.samplu.common.UpgradedSeleniumITBase;
19 import org.junit.Test;
20 import org.junit.Assert;
21
22
23
24
25
26
27 public class CreateNewAgendaIT extends UpgradedSeleniumITBase {
28 @Override
29 public String getTestUrl() {
30 return PORTAL;
31 }
32
33 @Test
34 public void testCreateNewAgenda() throws Exception {
35 selenium.click("link=Create New Agenda");
36 selenium.waitForPageToLoad("30000");
37 selenium.selectFrame("iframeportlet");
38 selenium.select("name=document.newMaintainableObject.dataObject.namespace", "label=Kuali Rules Test");
39 selenium.type("name=document.newMaintainableObject.dataObject.agenda.name", "Agenda Name 1");
40 selenium.click("id=u244");
41 Thread.sleep(2000);
42 selenium.selectFrame("relative=up");
43 for (int second = 0;; second++) {
44 if (second >= 60)
45 Assert.fail("timeout");
46 try {
47 if (selenium.isElementPresent("id=fancybox-frame"))
48 break;
49 } catch (Exception e) {}
50 Thread.sleep(1000);
51 }
52
53 selenium.selectFrame("fancybox-frame");
54 for (int second = 0;; second++) {
55 if (second >= 60)
56 Assert.fail("timeout");
57 try {
58 if (selenium.isElementPresent("id=u80"))
59 break;
60 } catch (Exception e) {}
61 Thread.sleep(1000);
62 }
63
64 selenium.click("id=u80");
65 selenium.waitForPageToLoad("30000");
66 selenium.click("link=return value");
67 Thread.sleep(2000);
68 selenium.waitForPopUp("iframeportlet", "30000");
69 for (int second = 0;; second++) {
70 if (second >= 60)
71 Assert.fail("timeout");
72 try {
73 if (selenium.isElementPresent("id=u260_attribute"))
74 break;
75 } catch (Exception e) {}
76 Thread.sleep(1000);
77 }
78
79 selenium.select("id=u260_attribute", "label=Campus Agenda");
80 Thread.sleep(2000);
81 selenium.click("id=u588");
82 selenium.selectFrame("relative=up");
83 for (int second = 0;; second++) {
84 if (second >= 60)
85 Assert.fail("timeout");
86 try {
87 if (selenium.isElementPresent("id=fancybox-frame"))
88 break;
89 } catch (Exception e) {}
90 Thread.sleep(1000);
91 }
92
93 selenium.selectFrame("id=fancybox-frame");
94 for (int second = 0;; second++) {
95 if (second >= 60)
96 Assert.fail("timeout");
97 try {
98 if (selenium.isElementPresent("id=u80"))
99 break;
100 } catch (Exception e) {}
101 Thread.sleep(1000);
102 }
103
104 selenium.click("id=u80");
105 selenium.waitForPageToLoad("30000");
106 selenium.click("link=return value");
107 Thread.sleep(2000);
108 selenium.waitForPopUp("iframeportlet", "30000");
109 for (int second = 0;; second++) {
110 if (second >= 60)
111 Assert.fail("timeout");
112 try {
113 if (selenium.isElementPresent("id=u135"))
114 break;
115 } catch (Exception e) {}
116 Thread.sleep(1000);
117 }
118
119 selenium.click("id=u135");
120 selenium.click("id=u156");
121 selenium.waitForPageToLoad("30000");
122 selenium.selectWindow("null");
123 selenium.click("xpath=(//input[@name='imageField'])[2]");
124 selenium.waitForPageToLoad("30000");
125 }
126 }