Beispiel #1
0
 public void select(int index) {
   final WebElement toSelect = getItemElement(index);
   toSelect.click();
   Graphene.waitAjax()
       .withMessage("The requested item hasn't been selected.")
       .until(Graphene.attribute(toSelect, "class").valueContains("rf-ord-sel"));
 }
Beispiel #2
0
 @Test(groups = "Future")
 public void testClickOnTheNextMonthAndJSErrorIsThrown() {
   page.getLog().changeLevel(LogEntryLevel.ERROR);
   page.getShowCalendarButton().click();
   Graphene.waitAjax().until().element(page.getNextMonthScroller()).is().visible();
   guardAjax(page.getNextMonthScroller()).click();
   assertTrue(
       page.getLog().getLogEntries().isEmpty(), "There should be no errors on the log screen!");
 }
 @Test(groups = {"RF-11871"})
 public void testStop() throws InterruptedException {
   getPage().getButton().click();
   String before = getPage().getDate().getText();
   Thread.sleep(1500);
   Graphene.waitAjax()
       .withMessage("After clicking on the stop button, there should be not updates.")
       .until(new WebElementConditionFactory(getPage().getDate()).textEquals(before));
 }
 public void toggle() {
   final int before = expanded.size();
   toggle.click();
   Graphene.waitAjax()
       .until(
           new ExpectedCondition<Boolean>() {
             @Override
             public Boolean apply(WebDriver input) {
               return expanded.size() != before;
             }
           });
 }
  @Test
  @RegressionTest("https://issues.jboss.org/browse/RF-11313")
  public void testConverterMessage() {
    String errorMsg = "conversion error";
    calendarAttributes.set(CalendarAttributes.enableManualInput, Boolean.TRUE);
    calendarAttributes.set(CalendarAttributes.converterMessage, errorMsg);

    calendar.getInput().sendKeys("RF 4");
    submitWithA4jSubmitBtn();
    Graphene.waitAjax().until(message.isVisibleCondition());

    assertEquals(message.getDetail(), errorMsg);
  }
Beispiel #6
0
 public void selectFromPopupByIndex(int index) {
   if (!isPopupPresent()) {
     throw new IllegalStateException(
         "The popup is not present, so the user can't select an option.");
   }
   WebElement option =
       getPopup().findElement(By.xpath("span//span[@class='rf-is-opt'][" + (index + 1) + "]"));
   final String expectedValue = option.getText();
   option.click();
   Graphene.waitAjax()
       .withMessage("The option <" + index + "> can't be selected.")
       .until(
           new ExpectedCondition<Boolean>() {
             @Override
             public Boolean apply(WebDriver arg0) {
               return getText().equals(expectedValue);
             }
           });
 }
Beispiel #7
0
 public void waitUntilResultOutputIsNotEmpty() {
   Graphene.waitAjax().until().element(resultOutput).text().not().equalTo("");
 }
Beispiel #8
0
 private void waitUntilPopupPresent() {
   Graphene.waitAjax()
       .withMessage("The popup isn't present.")
       .until(new WebElementConditionFactory(getPopup()).isPresent());
 }