org.jboss.arquillian.graphene.wait.WebDriverWait类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中org.jboss.arquillian.graphene.wait.WebDriverWait类的一些代码示例,展示了WebDriverWait类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebDriverWait类的具体详情如下:
包路径:org.jboss.arquillian.graphene.wait.WebDriverWait
类名称:WebDriverWait

WebDriverWait介绍

暂无

代码示例

代码示例来源:origin: org.richfaces/richfaces-page-fragments

@Override
public FileUpload clearAll() {
  advanced().getClearAllButtonElement().click();
  Graphene.waitGui().until(new Predicate<WebDriver>() {
    @Override
    public boolean apply(WebDriver input) {
      return advanced().getItems().isEmpty();
    }
  });
  return this;
}

代码示例来源:origin: org.jboss.arquillian.graphene/graphene-webdriver-impl

public RequestGuardFactory(RequestGuard guard, Document document, GrapheneContext context) {
  this.guard = guard;
  this.document = document;
  this.context = context;
  this.waitGuard = waitAjax()
    .withTimeout(context.getConfiguration().getWaitGuardInterval(), TimeUnit.SECONDS)
    .pollingEvery(Math.min(context.getConfiguration().getWaitGuardInterval() * 100, 200), TimeUnit.MILLISECONDS);
}

代码示例来源:origin: org.richfaces/richfaces-page-fragments

public void nextDecade() {
  String firstBefore = getFirstYear().getText();
  getNextDecadeButtonElement().click();
  Graphene.waitGui().withMessage("Waiting for decade to change.").until().element(getFirstYear()).text().not().equalTo(firstBefore);
}

代码示例来源:origin: org.richfaces/richfaces-page-fragments

@Override
  public void perform() {
    Graphene.waitGui().until().element(item).attribute("class").contains(OrderingListInPickList.SELECTED_ITEM_CLASS);
  }
})

代码示例来源:origin: arquillian/arquillian-graphene

public RequestGuardFactory(RequestGuard guard, Document document, GrapheneContext context) {
  this.guard = guard;
  this.document = document;
  this.context = context;
  this.waitGuard = waitAjax()
    .withTimeout(context.getConfiguration().getWaitGuardInterval(), TimeUnit.SECONDS)
    .pollingEvery(Math.min(context.getConfiguration().getWaitGuardInterval() * 100, 200), TimeUnit.MILLISECONDS);
}

代码示例来源:origin: org.richfaces/richfaces-page-fragments

public void cleanDate() {
  if (!isVisible()) {
    throw new RuntimeException("Footer controls are not displayed, cannot interact with  clean button");
  }
  if (!getCleanButtonElement().isDisplayed()) {
    throw new RuntimeException("Clean button is not displayed.");
  }
  getCleanButtonElement().click();
  Graphene.waitGui().withMessage("Waiting for clean button to be not visible.").until().element(getCleanButtonElement()).is().not().visible();
}

代码示例来源:origin: org.richfaces/richfaces-page-fragments

@Override
public void clear() {
  advanced().getClearButtonElement().click();
  Graphene.waitGui().until(new Predicate<WebDriver>() {
    @Override
    public boolean apply(WebDriver input) {
      return getLogEntries().isEmpty();
    }
  });
}

代码示例来源:origin: org.richfaces/richfaces-page-fragments

public void previousDecade() {
  String firstBefore = getFirstYear().getText();
  getPreviousDecadeButtonElement().click();
  Graphene.waitGui().withMessage("Waiting for decade to change.").until().element(getFirstYear()).text().not().equalTo(firstBefore);
}

代码示例来源:origin: org.richfaces/richfaces-page-fragments

@Override
  public void perform() {
    Graphene.waitGui().until().element(advanced().getItemsElements().get(0)).attribute("class").not().contains("rf-ord-sel");
  }
}).perform();

代码示例来源:origin: org.richfaces/richfaces-page-fragments

public void nextYear() {
  if (!isVisible() || !getNextYearElement().isDisplayed()) {
    throw new RuntimeException("Cannot interact with nextYear button. "
      + "Ensure that calendar popup and header controls are displayed.");
  }
  String before = getYearAndMonthEditorOpenerElement().getText();
  getNextYearElement().click();
  Graphene.waitAjax().withMessage("Waiting for year to change.").until().element(getYearAndMonthEditorOpenerElement()).text().not().equalTo(before);
}

代码示例来源:origin: cukespace/cukespace

