@Test(groups="Enterprise4.2") public void getAddedItems() throws Exception { SelectContentPage contentPage = newWorkflowPage.clickAddItems().render(); Assert.assertTrue(contentPage.isOkButtonPresent()); Assert.assertTrue(contentPage.isCancelButtonPresent()); Assert.assertTrue(contentPage.isCompanyHomeButtonPresent()); List<String> elements = contentPage.getDirectoriesLeftPanel(); Assert.assertTrue(elements.contains("Data Dictionary") && elements.contains("Guest Home") && elements.contains("Imap Attachments") && elements.contains("IMAP Home") && elements.contains("Shared") && elements.contains("Sites") && elements.contains("User Homes")); Content content1 = new Content(); content1.setName("Doc3"); content1.setFolder(false); Content content2 = new Content(); content2.setName("Doc1"); content2.setFolder(false); Content content3 = new Content(); content3.setName("Doc2"); content3.setFolder(false); Content content4 = new Content(); content4.setFolder(true); content4.setName("Folder1"); Set<Content> contents4 = new HashSet<Content>(); Content content41 = new Content(); content41.setFolder(false); content41.setName("F1Doc1"); contents4.add(content41); content4.setContents(contents4); Content content5= new Content(); content5.setFolder(true); content5.setName("Folder2"); Content content51 = new Content(); content51.setFolder(true); content51.setName("Folder11"); Content content52 = new Content(); content52.setFolder(true); content52.setName("Folder21"); Site site2 = new Site(); site2.setName(siteName); Content content53 = new Content(); content53.setFolder(false); content53.setName("Doc211"); Set<Content> contents5 = new HashSet<Content>(); contents5.add(content53); content52.setContents(contents5); Set<Content> contents51 = new HashSet<Content>(); contents51.add(content52); content51.setContents(contents51); Set<Content> contents52 = new HashSet<Content>(); contents52.add(content51); content5.setContents(contents52); Set<Content> site2Contents = new HashSet<Content>(); site2Contents.add(content5); site2Contents.add(content4); site2Contents.add(content1); site2Contents.add(content2); site2Contents.add(content3); site2.setContents(site2Contents); CompanyHome companyHome = new CompanyHome(); Set<Site> sites = new HashSet<Site>(); sites.add(site2); companyHome.setSites(sites); contentPage.addItems(companyHome); Assert.assertTrue(contentPage.isRemoveIconPresent(content1.getName())); Assert.assertTrue(contentPage.isRemoveIconPresent(content2.getName())); List<String> expectedItems = new ArrayList<String>(); expectedItems.add(content1.getName()); expectedItems.add(content2.getName()); expectedItems.add(content3.getName()); expectedItems.add(content41.getName()); expectedItems.add(content53.getName()); Assert.assertTrue(CollectionUtils.subtract(contentPage.getAddedItems(), expectedItems).isEmpty()); contentPage.selectOKButton(); }
public List<String> getAddedItems() { List<String> items = new ArrayList<String>(); List<WebElement> elements = drone.findAll(addedContents); if (elements != null) { for (WebElement webElement : elements) { items.add(webElement.getText()); } } else { items = Collections.emptyList(); } return items; }
SelectContentPage extends SharePage { public List<String> getAddedItems() { List<String> items = new ArrayList<String>(); List<WebElement> elements = drone.findAll(addedContents); if (elements != null) { for (WebElement webElement : elements) { items.add(webElement.getText()); } } else { items = Collections.emptyList(); } return items; } }
SelectContentPage extends SharePage { public List<String> getAddedItems() { List<String> items = new ArrayList<String>(); List<WebElement> elements = drone.findAll(addedContents); if (elements != null) { for (WebElement webElement : elements) { items.add(webElement.getText()); } } else { items = Collections.emptyList(); } return items; } SelectContentPage(WebDrone drone); }
SelectContentPage extends SharePage { public List<String> getAddedItems() { List<String> items = new ArrayList<String>(); List<WebElement> elements = drone.findAll(addedContents); if (elements != null) { for (WebElement webElement : elements) { items.add(webElement.getText()); } } else { items = Collections.emptyList(); } return items; } SelectContentPage(WebDrone drone); @SuppressWarnings("unchecked") @Override SelectContentPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override SelectContentPage render(); @SuppressWarnings("unchecked") @Override SelectContentPage render(final long time); void addItems(CompanyHome companyHome); void clickFolderUpButton(); void clickElementOnLeftPanel(String text); List<String> getDirectoriesLeftPanel(); List<String> getAddedItems(); void renderCurrentAvailableItem(String name); HtmlPage selectOKButton(); boolean isFolderUpButtonEnabled(); void addItemFromSite(String fileName, String siteName); boolean isAddIconPresent(String fileName); void removeItem(String fileName); boolean isRemoveIconPresent(String fileName); void selectCloseButton(); void selectCancelButton(); void navigateToRootDir(); String getNoItemsSelected(); boolean isCancelButtonPresent(); boolean isOkButtonPresent(); boolean isCompanyHomeButtonPresent(); }
SelectContentPage extends SharePage { public List<String> getAddedItems() { List<String> items = new ArrayList<String>(); List<WebElement> elements = drone.findAll(addedContents); if (elements != null) { for (WebElement webElement : elements) { items.add(webElement.getText()); } } else { items = Collections.emptyList(); } return items; } SelectContentPage(WebDrone drone); @SuppressWarnings("unchecked") @Override SelectContentPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override SelectContentPage render(); @SuppressWarnings("unchecked") @Override SelectContentPage render(final long time); void addItems(CompanyHome companyHome); void clickFolderUpButton(); void clickElementOnLeftPanel(String text); List<String> getDirectoriesLeftPanel(); List<String> getAddedItems(); void renderCurrentAvailableItem(String name); HtmlPage selectOKButton(); boolean isFolderUpButtonEnabled(); void addItemFromSite(String fileName, String siteName); boolean isAddIconPresent(String fileName); void removeItem(String fileName); boolean isRemoveIconPresent(String fileName); void selectCloseButton(); void selectCancelButton(); void navigateToRootDir(); String getNoItemsSelected(); boolean isCancelButtonPresent(); boolean isOkButtonPresent(); boolean isCompanyHomeButtonPresent();  }