001/** 002 * Copyright 2004-2014 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.hr.time.clock.log; 017 018import org.junit.Test; 019import org.kuali.hr.KPMEWebTestCase; 020import org.kuali.kpme.core.FunctionalTest; 021 022@FunctionalTest 023public class ClockLogMaintenanceTest extends KPMEWebTestCase{ 024/* private static Long TEST_CODE_INVALID_TASK_ID =9999L; 025 private static Long TEST_CODE_INVALID_WORK_AREA_ID =9999L; 026 private static Long clockLogId = 1L; */ 027 028 @Test 029 public void testClockLogMaint() throws Exception { 030 /* HtmlPage clockLogLookUp = HtmlUnitUtil.gotoPageAndLogin(getWebClient(), TkTestConstants.Urls.CLOCK_LOG_MAINT_URL); 031 clockLogLookUp = HtmlUnitUtil.clickInputContainingText(clockLogLookUp, "search"); 032 Assert.assertTrue("Page contains test ClockLog", clockLogLookUp.asText().contains("TEST")); 033 HtmlPage maintPage = HtmlUnitUtil.clickAnchorContainingText(clockLogLookUp, "edit",clockLogId.toString()); 034 Assert.assertTrue("Maintenance Page contains test ClockLog",maintPage.asText().contains("TEST")); 035 } 036 037 @Test 038 public void testClockLogMaintForErrorMessages() throws Exception { 039 HtmlPage clockLogLookUp = HtmlUnitUtil.gotoPageAndLogin(getWebClient(), TkTestConstants.Urls.CLOCK_LOG_MAINT_URL); 040 clockLogLookUp = HtmlUnitUtil.clickInputContainingText(clockLogLookUp, "search"); 041 Assert.assertTrue("Page contains test ClockLog", clockLogLookUp.asText().contains("TEST")); 042 HtmlPage maintPage = HtmlUnitUtil.clickAnchorContainingText(clockLogLookUp, "edit",clockLogId.toString()); 043 Assert.assertTrue("Maintenance Page contains test ClockLog",maintPage.asText().contains("TEST")); 044 045 HtmlInput inputForDescription = HtmlUnitUtil.getInputContainingText( 046 maintPage, "* Document Description"); 047 inputForDescription.setValueAttribute("Test_Description"); 048 HtmlUnitUtil.setFieldValue(maintPage, "document.newMaintainableObject.workArea", TEST_CODE_INVALID_WORK_AREA_ID.toString()); 049 HtmlUnitUtil.setFieldValue(maintPage, "document.newMaintainableObject.task", TEST_CODE_INVALID_TASK_ID.toString()); 050 HtmlPage resultantPageAfterEdit = HtmlUnitUtil 051 .clickInputContainingText(maintPage, "submit"); 052 HtmlUnitUtil.createTempFile(resultantPageAfterEdit); 053 054 Assert.assertTrue("Maintenance Page contains test Workarea ", 055 resultantPageAfterEdit.asText().contains( 056 "The specified Workarea '" 057 + TEST_CODE_INVALID_WORK_AREA_ID 058 + "' does not exist.")); 059 060 HtmlUnitUtil.createTempFile(resultantPageAfterEdit); 061 062 Assert.assertTrue("Maintenance Page contains test Task ", 063 resultantPageAfterEdit.asText().contains( 064 "The specified Task '" 065 + TEST_CODE_INVALID_TASK_ID 066 + "' does not exist.")); 067 068 */ 069 } 070 071}