View Javadoc

1   /*
2    * Copyright 2006-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  
17  package edu.samplu.krad.demo.uif.library.navigation.magic;
18  
19  import edu.samplu.common.ITUtil;
20  import edu.samplu.common.WebDriverLegacyITBase;
21  import org.junit.runner.RunWith;
22  
23  @RunWith(MagicSmokeTestRunner.class)
24  public abstract class MagicWebDriverLegacyITBase extends WebDriverLegacyITBase {
25  
26      private String testUrl = ITUtil.KRAD_PORTAL;
27      private boolean shouldNavigate = false;
28  
29      @Override
30      public String getTestUrl() {
31          return testUrl;
32      }
33  
34      protected void enableBookmarkMode() {
35          this.testUrl = getBookmarkUrl();
36      }
37  
38      protected void enableNavigationMode() {
39          this.shouldNavigate = true;
40          this.testUrl = ITUtil.KRAD_PORTAL;
41      }
42  
43      @Override
44      protected void navigateInternal() throws Exception {
45          if (this.shouldNavigate) {
46              navigate();
47          }
48      }
49  
50      protected abstract String getBookmarkUrl();
51  
52      protected abstract void navigate() throws Exception;
53  
54  }