protected void travelAccountCreateDocument(String principalName) throws Exception {
    waitAndTypeByName(DESCRIPTION_FIELD, "Travel Company Super User Test");
    String randomCode = RandomStringUtils.randomAlphabetic(9).toUpperCase();
    waitAndTypeByName(COMPANY_NAME_FIELD, "Company Name " + randomCode);

    waitAndClickByLinkText("Ad Hoc Recipients");
    waitAndTypeByName(
        "newCollectionLines['document.adHocRoutePersons'].actionRequested", "Complete");
    waitAndTypeByName("newCollectionLines['document.adHocRoutePersons'].id", principalName);
    jGrowl("Click Add button");
    waitAndClickById("Uif-AdHocPersonCollection_add");
    waitForElementPresentByXpath(
        "//div[@data-parent=\"Uif-AdHocPersonCollection\"]/div/span[contains(text(), principalName]");
    waitAndClickByLinkText("Ad Hoc Recipients");

    waitAndClickSubmitByText();
    waitAndClickConfirmSubmitOk();
    waitForProgress("Loading...", WebDriverUtils.configuredImplicityWait() * 4);
    waitForTextPresent(
        "Document was successfully submitted.", WebDriverUtils.configuredImplicityWait() * 2);
  }
  protected void testDemoTravelCompanyCompletionRequestForAdmin() throws Exception {
    String documentNumber = waitForDocIdKrad();

    travelAccountCreateDocument(ADMIN_PRINCIPAL_NAME);

    openTravelCompanyDoc(documentNumber, ADMIN_PRINCIPAL_NAME);

    // Make sure the document can be edited
    waitAndTypeByName(COMPANY_NAME_FIELD, " Extra");

    // Admin is a super user but the approve and disapprove buttons will not
    // be shown since the completion request was for Admin
    Thread.sleep(3000);
    waitAndClickByLinkText(SUPER_USER_ACTIONS);
    verifyButtons();
    waitAndClickButtonByText(COMPLETE);
    waitForProgress("Loading...", WebDriverUtils.configuredImplicityWait() * 8);

    ReloadAndCheckDocStatus(FINAL);
  }
  protected void testDemoTravelCompanyCompletionRequestForUser1() throws Exception {
    String documentNumber = waitForDocIdKrad();

    travelAccountCreateDocument(USER1_PRINCIPAL_NAME);

    // Admin is a super user so the approve and disapprove buttons should be shown to Admin but not
    // to user1
    waitAndClickByLinkText(SUPER_USER_ACTIONS);
    waitForTextPresent(APPROVE);
    waitForTextPresent(DISAPPROVE);

    openTravelCompanyDoc(documentNumber, USER1_PRINCIPAL_NAME);

    // Make sure the document can be edited
    waitAndTypeByName(COMPANY_NAME_FIELD, " Extra");

    assertTextNotPresent(SUPER_USER_ACTIONS);
    verifyButtons();

    waitAndClickButtonByText(COMPLETE);
    waitForProgress("Loading...", WebDriverUtils.configuredImplicityWait() * 8);

    ReloadAndCheckDocStatus(FINAL);
  }