1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package edu.samplu.admin.test;
18
19 import com.thoughtworks.selenium.*;
20 import org.junit.After;
21 import org.junit.Before;
22 import org.junit.Test;
23 import java.util.regex.Pattern;
24
25
26
27
28
29 public class AgendaEditRuleRefreshIT extends SeleneseTestCase {
30 @Before
31 public void setUp() throws Exception {
32 selenium = new DefaultSelenium("localhost", 4444, "*chrome", System.getProperty("remote.public.url"));
33 selenium.start();
34 }
35
36 @Test
37
38
39
40 public void testAgendaEditRuleRefreshIT() throws Exception {
41 selenium.open("/kr-dev/portal.do");
42 selenium.type("name=__login_user", "admin");
43 selenium.click("css=input[type=\"submit\"]");
44 selenium.waitForPageToLoad("30000");
45 selenium.click("link=Agenda Lookup");
46 selenium.waitForPageToLoad("30000");
47 selenium.selectFrame("iframeportlet");
48 selenium.click("id=32");
49 selenium.waitForPageToLoad("30000");
50 selenium.click("id=194_line0");
51 selenium.waitForPageToLoad("30000");
52 selenium.click("//li[@id='473_node_0_parent_root']/a");
53 selenium.click("id=472_node_0_parent_node_0_parent_node_0_parent_root_span");
54 selenium.click("id=361");
55
56
57 for (int i=0; i<6; i++) {
58 for (int second = 0;; second++) {
59 if (second >= 60) fail("timeout");
60 try { if (selenium.isElementPresent("id=440")) break; } catch (Exception e) {}
61 Thread.sleep(1000);
62 }
63
64 selenium.click("id=440");
65 }
66 }
67
68 @After
69 public void tearDown() throws Exception {
70 selenium.stop();
71 }
72 }