1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs;
17
18 import org.junit.Test;
19 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20 import org.openqa.selenium.By;
21
22
23
24
25 public class LabsTableCollectionEditDetailsAft extends WebDriverLegacyITBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/labs?viewId=Lab-TableCollectionEditDetails";
31
32 @Override
33 protected String getBookmarkUrl() {
34 return BOOKMARK_URL;
35 }
36
37 @Override
38 protected void navigate() throws Exception {
39 waitAndClickByLinkText("Table Collection Edit Details");
40 }
41
42 protected void testLabsTableCollectionEditDetails() throws InterruptedException {
43
44 waitAndTypeByName("newCollectionLines['collection1'].field2","999");
45 waitAndTypeByName("newCollectionLines['collection1'].field4","999");
46 waitAndClickByXpath("//button[contains(text(),'Add')]");
47 waitForElementPresentByXpath("//span[contains(text(),'999')]");
48
49
50 waitAndClickByXpath("//button[contains(text(),'Delete')]");
51 waitForElementNotPresent(By.xpath("//span[contains(text(),'999')]"));
52
53
54 waitAndClickByXpath("//button[contains(text(),'Edit in Dialog')]");
55 clearTextByName("dialogDataObject.field2");
56 waitAndTypeByName("dialogDataObject.field2","999");
57 clearTextByName("dialogDataObject.field4");
58 waitAndTypeByName("dialogDataObject.field4","999");
59 waitAndClickByXpath("//button[contains(text(),'Save Changes')]");
60 waitForElementPresentByXpath("//span[contains(text(),'999')]");
61 waitForElementPresentByXpath("//pre[contains(text(),'999')]");
62
63
64 waitAndClickByXpath("//button[contains(text(),'Edit in Dialog')]");
65 waitForElementVisibleBy(By.name("dialogDataObject.field2"));
66 clearTextByName("dialogDataObject.field2");
67 waitAndTypeByName("dialogDataObject.field2","111");
68 clearTextByName("dialogDataObject.field4");
69 waitAndTypeByName("dialogDataObject.field4","111");
70 waitAndClickByXpath("//button[contains(text(),'No')]");
71 waitForElementPresentByXpath("//span[contains(text(),'999')]");
72 waitForElementPresentByXpath("//pre[contains(text(),'999')]");
73 waitForElementNotPresent(By.xpath("//span[contains(text(),'111')]"));
74 waitForElementNotPresent(By.xpath("//pre[contains(text(),'111')]"));
75 }
76
77 @Test
78 public void testLabsTableCollectionEditDetailsBookmark() throws Exception {
79 testLabsTableCollectionEditDetails();
80 passed();
81 }
82
83 @Test
84 public void testLabsTableCollectionEditDetailsNav() throws Exception {
85 testLabsTableCollectionEditDetails();
86 passed();
87 }
88 }