@Test(dependsOnMethods = "selectDocumentNode", groups = "alfresco-one") public void selectNode() throws Exception { TreeMenuNavigation treeMenuNav = documentLibPage.getLeftMenus(); documentLibPage = treeMenuNav.selectNode(TreeMenu.LIBRARY, folderName1, folderName2).render(); List<FileDirectoryInfo> files = documentLibPage.getFiles(); assertTrue(files.size() == 2); }
public HtmlPage selectNode(TreeMenu treeMenu, String... nodePath) { if (treeMenu == null) { throw new IllegalArgumentException("TreeMenu is required."); } if (nodePath == null) { throw new IllegalArgumentException("Node path is required."); } if (treeMenu == TreeMenu.DOCUMENTS || treeMenu == TreeMenu.TAGS) { throw new IllegalArgumentException("Not supported for menu " + treeMenu); } List<String> nodes = new ArrayList<>(Arrays.asList(nodePath)); String node = nodes.get(nodes.size() - 1); nodes.remove(nodes.size() - 1); expandNode(treeMenu, nodes); String xpath = treeMenu.getXpath() + String.format(TREE_NODE_ELEMENT, node); By nodeLocator = By.xpath(xpath); try { drone.find(nodeLocator).click(); } catch (NoSuchElementException e) { throw new PageOperationException("Unable to find element " + nodeLocator, e); } return FactorySharePage.resolvePage(drone); }
TreeMenuNavigation extends SharePage { public HtmlPage selectNode(TreeMenu treeMenu, String... nodePath) { if (treeMenu == null) { throw new IllegalArgumentException("TreeMenu is required."); } if (nodePath == null) { throw new IllegalArgumentException("Node path is required."); } if (treeMenu == TreeMenu.DOCUMENTS || treeMenu == TreeMenu.TAGS) { throw new IllegalArgumentException("Not supported for menu " + treeMenu); } List<String> nodes = new ArrayList<>(Arrays.asList(nodePath)); String node = nodes.get(nodes.size() - 1); nodes.remove(nodes.size() - 1); expandNode(treeMenu, nodes); String xpath = treeMenu.getXpath() + String.format(TREE_NODE_ELEMENT, node); By nodeLocator = By.xpath(xpath); try { drone.find(nodeLocator).click(); } catch (NoSuchElementException e) { throw new PageOperationException("Unable to find element " + nodeLocator, e); } return FactorySharePage.resolvePage(drone); } }
TreeMenuNavigation extends SharePage { public HtmlPage selectNode(TreeMenu treeMenu, String... nodePath) { if (treeMenu == null) { throw new IllegalArgumentException("TreeMenu is required."); } if (nodePath == null) { throw new IllegalArgumentException("Node path is required."); } if (treeMenu == TreeMenu.DOCUMENTS || treeMenu == TreeMenu.TAGS) { throw new IllegalArgumentException("Not supported for menu " + treeMenu); } List<String> nodes = new ArrayList<>(Arrays.asList(nodePath)); String node = nodes.get(nodes.size() - 1); nodes.remove(nodes.size() - 1); expandNode(treeMenu, nodes); String xpath = treeMenu.getXpath() + String.format(TREE_NODE_ELEMENT, node); By nodeLocator = By.xpath(xpath); try { drone.find(nodeLocator).click(); } catch (NoSuchElementException e) { throw new PageOperationException("Unable to find element " + nodeLocator, e); } return FactorySharePage.resolvePage(drone); } TreeMenuNavigation(WebDrone drone); }
TreeMenuNavigation extends SharePage { public HtmlPage selectNode(TreeMenu treeMenu, String... nodePath) { if (treeMenu == null) { throw new IllegalArgumentException("TreeMenu is required."); } if (nodePath == null) { throw new IllegalArgumentException("Node path is required."); } if (treeMenu == TreeMenu.DOCUMENTS || treeMenu == TreeMenu.TAGS) { throw new IllegalArgumentException("Not supported for menu " + treeMenu); } List<String> nodes = new ArrayList<>(Arrays.asList(nodePath)); String node = nodes.get(nodes.size() - 1); nodes.remove(nodes.size() - 1); expandNode(treeMenu, nodes); String xpath = treeMenu.getXpath() + String.format(TREE_NODE_ELEMENT, node); By nodeLocator = By.xpath(xpath); try { drone.find(nodeLocator).click(); } catch (NoSuchElementException e) { throw new PageOperationException("Unable to find element " + nodeLocator, e); } return FactorySharePage.resolvePage(drone); } 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 HtmlPage selectNode(TreeMenu treeMenu, String... nodePath) { if (treeMenu == null) { throw new IllegalArgumentException("TreeMenu is required."); } if (nodePath == null) { throw new IllegalArgumentException("Node path is required."); } if (treeMenu == TreeMenu.DOCUMENTS || treeMenu == TreeMenu.TAGS) { throw new IllegalArgumentException("Not supported for menu " + treeMenu); } List<String> nodes = new ArrayList<>(Arrays.asList(nodePath)); String node = nodes.get(nodes.size() - 1); nodes.remove(nodes.size() - 1); expandNode(treeMenu, nodes); String xpath = treeMenu.getXpath() + String.format(TREE_NODE_ELEMENT, node); By nodeLocator = By.xpath(xpath); try { drone.find(nodeLocator).click(); } catch (NoSuchElementException e) { throw new PageOperationException("Unable to find element " + nodeLocator, e); } return FactorySharePage.resolvePage(drone); } 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; }