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