1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package edu.samplu.krad.configview;
18
19 import com.thoughtworks.selenium.Selenium;
20 import junit.framework.Assert;
21 import org.junit.After;
22 import org.junit.Before;
23 import org.junit.Test;
24 import org.openqa.selenium.WebDriver;
25 import org.openqa.selenium.WebDriverBackedSelenium;
26 import org.openqa.selenium.firefox.FirefoxDriver;
27
28
29
30
31
32
33 public class CollectionsIT {
34 private Selenium selenium;
35
36 @Before
37 public void setUp() throws Exception {
38 WebDriver driver = new FirefoxDriver();
39 String baseUrl = "http://localhost:8080/";
40 selenium = new WebDriverBackedSelenium(driver, baseUrl);
41
42
43 selenium.open(
44 "http://localhost:8080/kr-dev/kr-krad/uicomponents?viewId=ConfigurationTestView-Collections&methodToCall=start");
45 selenium.type("name=__login_user", "admin");
46 selenium.click("//input[@value='Login']");
47 selenium.waitForPageToLoad("30000");
48 }
49
50
51
52
53 @Test
54 public void testActionColumnPlacement() throws Exception {
55
56 Assert.assertTrue(selenium.isElementPresent("//div[@id='ConfigurationTestView-collection1']//tr[2]/td[6]//button[contains(.,\"delete\")]"));
57
58 Assert.assertTrue(selenium.isElementPresent("//div[@id='ConfigurationTestView-collection2']//tr[2]/td[1]//button[contains(.,\"delete\")]"));
59
60 Assert.assertTrue(selenium.isElementPresent("//div[@id='ConfigurationTestView-subCollection2_line0']//tr[2]/td[3]//button[contains(.,\"delete\")]"));
61 }
62
63 @After
64 public void tearDown() throws Exception {
65 selenium.stop();
66 }
67
68 }