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