001 /*
002 * Copyright 2006-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017 package edu.samplu.krad.demo.uif.library.navigation.magic;
018
019 import org.junit.Assert;
020 import org.junit.Test;
021
022 public class DemoValidationSimpleConstraintsSmokeTest extends MagicWebDriverLegacyITBase {
023
024 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-SimpleConstraint-View&methodToCall=start";
025
026 public static final String SIMPLE_CONSTRAINT_REQUIRED_TAB = "//div[@id='Demo-SimpleConstraint-Example1_tab']";
027
028 @Override
029 public void fail(String message) {
030 Assert.fail(message);
031 }
032
033 @Override
034 protected String getBookmarkUrl() {
035 return BOOKMARK_URL;
036 }
037
038 @Override
039 protected void navigate() throws Exception {
040 waitAndClickById("Demo-LibraryLink", "");
041 waitAndClickByLinkText("Validation");
042 waitAndClickByLinkText("Simple Constraints");
043 }
044
045 protected void testRequired() throws Exception {
046 waitAndClickByLinkText("Required");
047 assertIsVisibleByXpath(SIMPLE_CONSTRAINT_REQUIRED_TAB, "Simple Constraint Required Tab");
048 passed();
049 }
050
051 @Test
052 public void testRequiredBookmark() throws Exception {
053 testRequired();
054 }
055
056 @Test
057 public void testRequiredNav() throws Exception {
058 testRequired();
059 }
060
061 }