コード例 #1
0
  @Test(groups = "EnterpriseOnly")
  public void Enterprise40x_13861() throws Exception {
    /** Start Test */
    testName = getTestName();

    /** Test Data Setup */
    String siteName = getSiteName(testName);
    String testUser = getUserNameFreeDomain(testName);
    String fileName = getFileName(testName) + ".txt";

    DocumentLibraryPage documentLibraryPage;

    String workFlowName1 = testName + System.currentTimeMillis() + "-1-WF";
    String dueDate = new DateTime().plusDays(2).toString("dd/MM/yyyy");

    // Login
    ShareUser.login(drone, testUser, DEFAULT_PASSWORD);

    documentLibraryPage = ShareUser.openSitesDocumentLibrary(drone, siteName);

    DocumentDetailsPage detailsPage = documentLibraryPage.selectFile(fileName);

    // Click Start Workflow from Actions section

    StartWorkFlowPage startWorkFlowPage =
        ShareUserWorkFlow.selectStartWorkFlowFromDetailsPage(drone).render();

    NewWorkflowPage newWorkflowPage =
        startWorkFlowPage.getWorkflowPage(WorkFlowType.NEW_WORKFLOW).render();

    List<String> reviewers = new ArrayList<String>();
    reviewers.add(username);

    WorkFlowFormDetails formDetails = new WorkFlowFormDetails(siteName, siteName, reviewers);
    formDetails.setMessage(workFlowName1);
    formDetails.setDueDate(dueDate);
    formDetails.setTaskPriority(Priority.MEDIUM);
    // detailsPage = newWorkflowPage.startWorkflow(formDetails).render();

    newWorkflowPage.startWorkflow(formDetails).render();

    // check the document is marked with icon
    assertTrue(detailsPage.isPartOfWorkflow(), "Verifying the file is part of a workflow");

    // site creator logs out and assignee user logs in
    ShareUser.logout(drone);
    ShareUser.login(drone, ADMIN_USERNAME, ADMIN_PASSWORD);

    // check the task is in MyTasks for site creator
    MyTasksPage myTasksPage = ShareUserWorkFlow.navigateToMyTasksPage(drone);
    assertTrue(myTasksPage.isTaskPresent(workFlowName1));
  }
コード例 #2
0
 @AfterMethod(alwaysRun = true)
 public void logout() {
   ShareUser.logout(drone);
   logger.info("User logged out - drone.");
 }