001/**
002 * Copyright 2005-2014 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 */
016package edu.sampleu.krad.reference;
017
018import org.junit.Test;
019import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
020import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
021import org.kuali.rice.testtools.selenium.WebDriverUtils;
022
023/**
024 * Tests the Component section in Rice.
025 *
026 * @author Kuali Rice Team (rice.collab@kuali.org)
027 */
028public class CitizenshipStatusAft extends WebDriverLegacyITBase {
029
030    /**
031     *  AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Citizenship%20Status&channelUrl="
032     *   + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KRAD_LOOKUP_METHOD +
033     *   "org.kuali.rice.kim.impl.identity.citizenship.EntityCitizenshipStatusBo&returnLocation="
034     *   + AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
035     */
036    public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Citizenship%20Status&channelUrl="
037            + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KRAD_LOOKUP_METHOD +
038            "org.kuali.rice.kim.impl.identity.citizenship.EntityCitizenshipStatusBo&returnLocation="
039            + AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
040
041    @Override
042    protected String getBookmarkUrl() {
043        return BOOKMARK_URL;
044    }
045
046    @Override
047    protected void navigate() throws InterruptedException {
048        waitAndClickKRAD();
049        waitAndClickByLinkText("Citizenship Status");
050    }
051
052    //Code for KRAD Test Package.
053    protected void testCitizenshipStatus() throws Exception {
054      selectFrameIframePortlet();
055      waitAndClickButtonByText("Search");
056      Thread.sleep(3000);
057//      Code cannot be executed as there is not data to test on Citizenship Status.
058//      assertTextPresent("AFLT");
059//      assertTextPresent("FCLTY");
060//      assertTextPresent("STAFF");
061//      waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='N']");
062//      waitAndClickButtonByText("Search");
063//      Thread.sleep(3000);
064//      if(isTextPresent("AFLT")) {
065//          fail("Conditions not working !");
066//      }
067//      waitAndTypeByName("lookupCriteria[code]","AFLT");
068//      waitAndClickButtonByText("Search");
069//      Thread.sleep(3000);
070//      if(isTextPresent("FCLTY")) {
071//          fail("Conditions not working !");
072//      }
073    }
074
075    @Test
076    public void testCitizenshipStatusBookmark() throws Exception {
077        testCitizenshipStatus();
078        passed();
079    }
080
081    @Test
082    public void testCitizenshipStatusNav() throws Exception {
083        testCitizenshipStatus();
084        passed();
085    }
086}