/** AONE-15605:Form - Items */
  @Test(groups = "Hybrid", enabled = true)
  public void AONE_15605() throws Exception {
    String testName = getTestName() + System.currentTimeMillis();
    String user1 = getUserNameForDomain(testName + "opUser", testDomain);
    String cloudUser = getUserNameForDomain(testName + "cloudUser", testDomain);
    String cloudSite = getSiteName(testName) + "CL" + "-2";
    String dueDate = getDueDateString();
    String folderName = getFolderName(testName);

    createCloudAccount(testName);

    ShareUser.login(hybridDrone, cloudUser, DEFAULT_PASSWORD);
    ShareUser.createSite(hybridDrone, cloudSite, SITE_VISIBILITY_PUBLIC);
    ShareUserSitePage.createFolder(hybridDrone, folderName, folderName);
    ShareUser.logout(hybridDrone);

    // Login as OP user
    ShareUser.login(drone, user1, DEFAULT_PASSWORD);

    // Start Simple Cloud Task Workflow
    CloudTaskOrReviewPage cloudTaskOrReviewPage =
        ShareUserWorkFlow.startCloudReviewTaskWorkFlow(drone).render();

    // ---- Step 1 ----
    // --- Step action ---
    // Fill in all the fields except Items.
    // --- Expected results ---
    // Performed correctly.

    cloudTaskOrReviewPage.selectAfterCompleteDropDown(KeepContentStrategy.KEEPCONTENT);
    Assert.assertTrue(
        cloudTaskOrReviewPage.isAfterCompletionSelected(KeepContentStrategy.KEEPCONTENT));
    Assert.assertFalse(cloudTaskOrReviewPage.isLockOnPremiseSelected());

    cloudTaskOrReviewPage.selectLockOnPremiseCheckbox(true);
    Assert.assertTrue(cloudTaskOrReviewPage.isLockOnPremiseSelected());

    cloudTaskOrReviewPage.enterDueDateText(dueDate);
    cloudTaskOrReviewPage.selectPriorityDropDown(Priority.HIGH);

    DestinationAndAssigneePage destinationAndAssigneePage =
        cloudTaskOrReviewPage.selectDestinationAndAssigneePage().render();
    destinationAndAssigneePage.selectSite(cloudSite);
    destinationAndAssigneePage.selectSubmitButtonToSync();
    AssignmentPage assignmentPage = cloudTaskOrReviewPage.selectAssignmentPage().render();
    assignmentPage.selectAssignee(cloudUser);

    // ---- Step 2 ----
    // --- Step action ---
    // Click on Start Workflow button
    // --- Expected results ---
    // Workflow could not be started' dialog with the message '08150481 At least one content item is
    // required to start a Cloud workflow' is displayed.
    cloudTaskOrReviewPage.clickStartWorkflow();
    String error = cloudTaskOrReviewPage.getWorkFlowCouldNotBeStartedPromptMessage();
    Assert.assertTrue(
        error.contains("At least one content item is required to start a Cloud workflow"),
        "Error is not displayed when no one file is added");
  }
  /** AONE-15604:Form - Items */
  @Test(groups = "Hybrid", enabled = true)
  public void AONE_15604() throws Exception {
    String testName = getTestName() + System.currentTimeMillis();
    String user1 = getUserNameForDomain(testName + "opUser", testDomain);
    String cloudUser = getUserNameForDomain(testName + "cloudUser", testDomain);
    String cloudSite = getSiteName(testName) + "CL" + "-3";
    String opSite = getSiteName(testName) + "-OP";
    String fileName1 = getFileName(testName) + ".txt";
    String dueDate = getDueDateString();

    createCloudAccount(testName);

    ShareUser.login(hybridDrone, cloudUser, DEFAULT_PASSWORD);
    ShareUser.createSite(hybridDrone, cloudSite, SITE_VISIBILITY_PUBLIC);
    ShareUser.logout(hybridDrone);

    // Login as OP user
    ShareUser.login(drone, user1, DEFAULT_PASSWORD);

    ShareUser.openSiteDocumentLibraryFromSearch(drone, opSite);

    // Start Simple Cloud Task Workflow
    CloudTaskOrReviewPage cloudTaskOrReviewPage =
        ShareUserWorkFlow.startWorkFlowFromDocumentLibraryPage(drone, fileName1).render();

    // ---- Step 1 ----
    // --- Step action ---
    // Fill in all the fields except Assignee/Reviewers.
    // --- Expected results ---
    /** Performed correctly. */
    cloudTaskOrReviewPage.selectAfterCompleteDropDown(KeepContentStrategy.KEEPCONTENT);
    cloudTaskOrReviewPage.enterDueDateText(dueDate);
    cloudTaskOrReviewPage.selectLockOnPremiseCheckbox(true);
    cloudTaskOrReviewPage.selectPriorityDropDown(Priority.HIGH);
    DestinationAndAssigneePage destinationAndAssigneePage =
        cloudTaskOrReviewPage.selectDestinationAndAssigneePage().render();
    destinationAndAssigneePage.selectSite(cloudSite);
    destinationAndAssigneePage.selectSubmitButtonToSync();

    // ---- Step 2 ----
    // --- Step action ---
    // Click on Start Workflow button
    // --- Expected results ---
    // 'The value cannot be empty.' balloon pop-up is displayed above the the Assignee/Reviewers
    // section.
    cloudTaskOrReviewPage.clickStartWorkflow();
    Assert.assertTrue(
        cloudTaskOrReviewPage.isErrorBalloonPresent(),
        "Baloon error is not displayed when Assignee is not specified");
    Assert.assertEquals(
        cloudTaskOrReviewPage.getErrorBalloonMessage(), "The value cannot be empty.");
  }