@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)); }