public T handleWebLoginIfRequired(String username, String password) { if (usernameField.isPresent()) { usernameField.type(username); passwordField.type(password); submitButton.click(); } return nextPage; }
public void doLogout() { // accessing tag name as workaround for permission denied to access property 'nr@context' issue PageElementUtils.permissionDeniedWorkAround(usernameOrEmailInput); if (userDropdownTriggerLink.isPresent()) { // only do the logout if the user drop down is present, i.e., if the user is logged in. userDropdownTriggerLink.click(); logoutLink.click(); } }
private Iterable<Workflow> parseWorkflowTable(PageElement table, final WorkflowStatus status) { if (!table.isPresent()) { return Collections.emptyList(); } final List<PageElement> rows = table.findAll(By.cssSelector("tbody tr")); return transform( rows, new Function<PageElement, Workflow>() { @Override public Workflow apply(PageElement input) { List<PageElement> columns = input.findAll(By.tagName("td")); return new Workflow(columns, status); } }); }
public List<String> getProjects() { openDialog(); String href = getTriggerElement().getAttribute("href"); int triggerTargetStart = href.indexOf("#"); String dialogId = "inline-dialog-" + href.substring(triggerTargetStart + 1); PageElement dialog = elementFinder.find(By.id(dialogId)); assertTrue("The dialog did not appear to open.", dialog.isPresent()); List<PageElement> elements = dialog.findAll(By.tagName("li")); List<String> projects = new ArrayList<String>(elements.size()); for (PageElement element : elements) { projects.add(element.getText()); } closeDialog(); return projects; }
public boolean hasCopyOperation() { return copyElement.isPresent(); }
private boolean isModuleOpen(PageElement moduleElement) { return moduleElement.isPresent() && !moduleElement.hasClass("collapsed"); }
/** * Checks if the drop down has the specified operation * * @param operation the link text used to check for operation existence, e.g. "Edit Details" * @return true, if a link with the specified link text exists */ public boolean hasOperation(final String operation) { PageElement menuItem = rootMenuElement.find(By.linkText(operation)); return menuItem.isPresent() && menuItem.isVisible(); }
boolean isSubtasksEnabled() { return issueTypeRadio.isPresent() && subtaskRadio.isPresent(); }
public boolean isPresent() { return container.isPresent(); }