1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.department;
17
18 import org.junit.Assert;
19 import org.junit.Test;
20 import org.kuali.hr.test.KPMETestCase;
21 import org.kuali.hr.time.test.HtmlUnitUtil;
22 import org.kuali.hr.time.test.TkTestConstants;
23 import org.kuali.rice.krad.service.KRADServiceLocator;
24
25 import com.gargoylesoftware.htmlunit.html.HtmlPage;
26
27 public class DepartmentTest extends KPMETestCase {
28 @Test
29 public void testDepartmentMaint() throws Exception {
30 HtmlPage deptLookup = HtmlUnitUtil.gotoPageAndLogin(TkTestConstants.Urls.DEPT_MAINT_URL);
31 deptLookup = HtmlUnitUtil.clickInputContainingText(deptLookup, "search");
32 Assert.assertTrue("Page contains test dept", deptLookup.asText().contains("TEST"));
33 HtmlUnitUtil.createTempFile(deptLookup);
34 HtmlPage maintPage = HtmlUnitUtil.clickAnchorContainingText(deptLookup, "edit","100");
35
36 Assert.assertTrue("Maintenance Page contains test dept",maintPage.asText().contains("TEST"));
37 Assert.assertTrue("Maintenance Page contains test dept",maintPage.asText().contains("Time Department Admin"));
38 }
39
40 @Override
41 public void setUp() throws Exception {
42 super.setUp();
43 Department dept = new Department();
44 dept.setHrDeptId("1001");
45 dept.setDept("__TEST");
46 dept.setDescription("TESTING_DEPT");
47 dept.setActive(true);
48 dept.setLocation("BL");
49 KRADServiceLocator.getBusinessObjectService().save(dept);
50 }
51 }