View Javadoc
1   /**
2    * Copyright 2004-2015 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.hr.time.clock.log;
17   
18  import org.junit.Test;
19  import org.kuali.hr.KPMEWebTestCase;
20  import org.kuali.kpme.core.FunctionalTest;
21   
22  @FunctionalTest
23  public class ClockLogMaintenanceTest extends KPMEWebTestCase{
24  /*        private static Long TEST_CODE_INVALID_TASK_ID =9999L;
25          private static Long TEST_CODE_INVALID_WORK_AREA_ID =9999L;
26          private static Long clockLogId = 1L;   */ 
27          
28          @Test
29          public void testClockLogMaint() throws Exception {
30          /*      HtmlPage clockLogLookUp = HtmlUnitUtil.gotoPageAndLogin(getWebClient(), TkTestConstants.Urls.CLOCK_LOG_MAINT_URL);
31                  clockLogLookUp = HtmlUnitUtil.clickInputContainingText(clockLogLookUp, "search");
32                  Assert.assertTrue("Page contains test ClockLog", clockLogLookUp.asText().contains("TEST"));             
33                  HtmlPage maintPage = HtmlUnitUtil.clickAnchorContainingText(clockLogLookUp, "edit",clockLogId.toString());              
34                  Assert.assertTrue("Maintenance Page contains test ClockLog",maintPage.asText().contains("TEST"));               
35          }
36          
37          @Test
38          public void testClockLogMaintForErrorMessages() throws Exception {
39                  HtmlPage clockLogLookUp = HtmlUnitUtil.gotoPageAndLogin(getWebClient(), TkTestConstants.Urls.CLOCK_LOG_MAINT_URL);
40                  clockLogLookUp = HtmlUnitUtil.clickInputContainingText(clockLogLookUp, "search");
41                  Assert.assertTrue("Page contains test ClockLog", clockLogLookUp.asText().contains("TEST"));             
42                  HtmlPage maintPage = HtmlUnitUtil.clickAnchorContainingText(clockLogLookUp, "edit",clockLogId.toString());              
43                  Assert.assertTrue("Maintenance Page contains test ClockLog",maintPage.asText().contains("TEST"));
44                  
45                  HtmlInput inputForDescription = HtmlUnitUtil.getInputContainingText(
46                                  maintPage, "* Document Description");
47                  inputForDescription.setValueAttribute("Test_Description");
48                  HtmlUnitUtil.setFieldValue(maintPage, "document.newMaintainableObject.workArea", TEST_CODE_INVALID_WORK_AREA_ID.toString());
49                  HtmlUnitUtil.setFieldValue(maintPage, "document.newMaintainableObject.task", TEST_CODE_INVALID_TASK_ID.toString());
50                  HtmlPage resultantPageAfterEdit = HtmlUnitUtil
51                                  .clickInputContainingText(maintPage, "submit");
52                  HtmlUnitUtil.createTempFile(resultantPageAfterEdit);
53                  
54                  Assert.assertTrue("Maintenance Page contains test Workarea ",
55                                  resultantPageAfterEdit.asText().contains(
56                                                  "The specified Workarea '"
57                                                                  + TEST_CODE_INVALID_WORK_AREA_ID
58                                                                  + "' does not exist."));
59                  
60                  HtmlUnitUtil.createTempFile(resultantPageAfterEdit);
61                  
62                  Assert.assertTrue("Maintenance Page contains test Task ",
63                                  resultantPageAfterEdit.asText().contains(
64                                                  "The specified Task '"
65                                                                  + TEST_CODE_INVALID_TASK_ID
66                                                                  + "' does not exist."));
67                  
68          */      
69          }
70          
71  }