1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package edu.samplu.krad.compview;
18
19 import com.thoughtworks.selenium.DefaultSelenium;
20 import org.junit.After;
21 import org.junit.Before;
22 import org.junit.Test;
23
24 import static junit.framework.Assert.assertTrue;
25 import static org.junit.Assert.assertEquals;
26 import static org.junit.Assert.assertNotSame;
27 import static org.junit.Assert.fail;
28
29
30
31
32
33
34
35
36 public class ParentLineIT {
37 private DefaultSelenium selenium;
38
39 @Before
40 public void setUp() throws Exception {
41 selenium = new DefaultSelenium("localhost", 4444, "*chrome", System.getProperty("remote.public.url"));
42 selenium.start();
43 }
44
45 @Test
46
47
48
49 public void testSubCollectionSize() throws Exception {
50 selenium.open("/kr-dev/portal.do");
51 selenium.type("name=__login_user", "admin");
52 selenium.click("css=input[type=\"submit\"]");
53 selenium.waitForPageToLoad("30000");
54 selenium.click("link=KRAD");
55 selenium.waitForPageToLoad("30000");
56 selenium.click("link=Uif Components (Kitchen Sink)");
57 selenium.waitForPageToLoad("30000");
58 selenium.selectFrame("iframeportlet");
59
60 selenium.click("id=u961");
61
62
63 for (int second = 0;; second++) {
64 if (second >= 60) fail("timeout");
65 try { if (selenium.isElementPresent("id=u1089_line0_line0_control")) break; } catch (Exception e) {}
66 Thread.sleep(1000);
67 }
68
69 assertEquals("SubCollection - (3 lines)", selenium.getText("id=u1030_line0"));
70 assertEquals("SubCollection - (2 lines)", selenium.getText("id=u1030_line1"));
71 }
72
73 @After
74 public void tearDown() throws Exception {
75 selenium.stop();
76 }
77 }