@Test(groups={"unit"}) public void resolveUrls() { WebDroneProperties properties = new ShareProperties(AlfrescoVersion.Enterprise41.toString()); WebDrone drone = new WebDroneImpl(new HtmlUnitDriver(), properties); try { long start = System.currentTimeMillis(); SharePage page = resolvePage(dashboard, "dashboard", drone); Assert.assertTrue(page instanceof DashBoardPage); page = resolvePage(documentDetailsPage, "documentDetailsPage", drone); Assert.assertTrue(page instanceof DocumentDetailsPage); page = resolvePage(documentLibrary, "documentLibrary", drone); Assert.assertTrue(page instanceof DocumentLibraryPage); page = resolvePage(documentLibrary2, "documentLibrary2", drone); Assert.assertTrue(page instanceof DocumentLibraryPage); page = resolvePage(siteDashboard, "siteDashboard", drone); Assert.assertTrue(page instanceof SiteDashboardPage); page = resolvePage(dataList, "dataList", drone); Assert.assertTrue(page instanceof DataListPage); page = resolvePage(myTasks, "myTasks", drone); Assert.assertTrue(page instanceof MyTasksPage); page = resolvePage(peopleFinder, "peopleFinder", drone); Assert.assertTrue(page instanceof PeopleFinderPage); page = resolvePage(myProfile, "myProfile", drone); Assert.assertTrue(page instanceof MyProfilePage); page = resolvePage(siteFinder, "siteFinder", drone); Assert.assertTrue(page instanceof SiteFinderPage); page = resolvePage(wiki, "wiki", drone); Assert.assertTrue(page instanceof WikiPage); page = resolvePage(wikiList, "wikiList", drone); Assert.assertTrue(page instanceof WikiPageList); page = resolvePage(changePaswword, "changePaswword", drone); Assert.assertTrue(page instanceof ChangePasswordPage); page = resolvePage(repository, "repository", drone); Assert.assertTrue(page instanceof RepositoryPage); page = resolvePage(repositoryWithFolder, "repository", drone); Assert.assertTrue(page instanceof RepositoryPage); page = resolvePage(managePermission, "managePermission", drone); Assert.assertTrue(page instanceof ManagePermissionsPage); page = resolvePage(createPlainText, "createPlainText", drone); Assert.assertTrue(page instanceof CreatePlainTextContentPage); page = resolvePage(createHtmlText, "createHtmlText", drone); Assert.assertTrue(page instanceof CreateHtmlContentPage); page = resolvePage(createXmlText, "createXmlText", drone); Assert.assertTrue(page instanceof CreatePlainTextContentPage); page = resolvePage(inlineEdit, "inlineEdit", drone); Assert.assertTrue(page instanceof InlineEditPage); page = resolvePage(editDocumentProperties, "editDocumentProperties", drone); Assert.assertTrue(page instanceof EditDocumentPropertiesPage); page = resolvePage(siteMembers, "siteMembers", drone); Assert.assertTrue(page instanceof org.alfresco.po.share.site.SiteMembersPage); page = resolvePage(invite, "invite", drone); Assert.assertTrue(page instanceof InviteMembersPage); page = resolvePage(newuser, "newuser", drone); Assert.assertTrue(page instanceof NewUserPage); page = resolvePage(customizeSite, "customizeSite", drone); Assert.assertTrue(page instanceof CustomizeSitePage); page = resolvePage(customizeSiteDashboard, "customizeSiteDashboard", drone); Assert.assertTrue(page instanceof CustomiseSiteDashboardPage); page = resolvePage(foldersDetailsPage, "foldersDetailsPage", drone); Assert.assertTrue(page instanceof FolderDetailsPage); page = resolvePage(googleDocs, "editGoogleDocs", drone); Assert.assertTrue(page instanceof EditInGoogleDocsPage); page = resolvePage(myFilesPage, "myFilesPage", drone); Assert.assertTrue(page instanceof MyFilesPage); page = resolvePage(sharedFilesPage, "sharedFilesPage", drone); Assert.assertTrue(page instanceof SharedFilesPage); page = resolvePage(blogPage, "blog-postlist", drone); Assert.assertTrue(page instanceof BlogPage); page = resolvePage(postView, "blog-postview", drone); Assert.assertTrue(page instanceof PostViewPage); page = resolvePage(links, "links", drone); Assert.assertTrue(page instanceof LinksPage); page = resolvePage(pendingInvites, "pending-invites", drone); Assert.assertTrue(page instanceof PendingInvitesPage); page = resolvePage(advanceSearch, "advanceSearch", drone); Assert.assertTrue(page instanceof AdvanceSearchPage); page = resolvePage(advanceContentSearch, "advContent-search", drone); Assert.assertTrue(page instanceof AdvanceSearchContentPage); page = resolvePage(advanceFolderSearch, "advanceFolderSearch", drone); Assert.assertTrue(page instanceof AdvanceSearchFolderPage); page = resolvePage(searchResult, "searchResult", drone); Assert.assertTrue(page instanceof AllSitesResultsPage); page = resolvePage(searchResultAllSites, "searchResultAll", drone); Assert.assertTrue(page instanceof AllSitesResultsPage); page = resolvePage(searchResultRepository, "searchResultRepo", drone); Assert.assertTrue(page instanceof RepositoryResultsPage); page = resolvePage(siteSarchResult, "siteSearchResult", drone); Assert.assertTrue(page instanceof SiteResultsPage); page = resolvePage(userSearchPage, "userSearchPage", drone); Assert.assertTrue(page instanceof UserSearchPage); page = resolvePage(startWorkFlowPage, "start-workflow", drone); Assert.assertTrue(page instanceof StartWorkFlowPage); page = resolvePage(cloudSyncPage, "user-cloud-auth", drone); Assert.assertTrue(page instanceof CloudSyncPage); page = resolvePage(workFlowDetailsPage, "workflow-details", drone); Assert.assertTrue(page instanceof WorkFlowDetailsPage); page = resolvePage(myWorkFlowsPage, "my-workflows", drone); Assert.assertTrue(page instanceof MyWorkFlowsPage); page = resolvePage(editTasks, "edit-task", drone); Assert.assertTrue(page instanceof EditTaskPage); page = resolvePage(taskDetailsPage, "task-edit", drone); Assert.assertTrue(page instanceof MyWorkFlowsPage); page = resolvePage(editTaskPage, "task-details", drone); Assert.assertTrue(page instanceof MyWorkFlowsPage); page = resolvePage(languageSettingsPage, "change-locale", drone); Assert.assertTrue(page instanceof LanguageSettingsPage); page = resolvePage(groupsPage, "groups", drone); Assert.assertTrue(page instanceof GroupsPage); page = resolvePage(siteGroupsPage, "site-groups", drone); Assert.assertTrue(page instanceof SiteGroupsPage); page = resolvePage(addGroupsPage, "add-groups", drone); Assert.assertTrue(page instanceof AddGroupsPage); page = resolvePage(createNewTopicPage, "discussions-createtopic", drone); Assert.assertTrue(page instanceof CreateNewTopicPage); page = resolvePage(topicDetailsPage, "discussions-topicview", drone); Assert.assertTrue(page instanceof TopicDetailsPage); page = resolvePage(discussionsPage, "discussions-topiclist", drone); Assert.assertTrue(page instanceof DiscussionsPage); page = resolvePage(customiseUserDashboardPage, "customise-user-dashboard", drone); Assert.assertTrue(page instanceof CustomiseUserDashboardPage); page = resolvePage(nodeBrowserPage, "node-browser", drone); Assert.assertTrue(page instanceof NodeBrowserPage); page = resolvePage(adminConsolePage, "admin-console", drone); Assert.assertTrue(page instanceof AdminConsolePage); page = resolvePage(manageSitesPage, "manage-sites", drone); Assert.assertTrue(page instanceof ManageSitesPage); page = resolvePage(notificationPage, "user-notifications", drone); Assert.assertTrue(page instanceof NotificationPage); page = resolvePage(userSitesPage, "user-sites", drone); Assert.assertTrue(page instanceof UserSitesPage); page = resolvePage(facetedSearchPage, "faceted-search", drone); Assert.assertTrue(page instanceof FacetedSearchPage); page = resolvePage(userContentPage, "user-content", drone); Assert.assertTrue(page instanceof UserContentPage); long duration = System.currentTimeMillis() - start; logger.info("Total duration of test in milliseconds: " + duration); } finally { drone.quit(); } }
public static HtmlPage resolvePage(final WebDrone drone) throws PageException { if (drone.getTitle().toLowerCase().contains("login")) { return new LoginPage(drone); } else { try { WebElement errorPrompt = drone.find(By.cssSelector(FAILURE_PROMPT)); if (errorPrompt.isDisplayed()) { return new SharePopup(drone); } } catch (NoSuchElementException nse) { } try { WebElement shareDialogue = drone.findFirstDisplayedElement(By.cssSelector(SHARE_DIALOGUE)); if (shareDialogue.isDisplayed() || drone.findFirstDisplayedElement(COPY_MOVE_DIALOGUE_SELECTOR).isDisplayed()) { return resolveShareDialoguePage(drone); } } catch (NoSuchElementException nse) { } catch (StaleElementReferenceException ste) { } return getPage(drone.getCurrentUrl(), drone); } }
FactorySharePage implements PageFactory { public static HtmlPage resolvePage(final WebDrone drone) throws PageException { if (drone.getTitle().toLowerCase().contains("login")) { return new LoginPage(drone); } else { try { WebElement errorPrompt = drone.find(By.cssSelector(FAILURE_PROMPT)); if (errorPrompt.isDisplayed()) { return new SharePopup(drone); } } catch (NoSuchElementException nse) { } try { WebElement shareDialogue = drone.findFirstDisplayedElement(By.cssSelector(SHARE_DIALOGUE)); if (shareDialogue.isDisplayed() || drone.findFirstDisplayedElement(COPY_MOVE_DIALOGUE_SELECTOR).isDisplayed()) { return resolveShareDialoguePage(drone); } } catch (NoSuchElementException nse) { } catch (StaleElementReferenceException ste) { } return getPage(drone.getCurrentUrl(), drone); } } }
FactorySharePage implements PageFactory { public static HtmlPage resolvePage(final WebDrone drone) throws PageException { if (drone.getTitle().toLowerCase().contains("login")) { return new LoginPage(drone); } else { try { WebElement errorPrompt = drone.find(By.cssSelector(FAILURE_PROMPT)); if (errorPrompt.isDisplayed()) { return new SharePopup(drone); } } catch (NoSuchElementException nse) { } try { WebElement shareDialogue = drone.findFirstDisplayedElement(By.cssSelector(SHARE_DIALOGUE)); if (shareDialogue.isDisplayed() || drone.findFirstDisplayedElement(COPY_MOVE_DIALOGUE_SELECTOR).isDisplayed()) { return resolveShareDialoguePage(drone); } } catch (NoSuchElementException nse) { } catch (StaleElementReferenceException ste) { } return getPage(drone.getCurrentUrl(), drone); } }  }
FactorySharePage implements PageFactory { public static HtmlPage resolvePage(final WebDrone drone) throws PageException { if (drone.getTitle().toLowerCase().contains("login")) { return new LoginPage(drone); } else { try { WebElement errorPrompt = drone.find(By.cssSelector(FAILURE_PROMPT)); if (errorPrompt.isDisplayed()) { return new SharePopup(drone); } } catch (NoSuchElementException nse) { } try { WebElement shareDialogue = drone.findFirstDisplayedElement(By.cssSelector(SHARE_DIALOGUE)); if (shareDialogue.isDisplayed() || drone.findFirstDisplayedElement(COPY_MOVE_DIALOGUE_SELECTOR).isDisplayed()) { return resolveShareDialoguePage(drone); } } catch (NoSuchElementException nse) { } catch (StaleElementReferenceException ste) { } return getPage(drone.getCurrentUrl(), drone); } }  HtmlPage getPage(WebDrone drone); static HtmlPage resolvePage(final WebDrone drone); static SharePage getUnknownPage(final WebDrone drone); static SharePage getPage(final String url, WebDrone drone); }
FactorySharePage implements PageFactory { public static HtmlPage resolvePage(final WebDrone drone) throws PageException { if (drone.getTitle().toLowerCase().contains("login")) { return new LoginPage(drone); } else { try { WebElement errorPrompt = drone.find(By.cssSelector(FAILURE_PROMPT)); if (errorPrompt.isDisplayed()) { return new SharePopup(drone); } } catch (NoSuchElementException nse) { } try { WebElement shareDialogue = drone.findFirstDisplayedElement(By.cssSelector(SHARE_DIALOGUE)); if (shareDialogue.isDisplayed() || drone.findFirstDisplayedElement(COPY_MOVE_DIALOGUE_SELECTOR).isDisplayed()) { return resolveShareDialoguePage(drone); } } catch (NoSuchElementException nse) { } catch (StaleElementReferenceException ste) { } return getPage(drone.getCurrentUrl(), drone); } }  HtmlPage getPage(WebDrone drone); static HtmlPage resolvePage(final WebDrone drone); static SharePage getUnknownPage(final WebDrone drone); static SharePage getPage(final String url, WebDrone drone); static final String DOCUMENTLIBRARY; static final String NODE_REFRESH_META_DATA_IDENTIFIER; }