Ejemplo n.º 1
0
 public T handleWebLoginIfRequired(String username, String password) {
   if (usernameField.isPresent()) {
     usernameField.type(username);
     passwordField.type(password);
     submitButton.click();
   }
   return nextPage;
 }
Ejemplo n.º 2
0
  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();
    }
  }
Ejemplo n.º 3
0
 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);
         }
       });
 }
Ejemplo n.º 4
0
  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;
  }
Ejemplo n.º 5
0
 public boolean hasCopyOperation() {
   return copyElement.isPresent();
 }
Ejemplo n.º 6
0
 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();
 }
Ejemplo n.º 9
0
 public boolean isPresent() {
   return container.isPresent();
 }