001 /** 002 * Copyright 2005-2013 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 */ 016 package edu.samplu.krad.demo.travel.account; 017 018 import edu.samplu.common.SmokeTestBase; 019 import org.junit.Test; 020 021 /** 022 * @author Kuali Rice Team (rice.collab@kuali.org) 023 */ 024 public class DemoTravelAccountMaintenanceNewSmokeTest extends SmokeTestBase { 025 026 /** 027 * //div[@class='fancybox-item fancybox-close'] 028 */ 029 public static final String FANCY_BOX_CLOSE_XPATH = "//div[@class='fancybox-item fancybox-close']"; 030 031 /** 032 * //div[@class='fancybox-item fancybox-close'] 033 */ 034 public static final String FANCY_BOX_IFRAME_XPATH = "//iframe[@class='fancybox-iframe']"; 035 036 /** 037 * /kr-krad/maintenance?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.account.TravelAccount&hideReturnLink=true 038 */ 039 public static final String BOOKMARK_URL = "/kr-krad/maintenance?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.account.TravelAccount&hideReturnLink=true"; 040 041 @Override 042 public String getBookmarkUrl() { 043 return BOOKMARK_URL; 044 } 045 046 protected void navigate() throws Exception { 047 waitAndClickById("Demo-DemoLink", ""); 048 waitAndClickByLinkText("Account Maintenance (New)"); 049 } 050 051 protected void testTravelAccountMaintenanceNew() throws Exception { 052 waitAndTypeByName("document.documentHeader.documentDescription","Travel Account Maintenance New Test Document"); 053 waitAndTypeByName("document.newMaintainableObject.dataObject.number","a1"); 054 waitAndClickByXpath("//input[@alt='Direct Inquiry']"); 055 waitForElementPresentByXpath("//a[@title='Travel Account ']"); 056 waitAndClickByXpath(FANCY_BOX_CLOSE_XPATH); 057 assertTextPresent("Travel Account Maintenance"); 058 } 059 060 @Test 061 public void testDemoTravelAccountMaintenanceNewBookmark() throws Exception { 062 testTravelAccountMaintenanceNew(); 063 passed(); 064 } 065 066 @Test 067 public void testDemoTravelAccountMaintenanceNewNav() throws Exception { 068 testTravelAccountMaintenanceNew(); 069 passed(); 070 } 071 }