View Javadoc
1   /**
2    * Copyright 2005-2014 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.sampleu.admin;
17  
18  import org.junit.Test;
19  
20  /**
21   * @author Kuali Rice Team (rice.collab@kuali.org)
22   */
23  
24  public abstract class AdminTmplMthdAftNavBlanketAppBase extends AdminTmplMthdAftNavCreateNewBase {
25  
26      @Override
27      protected String getMenuLinkLocator() {
28          return AdminTmplMthdAftNavBase.ADMIN_LOCATOR;
29      }
30  
31      @Override
32      protected String getCreateNewLinkLocator() {
33          return AdminTmplMthdAftNavBase.CREATE_NEW_LOCATOR;
34      }
35  
36      protected String testBlanketApprove() throws Exception {
37          selectFrameIframePortlet();
38          waitAndCreateNew();
39          String docId = verifyDocInitiated();
40          assertBlanketApproveButtonsPresent();
41          createNewLookupDetails();
42  
43          jGrowl("Click Blanket Approve");
44          waitAndClickByName(BLANKET_APPROVE_NAME,
45                  "No blanket approve button does the user " + getUserName() + " have permission?");
46          Thread.sleep(2000);
47  
48          int attempts = 0;
49          while (hasDocError() && extractErrorText().contains("a record with the same primary key already exists.") &&
50                  ++attempts <= 3) {
51              uniqueString = null; // make sure try a new one
52              jGrowl("record with the same primary key already exists");
53              createNewEnterDetails();
54              jGrowl("Click Blanket Approve");
55              waitAndClickByName(BLANKET_APPROVE_NAME,
56                      "No blanket approve button does the user " + getUserName() + " have permission?");
57          }
58  
59          checkForIncidentReport();
60          blanketApproveAssert(docId);
61          return docId;
62      }
63  
64      @Test
65      public void testBlanketAppBookmark() throws Exception {
66          testBlanketApprove();
67          passed();
68      }
69  
70      @Test
71      public void testBlanketAppNav() throws Exception {
72          testBlanketApprove();
73          passed();
74      }
75  }