@Test(dependsOnMethods = "getSitesNoSite", groups = { "alfresco-one" }) public void getSites() { SiteUtil.createSite(drone, siteName1, "description", "Public"); SiteUtil.createSite(drone, siteName2, "description", "Public"); SiteDashboardPage siteDashboardPage = FactorySharePage.resolvePage(drone).render(); myprofile = siteDashboardPage.getNav().selectMyProfile().render(); userSitesPage = myprofile.getProfileNav().selectSites().render(); List<UserSiteItem> userSiteItems = userSitesPage.getSites(); List<String> siteNames = new ArrayList<String>(2); siteNames.add(siteName1); siteNames.add(siteName2); assertTrue(userSiteItems.size()>=2); for (UserSiteItem userSiteItem : userSiteItems) { siteNames.contains(userSiteItem.getSiteName()); } }
public List<UserSiteItem> getSites() { List<UserSiteItem> sites = new ArrayList<>(); try { List<WebElement> elements = drone.findAndWaitForElements(SITES_LIST); for (WebElement el : elements) { UserSiteItem site = new UserSiteItem(el, drone); sites.add(site); } } catch (TimeoutException e) { logger.error("Unable to find any sites in " + SITES_LIST, e); } return sites; }
UserSitesPage extends SharePage { public List<UserSiteItem> getSites() { List<UserSiteItem> sites = new ArrayList<>(); try { List<WebElement> elements = drone.findAndWaitForElements(SITES_LIST); for (WebElement el : elements) { UserSiteItem site = new UserSiteItem(el, drone); sites.add(site); } } catch (TimeoutException e) { logger.error("Unable to find any sites in " + SITES_LIST, e); } return sites; } }
UserSitesPage extends SharePage { public List<UserSiteItem> getSites() { List<UserSiteItem> sites = new ArrayList<>(); try { List<WebElement> elements = drone.findAndWaitForElements(SITES_LIST); for (WebElement el : elements) { UserSiteItem site = new UserSiteItem(el, drone); sites.add(site); } } catch (TimeoutException e) { logger.error("Unable to find any sites in " + SITES_LIST, e); } return sites; } UserSitesPage(WebDrone drone); }
UserSitesPage extends SharePage { public List<UserSiteItem> getSites() { List<UserSiteItem> sites = new ArrayList<>(); try { List<WebElement> elements = drone.findAndWaitForElements(SITES_LIST); for (WebElement el : elements) { UserSiteItem site = new UserSiteItem(el, drone); sites.add(site); } } catch (TimeoutException e) { logger.error("Unable to find any sites in " + SITES_LIST, e); } return sites; } UserSitesPage(WebDrone drone); @SuppressWarnings("unchecked") @Override UserSitesPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override UserSitesPage render(); @SuppressWarnings("unchecked") @Override UserSitesPage render(final long time); ProfileNavigation getProfileNav(); boolean isNoSiteMessagePresent(); List<UserSiteItem> getSites(); UserSiteItem getSite(String siteName); }
UserSitesPage extends SharePage { public List<UserSiteItem> getSites() { List<UserSiteItem> sites = new ArrayList<>(); try { List<WebElement> elements = drone.findAndWaitForElements(SITES_LIST); for (WebElement el : elements) { UserSiteItem site = new UserSiteItem(el, drone); sites.add(site); } } catch (TimeoutException e) { logger.error("Unable to find any sites in " + SITES_LIST, e); } return sites; } UserSitesPage(WebDrone drone); @SuppressWarnings("unchecked") @Override UserSitesPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override UserSitesPage render(); @SuppressWarnings("unchecked") @Override UserSitesPage render(final long time); ProfileNavigation getProfileNav(); boolean isNoSiteMessagePresent(); List<UserSiteItem> getSites(); UserSiteItem getSite(String siteName);  }