001 /**
002 * Copyright 2005-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 package edu.samplu.admin.test;
017
018 import edu.samplu.common.Failable;
019 import edu.samplu.common.ITUtil;
020 import edu.samplu.common.WebDriverLegacyITBase;
021
022 /**
023 * Tests the Component section in Rice.
024 *
025 * @author Kuali Rice Team (rice.collab@kuali.org)
026 */
027 public abstract class ComponentAbstractSmokeTestBase extends WebDriverLegacyITBase {
028 String docId;
029
030 /**
031 * ITUtil.PORTAL + "?channelTitle=Component&channelUrl=" + ITUtil.getBaseUrlString() +
032 "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.component.ComponentBo&docFormKey=88888888&returnLocation=" +
033 ITUtil.PORTAL_URL + "&hideReturnLink=true";
034 */
035 public static final String BOOKMARK_URL = ITUtil.PORTAL + "?channelTitle=Component&channelUrl=" + ITUtil.getBaseUrlString() +
036 "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.component.ComponentBo&docFormKey=88888888&returnLocation=" +
037 ITUtil.PORTAL_URL + "&hideReturnLink=true";
038
039 protected void bookmark() {
040 open(ITUtil.getBaseUrlString() + BOOKMARK_URL);
041 }
042
043 /**
044 * Bookmark tests should call bookmark(), navigation tests should call navigation()
045 * @throws Exception
046 */
047 protected abstract void gotoTest() throws Exception;
048
049 protected void navigtaion() throws InterruptedException {
050 waitAndClickAdministration(this);
051 waitForTitleToEqualKualiPortalIndex();
052 checkForIncidentReport("Component");
053 selectFrameIframePortlet();
054 waitAndClickByLinkText("Component");
055 // selectFrame("relative=up");
056 checkForIncidentReport("Component");
057 }
058
059 protected void testComponentCreateNewCancelBookmark(Failable failable) throws Exception {
060 waitAndCreateNew();
061 testCancelConfirmation();
062 passed();
063 }
064
065 protected void testComponentCreateNewCancelNav(Failable failable) throws Exception {
066 navigtaion(); // setUp only takes us to the portal, need to navigate to the test
067 waitAndCreateNew();
068 testCancelConfirmation();
069 passed();
070 }
071
072 protected void testComponentParameterBookmark(Failable failable) throws Exception {
073 testComponentParameter();
074 passed();
075 }
076
077 protected void testComponentParameterNav(Failable failable) throws Exception {
078 navigtaion(); // setUp only takes us to the portal, need to navigate to the test
079 testComponentParameter();
080 passed();
081 }
082
083 protected void testComponentParameter() throws Exception {
084 //Create New
085 waitAndCreateNew();
086 String componentName = "TestName" + ITUtil.DTS_TWO;
087 String componentCode = "TestCode" + ITUtil.DTS_TWO;
088 docId = testCreateNewComponent(componentName, componentCode);
089
090 //Lookup
091 gotoTest();
092 testLookUpComponent(docId, componentName, componentCode);
093
094 //edit
095 testEditComponent(docId, componentName, componentCode);
096
097 //Verify if its edited
098 gotoTest();
099 testVerifyEditedComponent(docId, componentName, componentCode);
100
101 //copy
102 testCopyComponent(docId, componentName + "copy", componentCode + "copy");
103
104 //Verify if its copied
105 gotoTest();
106 testVerifyCopyComponent(docId, componentName + "copy", componentCode + "copy");
107 }
108 }