Ejemplo n.º 1
0
  // the similar method in ext4Helper is looking for a property that does not exist to
  // decide if this is a multi-select box or not.
  public void multiSelectComboBoxItem(String label, @LoggedParam String... selections) {
    Locator.XPathLocator comboBox = Ext4Helper.Locators.formItemWithLabel(label);
    _ext4Helper.openComboList(comboBox);
    log("Hack-Nap while combo box gets filled. Maybe?");
    sleep(2000);

    try {
      for (String selection : selections) {
        log("Selecting " + selection);
        _ext4Helper.selectItemFromOpenComboList(selection, Ext4Helper.TextMatchTechnique.EXACT);
      }
    } catch (
        StaleElementReferenceException
            retry) // Combo-box might still be loading previous selection (no good way to detect)
    {
      for (String selection : selections) {
        log("Selecting " + selection);
        _ext4Helper.selectItemFromOpenComboList(selection, Ext4Helper.TextMatchTechnique.EXACT);
      }
    }

    log("Closing combo box " + label);
    Locator arrowTrigger = comboBox.append("//div[contains(@class,'arrow')]");
    arrowTrigger.findElement(this.getDriver()).click();
  }
Ejemplo n.º 2
0
 public void setTextFormValue(
     String key, String value, Boolean waitForSubmit, Boolean submitIsDisabled) {
   Locator fieldLocator = Locator.name(key);
   setFormElement(fieldLocator, value);
   if (waitForSubmit) {
     if (submitIsDisabled) waitForElement(Locators.disabledSaveAndCloseButton);
     else waitForElement(Locators.saveAndCloseButton);
   }
 }
Ejemplo n.º 3
0
 private static class Locators {
   static final Locator showOnDashField =
       Locator.css(".labkey-field-editor input.x4-form-checkbox");
   static final Locator saveButton = Locator.linkWithText("Save");
   static final Locator saveAndCloseButton = Locator.linkWithText("Save And Close");
   static final Locator disabledSaveAndCloseButton =
       Locator.css("a.x4-disabled")
           .withText("SAVE AND CLOSE"); // why do we need to have the all caps text here?
   static final Locator cancelButton = Locator.linkWithText("Cancel");
   static final Locator disabledWorkbenchButton =
       Locator.css("a.x4-disabled").withText("WORKBENCH");
   static final Locator manageTitle = Locator.css(".labkey-wp-title-text").containing("Manage");
   static final Locator updateTitle = Locator.css(".labkey-nav-page-header").containing("Update");
 }
Ejemplo n.º 4
0
 protected class Elements {
   Locator.CssLocator accession = Locator.css(".study-accession");
   Locator.CssLocator title = Locator.css(".study-title");
   Locator.CssLocator PI = Locator.css(".study-pi");
   Locator.CssLocator organization = Locator.css(".study-organization");
   Locator.CssLocator paper = Locator.css(".study-papers > p");
   Locator immportLink = Locator.linkWithText("ImmPort");
 }
Ejemplo n.º 5
0
 private class Elements {
   Locator journal = Locator.css(".pub-journal");
   Locator year = Locator.css(".pub-year");
   Locator title = Locator.css(".pub-title");
   Locator pubMedLink = Locator.linkWithText("PubMed");
 }
Ejemplo n.º 6
0
 private static class Locators {
   private static Locator self = Locator.css("div#demographics.study-demographics");
 }
Ejemplo n.º 7
0
 public String getFormValue(String field) {
   Locator fieldLocator = Locator.name(field);
   return getFormElement(fieldLocator);
 }