View Javadoc

1   /**
2    * Copyright 2005-2013 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 edu.samplu.krad.demo.travel.account;
17  
18  import edu.samplu.common.SmokeTestBase;
19  import org.junit.Test;
20  
21  /**
22   * @author Kuali Rice Team (rice.collab@kuali.org)
23   */
24  public class DemoTravelAccountMaintenanceNewSmokeTest extends SmokeTestBase {
25  
26      /**
27       * //div[@class='fancybox-item fancybox-close']
28       */
29      public static final String FANCY_BOX_CLOSE_XPATH = "//div[@class='fancybox-item fancybox-close']";
30      
31      /**
32       * //div[@class='fancybox-item fancybox-close']
33       */
34      public static final String FANCY_BOX_IFRAME_XPATH = "//iframe[@class='fancybox-iframe']";
35  
36      /**
37       * /kr-krad/maintenance?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.account.TravelAccount&hideReturnLink=true
38       */
39      public static final String BOOKMARK_URL = "/kr-krad/maintenance?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.account.TravelAccount&hideReturnLink=true";
40  
41      @Override
42      public String getBookmarkUrl() {
43          return BOOKMARK_URL;
44      }
45  
46      protected void navigate() throws Exception {
47          waitAndClickById("Demo-DemoLink", "");
48          waitAndClickByLinkText("Account Maintenance (New)");
49      }
50  
51      protected void testTravelAccountMaintenanceNew() throws Exception {
52          waitAndTypeByName("document.documentHeader.documentDescription","Travel Account Maintenance New Test Document");
53          waitAndTypeByName("document.newMaintainableObject.dataObject.number","a1");
54          waitAndClickByXpath("//input[@alt='Direct Inquiry']");
55          waitAndClickByXpath(FANCY_BOX_CLOSE_XPATH);
56          assertTextPresent("Travel Account Maintenance");
57      }
58  
59      @Test
60      public void testDemoTravelAccountMaintenanceNewBookmark() throws Exception {
61          testTravelAccountMaintenanceNew();
62          passed();
63      }
64  
65      @Test
66      public void testDemoTravelAccountMaintenanceNewNav() throws Exception {
67          testTravelAccountMaintenanceNew();
68          passed();
69      }
70  }