@Test(groups = "EnterpriseOnly") public void Enterprise40x_3960() 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 filePath = downloadDirectory + fileName; setupCustomDrone(WebDroneType.DownLoadDrone); // Login ShareUser.login(customDrone, testUser, DEFAULT_PASSWORD); documentLibraryPage = ShareUser.openSitesDocumentLibrary(customDrone, siteName); // Document details page has been opened; DocumentDetailsPage detailsPage = documentLibraryPage.selectFile(fileName).render(); Assert.assertFalse(detailsPage.getDocumentVersion().equals("1.0")); // Click Download icon for previous version; detailsPage.selectDownloadPreviousVersion("2.0"); // Check the file is downloaded successfully detailsPage.waitForFile(maxWaitTime, downloadDirectory + fileName); String body = FileUtils.readFileToString(new File(filePath)); if (body.length() == 0) { body = FileUtils.readFileToString(new File(filePath)); } Assert.assertEquals(body, String.format("New version of document %s: %s", 2, fileName)); }
@Test(groups = "EnterpriseOnly") public void Enterprise40x_14032() { /** Start Test */ testName = getTestName(); /** Test Data Setup */ String siteName = getSiteName(testName); String testUser = getUserNameFreeDomain(testName); String fileName = getFileName(testName) + ".txt"; DocumentLibraryPage documentLibraryPage; // Login ShareUser.login(drone, testUser, DEFAULT_PASSWORD); documentLibraryPage = ShareUser.openSitesDocumentLibrary(drone, siteName); DocumentDetailsPage detailsPage = documentLibraryPage.selectFile(fileName); // Click 'Change Type' action ChangeTypePage changeTypePage = detailsPage.selectChangeType().render(); assertTrue(changeTypePage.isChangeTypeDisplayed()); // Select any type if present and click Cancel // The behavior for standard install is: no types are available -> click cancel changeTypePage.selectCancel(); }
@Test(groups = "EnterpriseOnly") public void Enterprise40x_13863() throws Exception { /** Start Test */ testName = getTestName(); /** Test Data Setup */ String siteName = getSiteName(testName); String testUser = getUserNameFreeDomain(testName); String fileName = getFileName(testName) + getRandomStringWithNumders(3) + ".txt"; DocumentLibraryPage documentLibraryPage; // Login ShareUser.login(drone, testUser, DEFAULT_PASSWORD); documentLibraryPage = ShareUser.openSitesDocumentLibrary(drone, siteName); // Upload File String[] fileInfo = {fileName, DOCLIB}; ShareUser.uploadFileInFolder(drone, fileInfo); DocumentDetailsPage detailsPage = documentLibraryPage.selectFile(fileName); // Click "Edit Properties" in Actions section; EditDocumentPropertiesPage editPropertiesPage = detailsPage.selectEditProperties().render(); editPropertiesPage.selectMimeType(MimeType.XML); detailsPage = editPropertiesPage.selectSave().render(); detailsPage.render(); Map<String, Object> properties = detailsPage.getProperties(); Assert.assertEquals(properties.get("Mimetype"), "XML"); }
@Test(groups = "EnterpriseOnly") public void Enterprise40x_3910() { /** Start Test */ testName = getTestName(); /** Test Data Setup */ String siteName = getSiteName(testName); String testUser = getUserNameFreeDomain(testName); String fileName = getFileName(testName) + ".txt"; String text = getRandomString(5); DocumentLibraryPage documentLibraryPage; // Login ShareUser.login(drone, testUser, DEFAULT_PASSWORD); documentLibraryPage = ShareUser.openSitesDocumentLibrary(drone, siteName); DocumentDetailsPage detailsPage = documentLibraryPage.selectFile(fileName); AddCommentForm addCommentForm = detailsPage.clickAddCommentButton(); // 1. Type any text and make it bold; TinyMceEditor tinyMceEditor = addCommentForm.getTinyMceEditor(); tinyMceEditor.setText(text); tinyMceEditor.clickTextFormatter(BOLD); assertEquals( tinyMceEditor.getContent(), String.format("<p><b>%s</b></p>", text), "The text didn't mark as bold."); tinyMceEditor.clickTextFormatter(ITALIC); assertEquals( tinyMceEditor.getContent(), String.format("<p><i><b>%s</b></i></p>", text), "The text didn't italic."); tinyMceEditor.clickTextFormatter(BULLET); assertEquals( tinyMceEditor.getContent(), String.format("<ul><li><i><b>%s</b></i></li></ul>", text), "List didn't display."); tinyMceEditor.clickTextFormatter(NUMBER); assertEquals( tinyMceEditor.getContent(), String.format("<ol><li><i><b>%s</b></i></li></ol>", text), "Numbered list didn't display."); tinyMceEditor.clickColorCode(TinyMceColourCode.BLUE); assertEquals( tinyMceEditor.getColourAttribute(), "BLUE", "The text didn't highlight with any color."); addCommentForm.clickAddCommentButton(); assertTrue(detailsPage.isCommentCorrect(text), "Comment didn't create"); }
/** * Test: AONE-6554:Hidden files * * <ul> * <li>Map Alfresco Webdav as a network drive * <li>Create a folder with the name started with dot (e.g. '.folder new') * <li>Create a file with the name started with dot (e.g. '.test.txt') * <li>Log into Share * <li>Verify the presence of the file and folder * <li>The file and folder are not displayed * </ul> * * @throws Exception */ @AlfrescoTest(testlink = "AONE-6554") @Test( groups = {"WEBDAVWindowsClient", "EnterpriseOnly"}, timeOut = 600000) public void AONE_6554() throws Exception { if (!CifsUtil.checkDirOrFileExists(10, 200, networkDrive + sitesPath)) { Assert.fail("Mapping was not done " + testUser); } // Alfresco WebDAV connection is established String docLib = "\\documentLibrary"; // Alfresco WebDAV connection is established String fullPath = networkDrive + sitesPath + siteName.toLowerCase() + docLib + "\\"; explorer.openWindowsExplorer(); explorer.openFolder(fullPath); // The space / the site's doclib is opened via WebDAV String windowName = ldtpUtil.findWindowName("documentLibrary"); explorer.activateApplicationWindow(windowName); // Create a folder with the name started with dot (e.g. '.folder new') explorer.createNewFolderMenu(folderName); // Create a file with the name started with dot (e.g. '.test.txt') explorer.rightClickCreate("documentLibrary", fileName, Application.TEXTFILE); explorer.activateApplicationWindow(windowName); Ldtp newLdtp = new Ldtp(windowName); String[] objects = newLdtp.getObjectList(); Assert.assertTrue( Arrays.asList(objects).contains(fileNameCheck), "Expected file '" + fileName + "' isn't displayed"); Assert.assertTrue( Arrays.asList(objects).contains(folderNameCheck), "Expected folder '" + folderName + "' isn't displayed"); logger.info("Close window"); explorer.closeExplorer(); // Log into Share ShareUser.login(drone, testUser); DocumentLibraryPage docLibPage = ShareUser.openSitesDocumentLibrary(drone, siteName); int fileCount = docLibPage.getFiles().size(); ShareUser.logout(drone); // The file and folder are not displayed Assert.assertTrue( fileCount == 0, "Some file isn't hidden in Document Library. MNT-13125 and MNT-8116"); }
@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)); }
@Test(groups = {"DataPrepDocumentLibrary"}) public void dataPrep_Enterprise40x_3960() throws Exception { String testName = getTestName(); String testUser = getUserNameFreeDomain(testName); String siteName = getSiteName(testName); String fileName = getFileName(testName) + ".txt"; // User String[] testUserInfo = new String[] {testUser}; CreateUserAPI.CreateActivateUser(drone, ADMIN_USERNAME, testUserInfo); // Login ShareUser.login(drone, testUser, DEFAULT_PASSWORD); // Create Site ShareUser.createSite(drone, siteName, AbstractUtils.SITE_VISIBILITY_PUBLIC); ShareUser.openSiteDashboard(drone, siteName); ShareUser.openSitesDocumentLibrary(drone, siteName); // Upload File String[] fileInfo = {fileName, DOCLIB}; DocumentLibraryPage documentLibraryPage = ShareUser.uploadFileInFolder(drone, fileInfo).render(); // Upload New version of the document. for (int i = 0; i < 2; i++) { UpdateFilePage updatePage = documentLibraryPage.getFileDirectoryInfo(fileName).selectUploadNewVersion().render(); updatePage.selectMajorVersionChange(); String fileContents = String.format("New version of document %s: %s", i + 2, fileName); File newFileName = newFile(DATA_FOLDER + (fileName + getRandomString(3)), fileContents); updatePage.uploadFile(newFileName.getCanonicalPath()); updatePage.setComment(fileName); SitePage sitePage = updatePage.submit().render(); documentLibraryPage = (DocumentLibraryPage) sitePage.render(); FileUtils.forceDelete(newFileName); } }
@Test(groups = "EnterpriseOnly") public void Enterprise40x_5675() { /** Start Test */ testName = getTestName(); /** Test Data Setup */ String siteName = getSiteName(testName); String testUser = getUserNameFreeDomain(testName); String fileName = getFileName(testName) + ".txt"; String text = getRandomString(5); DocumentLibraryPage documentLibraryPage; // Login ShareUser.login(drone, testUser, DEFAULT_PASSWORD); documentLibraryPage = ShareUser.openSitesDocumentLibrary(drone, siteName); // Click Comment link near created file DocumentDetailsPage detailsPage = documentLibraryPage.getFileDirectoryInfo(fileName).clickCommentsLink().render(); // Write some text in text box and click Add Comment button detailsPage.addComment(text); // Go to document library and verify comment counter documentLibraryPage = ShareUser.openDocumentLibrary(drone); Assert.assertEquals(documentLibraryPage.getFileDirectoryInfo(fileName).getCommentsCount(), 1); // Go to Details page and delete the comment detailsPage = documentLibraryPage.selectFile(fileName); detailsPage.removeComment(text); // Go to document library and verify comment counter documentLibraryPage = ShareUser.openDocumentLibrary(drone); Assert.assertEquals(documentLibraryPage.getFileDirectoryInfo(fileName).getCommentsCount(), 0); }
/** * Test - AONE-13004: CRM property validation * * <ul> * <li>Login * <li>Access the document details page for the account content created Via SF * <li>Verify that document details page should be displayed. * <li>Access the document details page for the contract content created Via SF. * <li>Verify that document details page should be displayed correctly * <li>Access the document details page for the oppor content created Via SF. * <li>Verify that document details page should be displayed correctly * <li>Access the document details page for the case content created Via SF. * <li>Verify that document details page should be displayed correctly * </ul> */ @Test public void AONE_13885() throws PageException, Exception { // Login ShareUser.login(drone, salesforceUserName, salesforcePassword); // Opening Site Document library page ShareUser.openSitesDocumentLibrary(drone, siteName); // Account content details page DocumentLibraryPage docLibPage = ShareUserSitePage.navigateToFolder(drone, attachments_Folder + SLASH + accountName); DocumentDetailsPage detailsPage = ShareUser.openDocumentDetailPage(drone, account_Content); // Get the properties from details page Map<String, Object> properties = detailsPage.getProperties(); Assert.assertNotNull(properties); Assert.assertFalse(properties.isEmpty()); Assert.assertTrue( ((String) properties.get("AccountIdentifier")).equalsIgnoreCase(accountIdentifier)); Assert.assertTrue(((String) properties.get("AccountName")).equalsIgnoreCase(accountName)); // Opening Site Document library page ShareUser.openDocumentLibrary(drone); // Contract content details page docLibPage = ShareUserSitePage.navigateToFolder( drone, attachments_Folder + SLASH + contractNameOrNumber); detailsPage = ShareUser.openDocumentDetailPage(drone, contract_Content); // Get the properties from details page properties.clear(); properties = detailsPage.getProperties(); Assert.assertNotNull(properties); Assert.assertFalse(properties.isEmpty()); Assert.assertTrue( ((String) properties.get("AccountIdentifier")).equalsIgnoreCase(accountIdentifier)); Assert.assertTrue( ((String) properties.get("ContractNumber")).equalsIgnoreCase(contractNameOrNumber)); Assert.assertTrue( ((String) properties.get("ContractName")).equalsIgnoreCase(contractNameOrNumber)); // Opening Site Document library page ShareUser.openDocumentLibrary(drone); // Opportunity content details page docLibPage = ShareUserSitePage.navigateToFolder(drone, attachments_Folder + SLASH + oppName); detailsPage = ShareUser.openDocumentDetailPage(drone, oppo_Content); // Get the properties from details page properties.clear(); properties = detailsPage.getProperties(); Assert.assertNotNull(properties); Assert.assertFalse(properties.isEmpty()); Assert.assertTrue( ((String) properties.get("AccountIdentifier")).equalsIgnoreCase(accountIdentifier)); Assert.assertTrue(((String) properties.get("OpportunityName")).equalsIgnoreCase(oppName)); // Opening Site Document library page ShareUser.openDocumentLibrary(drone); // Case content details page docLibPage = ShareUserSitePage.navigateToFolder(drone, attachments_Folder + SLASH + caseNameOrNumber); detailsPage = ShareUser.openDocumentDetailPage(drone, case_Content); // Get the properties from details page properties.clear(); properties = detailsPage.getProperties(); Assert.assertNotNull(properties); Assert.assertFalse(properties.isEmpty()); Assert.assertTrue( ((String) properties.get("AccountIdentifier")).equalsIgnoreCase(accountIdentifier)); Assert.assertTrue(((String) properties.get("CaseNumber")).equalsIgnoreCase(caseNameOrNumber)); Assert.assertTrue(((String) properties.get("CaseName")).equalsIgnoreCase(caseNameOrNumber)); }