1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.mainmenu.test;
17
18 import static org.junit.Assert.*;
19
20 import java.util.Calendar;
21
22 import org.junit.After;
23 import org.junit.Assert;
24 import org.junit.Before;
25 import org.junit.Ignore;
26 import org.junit.Test;
27 import org.openqa.selenium.By;
28 import org.openqa.selenium.support.ui.Select;
29
30 import com.thoughtworks.selenium.Selenium;
31
32 import edu.samplu.common.AdminMenuITBase;
33 import edu.samplu.common.ITUtil;
34 import edu.samplu.common.MainMenuLookupITBase;
35 import edu.samplu.common.MainMenuLookupLegacyITBase;
36 import edu.samplu.common.MenuITBase;
37 import edu.samplu.common.UpgradedSeleniumITBase;
38
39
40
41
42
43
44 public class PeopleFlowCreateNewLegacyIT extends MainMenuLookupLegacyITBase {
45
46
47
48 @Test
49 public void testPeopleFlow() throws Exception {
50
51
52 gotoMenuLinkLocator();
53 waitAndClick(By.linkText(getCreateNewLinkLocator()));
54
55 waitForElementPresent("div[data-headerfor='PeopleFlow-MaintenanceView'] div[data-label='Document Number'] > span");
56 String docId = getText("div[data-headerfor='PeopleFlow-MaintenanceView'] div[data-label='Document Number'] > span");
57
58
59 driver.findElement(By.name("document.documentHeader.documentDescription")).clear();
60 driver.findElement(By.name("document.documentHeader.documentDescription")).sendKeys("Description for Document");
61 new Select(driver.findElement(By.name("document.newMaintainableObject.dataObject.namespaceCode"))).selectByVisibleText("KUALI - Kuali Systems");
62 driver.findElement(By.name("document.newMaintainableObject.dataObject.name")).clear();
63 driver.findElement(By.name("document.newMaintainableObject.dataObject.name")).sendKeys("Document Name" + ITUtil.DTS);
64
65
66 driver.findElement(By.name("newCollectionLines['document.newMaintainableObject.dataObject.members'].memberName")).clear();
67 driver.findElement(By.name("newCollectionLines['document.newMaintainableObject.dataObject.members'].memberName")).sendKeys("kr");
68 driver.findElement(By.cssSelector("button[data-loadingmessage='Adding Line...']")).click();
69 Thread.sleep(3000);
70
71 driver.findElement(By.name("newCollectionLines['document.newMaintainableObject.dataObject.members'].memberName")).clear();
72 driver.findElement(By.name("newCollectionLines['document.newMaintainableObject.dataObject.members'].memberName")).sendKeys("admin");
73 driver.findElement(By.cssSelector("button[data-loadingmessage='Adding Line...']")).click();
74 Thread.sleep(3000);
75
76
77 driver.findElement(By.cssSelector("div[data-parent='PeopleFlow-MaintenanceView'] > div.uif-footer button~button~button")).click();
78 Thread.sleep(5000);
79
80 driver.findElement(By.id("uif-close")).click();
81 Thread.sleep(3000);
82
83
84 driver.switchTo().window(driver.getWindowHandles().toArray()[0].toString());
85 driver.findElement(By.cssSelector("img[alt=\"doc search\"]")).click();
86 Thread.sleep(5000);
87 driver.switchTo().frame("iframeportlet");
88
89 driver.findElement(By.cssSelector("td.infoline > input[name=\"methodToCall.search\"]")).click();
90 Thread.sleep(5000);
91 assertEquals("FINAL", driver.findElement(By.xpath("//table[@id='row']/tbody/tr/td[4]")).getText());
92 driver.switchTo().defaultContent();
93 driver.findElement(By.name("imageField")).click();
94
95 }
96
97
98
99
100
101
102 @Override
103 public void lookupAssertions() {
104
105
106 }
107
108
109
110
111
112
113 @Override
114 protected String getLinkLocator() {
115 return "People Flow";
116 }
117
118
119 @Ignore
120 @Test
121 @Override
122 public void testLookUp() throws Exception {}
123 }