本文整理了Java中org.jboss.arquillian.graphene.wait.WebDriverWait.withMessage()
方法的一些代码示例,展示了WebDriverWait.withMessage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebDriverWait.withMessage()
方法的具体详情如下:
包路径:org.jboss.arquillian.graphene.wait.WebDriverWait
类名称:WebDriverWait
方法名:withMessage
暂无
代码示例来源: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
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
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
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
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
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: 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
private void selectYear(int year) {
int yearsPickerSize = getYears().size();
int yearInTheFirstColumn = Integer.parseInt(getFirstYear().getText());
int diff = year - yearInTheFirstColumn;
// scroll to year
if (diff > 0 && diff >= yearsPickerSize) {
while (diff > 0) {
nextDecade();
diff -= yearsPickerSize;
}
} else {
while (diff < 0) {
previousDecade();
diff += yearsPickerSize;
}
}
// select year
WebElement yearElement = getRootElement().findElement(ByJQuery.selector("div[id*='DateEditorLayoutY']:contains('" + year + "')"));
yearElement.click();
Graphene.waitGui().withMessage("Waiting for year to be selected.").until().element(yearElement).attribute("class").contains(getSelectedClass());
}
代码示例来源: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
public void waitUntilIsVisible() {
Graphene.waitModel().withMessage("Waiting for time spinner to be visible.").until().element(getRootElement()).is().visible();
}
代码示例来源:origin: arquillian/arquillian-graphene
@Test
public void testWithMessageAndMessageUntil() {
String message = "blah blah blah blah blah";
try {
Graphene.waitGui()
.withMessage("srhjkfsdbhfjkfbsdnbfm,sndbsdmnbf")
.until(message)
.element(BY_HEADER)
.text()
.equalTo("sjkldhkdjfgjlkfg");
Assert.fail(TimeoutException.class.getName() + " should be thrown.");
} catch (TimeoutException e) {
Assert.assertTrue("The exception message <" + e.getMessage() + "> should contain message <" + message + "> defined by 'withMessage()' method", e.getMessage().contains(message));
}
}
代码示例来源:origin: arquillian/arquillian-graphene
@Test
public void testWithMessage() {
String message = "blah blah blah blah blah";
try {
Graphene.waitGui()
.withMessage(message)
.until()
.element(BY_HEADER)
.text()
.equalTo("sjkldhkdjfgjlkfg");
Assert.fail(TimeoutException.class.getName() + " should be thrown.");
} catch (TimeoutException e) {
Assert.assertTrue("The exception message <" + e.getMessage() + "> should contain message <" + message + "> defined by 'withMessage()' method", e.getMessage().contains(message));
}
}
代码示例来源: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());
}
}
代码示例来源:origin: org.richfaces/richfaces-page-fragments
@Override
public void close() {
new Actions(driver).moveToElement(advanced().getRootElement()).perform();
Graphene.waitModel().until().element(advanced().getCloseIconElement()).is().visible();
final List<WebElement> messages = driver.findElements(By.cssSelector("div.rf-ntf-cnt"));
final int sizeBefore = messages.size();
new Actions(driver).click(advanced().getCloseIconElement()).perform();
Graphene.waitModel().withMessage("The message did not disappear.").until(new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver input) {
return messages.size() == (sizeBefore - 1);
}
});
}
内容来源于网络,如有侵权,请联系作者删除!