@When("^I eat (\\d+) cukes$")
public void eatCukes(int cukes) throws IOException {
  waitAjax()/*we just loaded the page*/.until().element(bellyMouth).is().present();
  bellyMouth.sendKeys(Integer.toString(cukes));
  final File screenshot = new File("target/screenshots/eatCukes.png");
  screenshot.getParentFile().mkdirs();
  try (final OutputStream os = new FileOutputStream(screenshot)) {
    os.write(TakesScreenshot.class.cast(browser).getScreenshotAs(OutputType.BYTES));
  }
  waitGui()/*we are already on the page so faster wait cycle*/.until().element(bellyEat).is().present();
  bellyEat.click();
}

代码示例来源:origin: org.richfaces/richfaces-page-fragments

public void previousMonth() {
  if (!isVisible() || !getPreviousMonthElement().isDisplayed()) {
    throw new RuntimeException("Cannot interact with previousMonth button. "
      + "Ensure that calendar popup and header controls are displayed.");
  }
  String before = getYearAndMonthEditorOpenerElement().getText();
  getPreviousMonthElement().click();
  Graphene.waitAjax().withMessage("Waiting for month to change.").until().element(getYearAndMonthEditorOpenerElement()).text().not().equalTo(before);
}

代码示例来源:origin: org.richfaces/richfaces-page-fragments

@Override
public void selectAllRowsWithKeyShortcut() {
  advanced().getTableBodyElement().sendKeys(Keys.chord(Keys.CONTROL, "a"));
  if (advanced().getTableRowsElements().size() >= 1) {
    Graphene.waitAjax().until().element(advanced().getTableRowsElements().get(0)).attribute("class")
      .contains(advanced().getStyleClassForSelectedRow());
    Graphene.waitAjax().until()
      .element(advanced().getTableRowsElements().get(advanced().getTableRowsElements().size() - 1))
      .attribute("class").contains(advanced().getStyleClassForSelectedRow());
  }
}

代码示例来源:origin: org.richfaces/richfaces-page-fragments

public void nextMonth() {
  if (!isVisible() || !getNextMonthElement().isDisplayed()) {
    throw new RuntimeException("Cannot interact with nextMonth button. "
      + "Ensure that calendar popup and header controls are displayed.");
  }
  String before = getYearAndMonthEditorOpenerElement().getText();
  getNextMonthElement().click();
  Graphene.waitAjax().withMessage("Waiting for month to change.").until().element(getYearAndMonthEditorOpenerElement()).text().not().equalTo(before);
}

代码示例来源:origin: org.richfaces/richfaces-page-fragments

@Override
  public void perform() {
    Graphene.waitGui().until().element(getRootElement()).attribute("class").contains(getStyleClassForSelectedItem());
  }
})

代码示例来源:origin: org.richfaces/richfaces-page-fragments

public void previousYear() {
  if (!isVisible() || !getPreviousYearElement().isDisplayed()) {
    throw new RuntimeException("Cannot interact with previousYear button. "
      + "Ensure that calendar popup and header controls are displayed.");
  }
  String before = getYearAndMonthEditorOpenerElement().getText();
  getPreviousYearElement().click();
  Graphene.waitAjax().withMessage("Waiting for year to change.").until().element(getYearAndMonthEditorOpenerElement()).text().not().equalTo(before);
}

代码示例来源:origin: org.richfaces/richfaces-page-fragments

@Override
  public void perform() {
    Graphene.waitGui().until().element(getRootElement()).attribute("class").contains(getStyleClassForSelectedItem());
  }
})

代码示例来源:origin: org.richfaces/richfaces-page-fragments

private void selectMonth(int month) {
  WebElement monthElement = getRootElement().findElement(By.cssSelector("div[id*='DateEditorLayoutM" + (month - 1) + "']"));
  monthElement.click();
  Graphene.waitGui().withMessage("Waiting for month to be selected.").until().element(monthElement).attribute("class").contains(getSelectedClass());
}

代码示例来源:origin: org.richfaces/richfaces-page-fragments

@Override
public void switchTo(DataScrollerSwitchButton btn) {
  String prevPageText = advanced().getActivePageElement().getText();
  advanced().getButtonElement(btn).click();
  Graphene.waitModel().until().element(advanced().getActivePageElement()).text().not().equalTo(prevPageText);
}

代码示例来源:origin: org.richfaces/richfaces-page-fragments

@Override
  public void select(boolean deselectOthers) {
    // https://issues.jboss.org/browse/RF-14033
    getRootElement().click();
    Graphene.waitGui().withMessage("Waiting for day to be selected.").until().element(getRootElement()).attribute("class").contains(getStyleClassForSelectedItem());
  }
}

相关文章