/** @author Kuali Rice Team ([email protected]) */
public class RuleAttributeAft extends WebDriverLegacyITBase {

  /**
   * AutomatedFunctionalTestUtils.PORTAL+"?channelTitle=Rule%20Attribute&channelUrl="+
   * WebDriverUtils .getBaseUrlString()+"
   * /kr/lookup.do?businessObjectClassName=org.kuali.rice.kew.rule.bo.RuleAttribute&docFormKey=88888888&returnLocation="
   * + AutomatedFunctionalTestUtils.PORTAL_URL+ AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
   */
  public static final String BOOKMARK_URL =
      AutomatedFunctionalTestUtils.PORTAL
          + "?channelTitle=Rule%20Attribute&channelUrl="
          + WebDriverUtils.getBaseUrlString()
          + "/kr/lookup.do?businessObjectClassName=org.kuali.rice.kew.rule.bo.RuleAttribute&docFormKey=88888888&returnLocation="
          + AutomatedFunctionalTestUtils.PORTAL_URL
          + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;

  @Override
  protected String getBookmarkUrl() {
    return BOOKMARK_URL;
  }

  @Override
  protected void navigate() throws InterruptedException {
    waitAndClickAdministration();
    waitAndClickByLinkText("Rule Attribute");
  }

  protected void testRuleAttribute() throws Exception {
    selectFrameIframePortlet();
    waitAndClickSearch();
    Thread.sleep(2000);
    assertTextPresent("1000");
    assertTextPresent("RuleRoutingAttribute");
    selectByName("type", "Rule Xml Attribute");
    waitAndClickSearch();
    Thread.sleep(2000);
    assertTextPresent("1100");
    assertTextPresent("EDL.Campus.Example");
    assertTextPresent("RuleXmlAttribute");
    if (isTextPresent("1000")) {
      jiraAwareFail("Select Filter not working !");
    }
  }

  @Test
  public void testRuleAttributeBookmark() throws Exception {
    testRuleAttribute();
    passed();
  }

  @Test
  public void testRuleAttributeNav() throws Exception {
    testRuleAttribute();
    passed();
  }
}
/** @author Kuali Rice Team ([email protected]) */
public abstract class LocationCountryAftBase extends AdminTmplMthdAftNavBase {

  /**
   * ITUtil.PORTAL + "?channelTitle=Country&channelUrl=" + WebDriverUtils.getBaseUrlString() +
   * ITUtil.KNS_LOOKUP_METHOD +
   * "org.kuali.rice.location.impl.country.CountryBo&docFormKey=88888888&returnLocation=" +
   * ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
   */
  public static final String BOOKMARK_URL =
      AutomatedFunctionalTestUtils.PORTAL
          + "?channelTitle=Country&channelUrl="
          + WebDriverUtils.getBaseUrlString()
          + AutomatedFunctionalTestUtils.KNS_LOOKUP_METHOD
          + "org.kuali.rice.location.impl.country.CountryBo&docFormKey=88888888&returnLocation="
          + AutomatedFunctionalTestUtils.PORTAL_URL
          + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;

  @Override
  protected String getBookmarkUrl() {
    return BOOKMARK_URL;
  }

  /**
   * {@inheritDoc} Country
   *
   * @return
   */
  @Override
  protected String getLinkLocator() {
    return "Country";
  }

  @Override
  protected void createNewEnterDetails() throws InterruptedException {
    waitAndTypeByName("document.documentHeader.documentDescription", getDescriptionUnique());
    jiraAwareTypeByName(
        "document.newMaintainableObject.code", RandomStringUtils.randomAlphabetic(2));
    jiraAwareTypeByName("document.newMaintainableObject.name", "name" + uniqueString);
  }

  public void testLocationCountryBookmark(JiraAwareFailable failable) throws Exception {
    testSearchEditCancel();
    driver.navigate().to(WebDriverUtils.getBaseUrlString() + BOOKMARK_URL);
    testCreateNewCancel();
    passed();
  }

