@Test(dependsOnMethods = "selectTagNode", groups = "alfresco-one") public void getTagCount() throws Exception { TreeMenuNavigation treeMenuNav = documentLibPage.getLeftMenus(); int tagCount = treeMenuNav.getTagCount(tagName); assertEquals(tagCount, 1); }
public int getTagCount(String tagName) { if (tagName == null) { throw new IllegalArgumentException("TagName is required."); } tagName = tagName.toLowerCase(); try { String xpath = TreeMenu.TAGS.getXpath() + String.format(TAG_NODE, tagName) + "/.."; String count = drone.findAndWait(By.xpath(xpath)).getText(); return Integer.parseInt(count.substring(count.indexOf("(") + 1, count.indexOf(")"))); } catch (TimeoutException te) { logger.error("Exceeded time to find out the " + tagName + " count: ", te); } catch (NumberFormatException ne) { logger.error("Unable to convert tags count string value into int : ", ne); } throw new PageOperationException("Unable to find the given tag count : " + tagName); }
TreeMenuNavigation extends SharePage { public int getTagCount(String tagName) { if (tagName == null) { throw new IllegalArgumentException("TagName is required."); } tagName = tagName.toLowerCase(); try { String xpath = TreeMenu.TAGS.getXpath() + String.format(TAG_NODE, tagName) + "/.."; String count = drone.findAndWait(By.xpath(xpath)).getText(); return Integer.parseInt(count.substring(count.indexOf("(") + 1, count.indexOf(")"))); } catch (TimeoutException te) { logger.error("Exceeded time to find out the " + tagName + " count: ", te); } catch (NumberFormatException ne) { logger.error("Unable to convert tags count string value into int : ", ne); } throw new PageOperationException("Unable to find the given tag count : " + tagName); } }
TreeMenuNavigation extends SharePage { public int getTagCount(String tagName) { if (tagName == null) { throw new IllegalArgumentException("TagName is required."); } tagName = tagName.toLowerCase(); try { String xpath = TreeMenu.TAGS.getXpath() + String.format(TAG_NODE, tagName) + "/.."; String count = drone.findAndWait(By.xpath(xpath)).getText(); return Integer.parseInt(count.substring(count.indexOf("(") + 1, count.indexOf(")"))); } catch (TimeoutException te) { logger.error("Exceeded time to find out the " + tagName + " count: ", te); } catch (NumberFormatException ne) { logger.error("Unable to convert tags count string value into int : ", ne); } throw new PageOperationException("Unable to find the given tag count : " + tagName); } TreeMenuNavigation(WebDrone drone); }
TreeMenuNavigation extends SharePage { public int getTagCount(String tagName) { if (tagName == null) { throw new IllegalArgumentException("TagName is required."); } tagName = tagName.toLowerCase(); try { String xpath = TreeMenu.TAGS.getXpath() + String.format(TAG_NODE, tagName) + "/.."; String count = drone.findAndWait(By.xpath(xpath)).getText(); return Integer.parseInt(count.substring(count.indexOf("(") + 1, count.indexOf(")"))); } catch (TimeoutException te) { logger.error("Exceeded time to find out the " + tagName + " count: ", te); } catch (NumberFormatException ne) { logger.error("Unable to convert tags count string value into int : ", ne); } throw new PageOperationException("Unable to find the given tag count : " + tagName); } TreeMenuNavigation(WebDrone drone); @SuppressWarnings("unchecked") @Override TreeMenuNavigation render(RenderTime timer); @SuppressWarnings("unchecked") @Override TreeMenuNavigation render(); @SuppressWarnings("unchecked") @Override TreeMenuNavigation render(final long time); HtmlPage selectDocumentNode(DocumentsMenu docMenu); HtmlPage selectTagNode(String tagName); HtmlPage selectNode(TreeMenu treeMenu, String... nodePath); List<String> getNodeChildren(TreeMenu treeMenu, String... nodePath); boolean isMenuTreeVisible(TreeMenu treeMenu); boolean isDocumentNodeVisible(DocumentsMenu docMenu); int getTagCount(String tagName); }
TreeMenuNavigation extends SharePage { public int getTagCount(String tagName) { if (tagName == null) { throw new IllegalArgumentException("TagName is required."); } tagName = tagName.toLowerCase(); try { String xpath = TreeMenu.TAGS.getXpath() + String.format(TAG_NODE, tagName) + "/.."; String count = drone.findAndWait(By.xpath(xpath)).getText(); return Integer.parseInt(count.substring(count.indexOf("(") + 1, count.indexOf(")"))); } catch (TimeoutException te) { logger.error("Exceeded time to find out the " + tagName + " count: ", te); } catch (NumberFormatException ne) { logger.error("Unable to convert tags count string value into int : ", ne); } throw new PageOperationException("Unable to find the given tag count : " + tagName); } TreeMenuNavigation(WebDrone drone); @SuppressWarnings("unchecked") @Override TreeMenuNavigation render(RenderTime timer); @SuppressWarnings("unchecked") @Override TreeMenuNavigation render(); @SuppressWarnings("unchecked") @Override TreeMenuNavigation render(final long time); HtmlPage selectDocumentNode(DocumentsMenu docMenu); HtmlPage selectTagNode(String tagName); HtmlPage selectNode(TreeMenu treeMenu, String... nodePath); List<String> getNodeChildren(TreeMenu treeMenu, String... nodePath); boolean isMenuTreeVisible(TreeMenu treeMenu); boolean isDocumentNodeVisible(DocumentsMenu docMenu); int getTagCount(String tagName); static final String REPOSITORY_ROOT_PROPERTY; static final String DOCUMENT_LIBRARY_ROOT_PROPERTY; static final String CATEGORY_ROOT_PROPERTY; static final String SHARED_FILES_ROOT_PROPERTY; }