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.*;
20  import org.junit.After;
21  import org.junit.Before;
22  import org.junit.Test;
23  import java.util.regex.Pattern;
24  import static org.junit.Assert.assertNotSame;
25  import static org.junit.Assert.fail;
26  
27  
28  
29  
30  
31  
32  public class DeleteSubCollectionLineIT {
33      private DefaultSelenium selenium;
34  
35      @Before
36      public void setUp() throws Exception {
37          selenium = new DefaultSelenium("localhost", 4444, "*chrome",  System.getProperty("remote.public.url"));
38          selenium.start();
39      }
40  
41      @Test
42      
43  
44  
45      public void deleteSubCollectionLine() throws Exception {
46          selenium.open("/kr-dev/portal.do");
47          selenium.type("name=__login_user", "admin");
48          selenium.click("css=input[type=\"submit\"]");
49          selenium.waitForPageToLoad("30000");
50          selenium.click("link=KRAD");
51          selenium.waitForPageToLoad("30000");
52          selenium.click("link=Uif Components (Kitchen Sink)");
53          selenium.waitForPageToLoad("30000");
54          selenium.selectFrame("iframeportlet");
55          
56          selenium.click("id=u961");
57          
58          
59          for (int second = 0;; second++) {
60              if (second >= 60) fail("timeout");
61              try { if (selenium.isElementPresent("id=u1089_line0_line0_control")) break; } catch (Exception e) {}
62              Thread.sleep(1000);
63          }
64          
65          selenium.type("id=u1089_line0_line0_control", "selenium");
66          
67          selenium.click("id=u1140_line0_line0");
68          
69          for (int second = 0;; second++) {
70              if (second >= 60) fail("timeout");
71              try { if (!"selenium".equals(selenium.getValue("id=u1089_line0_line0_control"))) break; } catch (Exception e) {}
72              Thread.sleep(1000);
73          }
74          
75          assertNotSame("selenium", selenium.getValue("id=u1089_line0_line0_control"));
76      }
77  
78      @After
79      public void tearDown() throws Exception {
80          selenium.stop();
81      }
82  }