  public void testLocationCountryNav(JiraAwareFailable failable) throws Exception {
    testEditCancel();
    navigate();
    testCreateNewCancelNav();
    passed();
  }
}
/** @author Kuali Rice Team ([email protected]) */
public abstract class ConfigComponentLookUpAndEditAftBase extends AdminTmplMthdAftNavBase {

  /**
   * ITUtil.PORTAL+"?channelTitle=Component&channelUrl="+WebDriverUtils.getBaseUrlString()+
   * "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.component.ComponentBo&docFormKey=88888888&returnLocation="+
   * +ITUtil.PORTAL_URL+ ITUtil.HIDE_RETURN_LINK;
   */
  public static final String BOOKMARK_URL =
      AutomatedFunctionalTestUtils.PORTAL
          + "?channelTitle=Component&channelUrl="
          + WebDriverUtils.getBaseUrlString()
          + "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.component.ComponentBo&docFormKey=88888888&returnLocation="
          + AutomatedFunctionalTestUtils.PORTAL_URL
          + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;

  @Override
  protected String getBookmarkUrl() {
    return BOOKMARK_URL;
  }

  /**
   * {@inheritDoc} Component
   *
   * @return
   */
  @Override
  protected String getLinkLocator() {
    return "Component";
  }

  public void testConfigComponentLookUpAndEditBookmark(JiraAwareFailable failable)
      throws Exception {
    testConfigComponentLookUpAndEdit();
    passed();
  }

  public void testConfigComponentLookUpAndEditNav(JiraAwareFailable failable) throws Exception {
    testConfigComponentLookUpAndEdit();
    passed();
  }

  public void testConfigComponentLookUpAndEdit() throws Exception {
    selectFrameIframePortlet();
    waitAndClickSearchSecond();
    waitAndClickByLinkText("edit");
    waitAndTypeByName(
        "document.documentHeader.documentDescription", "Test description of Component");
    waitAndClickByName("methodToCall.route");
    checkForDocError();
    waitAndClickByName("methodToCall.close");
    //         waitAndClickByName("methodToCall.processAnswer.button1");
  }
}
/** @author Kuali Rice Team ([email protected]) */
public abstract class ConfigParameterTypeLookUpAndInquireAftBase extends AdminTmplMthdAftNavBase {

  /**
   * ITUtil.PORTAL+"?channelTitle=Parameter&channelUrl="+WebDriverUtils.getBaseUrlString()+
   * "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.parameter.ParameterBo&docFormKey=88888888&returnLocation="
   * +ITUtil.PORTAL_URL+ ITUtil.HIDE_RETURN_LINK;
   */
  public static final String BOOKMARK_URL =
      AutomatedFunctionalTestUtils.PORTAL
          + "?channelTitle=Parameter%20Type&channelUrl="
          + WebDriverUtils.getBaseUrlString()
          + "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.parameter.ParameterTypeBo&docFormKey=88888888&returnLocation="
          + AutomatedFunctionalTestUtils.PORTAL_URL
          + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;

  @Override
  protected String getBookmarkUrl() {
    return BOOKMARK_URL;
  }

  /**
   * {@inheritDoc} Parameter
   *
   * @return
   */
  @Override
  protected String getLinkLocator() {
    return "Parameter Type";
  }

  public void testConfigParameterTypeLookUpAndInquireBookmark(JiraAwareFailable failable)
      throws Exception {
    testConfigParameterTypeLookUpAndInquire();
    passed();
  }

  public void testConfigParameterTypeLookUpAndInquireNav(JiraAwareFailable failable)
      throws Exception {
    testConfigParameterTypeLookUpAndInquire();
    passed();
  }

