/** * Saving the google doc with the minor version and if isCreate boolean value is true for saving * the new google doc otherwise existing google doc. Methods used for edition by concurrent user's * * @param drone WebDrone * @param isCreateDoc boolean * @return SharePage */ public static SharePage saveGoogleDocOtherEditor(WebDrone drone, boolean isCreateDoc) { EditInGoogleDocsPage googleDocsPage = ShareUser.getSharePage(drone).render(); googleDocsPage.setGoogleCreate(isCreateDoc); GoogleDocsUpdateFilePage googleUpdatefile = googleDocsPage.selectSaveToAlfresco().render(); googleUpdatefile.render(); googleUpdatefile.selectMinorVersionChange(); return googleUpdatefile.submitWithConcurrentEditors().render(); }
/** * Saves the google doc with the given comments as minor or major version. * * @param drone WebDrone * @param comments String * @param isMinorVersion boolean * @return GoogleDocsUpdateFilePage */ public static GoogleDocsUpdateFilePage saveGoogleDocWithVersionAndComment( WebDrone drone, String comments, boolean isMinorVersion) { EditInGoogleDocsPage googleDocsPage = drone.getCurrentPage().render(); GoogleDocsUpdateFilePage googleUpdateFile = googleDocsPage.selectSaveToAlfresco().render(); if (isMinorVersion) { googleUpdateFile.selectMinorVersionChange(); } else { googleUpdateFile.selectMajorVersionChange(); } if (!StringUtils.isEmpty(comments)) { googleUpdateFile.setComment(comments); } return googleUpdateFile; }
/** * Saving the google doc with the minor version and if isCreate boolean value is true for saving * the new google doc otherwise existing google doc. * * @param drone WebDrone * @param isCreateDoc boolean * @return SharPage */ public static SharePage saveGoogleDoc(WebDrone drone, boolean isCreateDoc) { EditInGoogleDocsPage googleDocsPage = ShareUser.getSharePage(drone).render(); googleDocsPage.setGoogleCreate(isCreateDoc); if (isGoogleDocsV3) { String title = googleDocsPage.getDocumentTitle(); closeAndSwitchToShare(drone); SharePage currPage = ShareUser.getSharePage(drone).render(); if (currPage instanceof DocumentDetailsPage) { return ((DocumentDetailsPage) currPage).clickCheckInGoogleDoc().submit().render(); } else if (currPage instanceof DocumentLibraryPage) { return ((DocumentLibraryPage) currPage) .getFileDirectoryInfo(title) .selectCheckInGoogleDoc() .submit() .render(); } } else { GoogleDocsUpdateFilePage googleUpdatefile = googleDocsPage.selectSaveToAlfresco().render(); googleUpdatefile.render(); googleUpdatefile.selectMinorVersionChange(); return googleUpdatefile.submit().render(); } throw new PageOperationException("Unable to save Google Doc"); }