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.mainmenu.test;
17
18 import edu.samplu.common.Failable;
19 import edu.samplu.common.ITUtil;
20 import edu.samplu.common.WebDriverLegacyITBase;
21
22 /**
23 * Abstract base class for LoginLogout Smoke Tests. Framework specific classes should not be depended upon in this
24 * class but abstracted behind {@link edu.samplu.common.Failable}.
25 *
26 * @see edu.samplu.common.Failable
27 * @see LoginLogoutSTNGBase
28 * @see LoginLogoutSTJUnitBase
29 * @author Kuali Rice Team (rice.collab@kuali.org)
30 */
31 public abstract class LoginLogoutAbstractSmokeTestBase extends WebDriverLegacyITBase {
32
33 /**
34 * LoginLogout can use {@link ITUtil#PORTAL} for both navigation and bookmark tests so it will not be overridden by subclasses.
35 * @return {@link ITUtil#PORTAL}
36 */
37 @Override
38 public String getTestUrl() {
39 return ITUtil.PORTAL;
40 }
41
42 private void navigate(Failable failable) throws InterruptedException {
43 waitAndClickMainMenu(failable);
44 waitForPageToLoad();
45 }
46
47 /**
48 * Navigate to the page under test click logout. {@link LoginLogoutAbstractSmokeTestBase#waitAndClickLogout(edu.samplu.common.Failable)}
49 *
50 * @param failable {@link edu.samplu.common.Failable}
51 * @throws Exception
52 */
53 public void testLogoutNav(Failable failable) throws Exception {
54 navigate(failable);
55 testLogout(failable);
56 }
57
58 /**
59 * Click Logout on the current page. {@link LoginLogoutAbstractSmokeTestBase#waitAndClickLogout(edu.samplu.common.Failable)}
60 *
61 * @param failable {@link edu.samplu.common.Failable}
62 * @throws Exception
63 */
64 public void testLogoutBookmark(Failable failable) throws Exception {
65 testLogout(failable);
66 }
67
68 private void testLogout(Failable failable) throws InterruptedException {
69 jGrowl("Logging Out");
70 waitAndClickLogout(failable);
71 passed();
72 }
73 }