  public void testConfigParameterTypeLookUpAndInquire() throws Exception {
    selectFrameIframePortlet();
    waitAndClickSearchSecond();
    waitAndClickByLinkText("Authorization");
    switchToWindow("Kuali :: Inquiry");
    selectFrameIframePortlet();
    waitAndClick("input.globalbuttons");
  }
}
/** @author Kuali Rice Team ([email protected]) */
public class WorkFlowRouteRulesDelegationAftBase extends MainTmplMthdSTNavBase {

  /**
   * ITUtil.PORTAL + "?channelTitle=Routing%20Rules%20Delegation&channelUrl=" +
   * WebDriverUtils.getBaseUrlString() +
   * "/kr/lookup.do?businessObjectClassName=org.kuali.rice.kew.rule.RuleDelegationBo&docFormKey=88888888&returnLocation="
   * + ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK + "&showMaintenanceLinks=true";
   */
  public static final String BOOKMARK_URL =
      AutomatedFunctionalTestUtils.PORTAL
          + "?channelTitle=Routing%20Rules%20Delegation&channelUrl="
          + WebDriverUtils.getBaseUrlString()
          + "/kr/lookup.do?businessObjectClassName=org.kuali.rice.kew.rule.RuleDelegationBo&docFormKey=88888888&returnLocation="
          + AutomatedFunctionalTestUtils.PORTAL_URL
          + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK
          + "&showMaintenanceLinks=true";

  @Override
  protected String getBookmarkUrl() {
    return BOOKMARK_URL;
  }

  /**
   * {@inheritDoc} Routing Rules Delegation
   *
   * @return
   */
  @Override
  protected String getLinkLocator() {
    return "Routing Rules Delegation";
  }

  public void testWorkFlowRouteRulesDelegationBookmark(JiraAwareFailable failable)
      throws Exception {
    testCreateNewRRDTravelRequestDestRouting();
    passed();
  }

  public void testWorkFlowRouteRulesDelegationNav(JiraAwareFailable failable) throws Exception {
    testCreateNewRRDTravelRequestDestRouting();
    passed();
  }
}
/** @author Kuali Rice Team ([email protected]) */
public abstract class MaintenanceConstraintTextAftBase extends KradTmplMthdSTNavBase {

  /**
   * ITUtil.PORTAL + "?channelTitle=Travel%20Account%20Maintenance%20(New)&channelUrl=" +
   * WebDriverUtils.getBaseUrlString() +
   * "/kr-krad/maintenance?methodToCall=start&dataObjectClassName=edu.sampleu.travel.bo.TravelAccount&viewName=ks_maintenance&returnLocation="
   * + ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK
   */
  public static final String BOOKMARK_URL =
      AutomatedFunctionalTestUtils.PORTAL
          + "?channelTitle=Travel%20Account%20Maintenance%20(New)&channelUrl="
          + WebDriverUtils.getBaseUrlString()
          + "/kr-krad/maintenance?methodToCall=start&dataObjectClassName=edu.sampleu.travel.bo.TravelAccount&viewName=ks_maintenance&returnLocation="
          + AutomatedFunctionalTestUtils.PORTAL_URL
          + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;

  @Override
  protected String getBookmarkUrl() {
    return BOOKMARK_URL;
  }

  /**
   * {@inheritDoc} Travel Account Maintenance (New)
   *
   * @return
   */
  @Override
  protected String getLinkLocator() {
    return "Travel Account Maintenance (New)";
  }

  public void testMaintenanceConstraintTextBookmark(JiraAwareFailable failable) throws Exception {
    testVerifyConstraintText();
    passed();
  }

  public void testMaintenanceConstraintTextNav(JiraAwareFailable failable) throws Exception {
    testVerifyConstraintText();
    passed();
  }
}
 public void testLocationCountryBookmark(JiraAwareFailable failable) throws Exception {
   testSearchEditCancel();
   driver.navigate().to(WebDriverUtils.getBaseUrlString() + BOOKMARK_URL);
   testCreateNewCancel();
   passed();
 }