@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; }
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); }
public void nextDecade() { String firstBefore = getFirstYear().getText(); getNextDecadeButtonElement().click(); Graphene.waitGui().withMessage("Waiting for decade to change.").until().element(getFirstYear()).text().not().equalTo(firstBefore); }
@Override public void perform() { Graphene.waitGui().until().element(item).attribute("class").contains(OrderingListInPickList.SELECTED_ITEM_CLASS); } })
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); }
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(); }
@Override public void clear() { advanced().getClearButtonElement().click(); Graphene.waitGui().until(new Predicate<WebDriver>() { @Override public boolean apply(WebDriver input) { return getLogEntries().isEmpty(); } }); }
public void previousDecade() { String firstBefore = getFirstYear().getText(); getPreviousDecadeButtonElement().click(); Graphene.waitGui().withMessage("Waiting for decade to change.").until().element(getFirstYear()).text().not().equalTo(firstBefore); }
@Override public void perform() { Graphene.waitGui().until().element(advanced().getItemsElements().get(0)).attribute("class").not().contains("rf-ord-sel"); } }).perform();
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); }
@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(); }
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); }
@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()); } }
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); }
@Override public void perform() { Graphene.waitGui().until().element(getRootElement()).attribute("class").contains(getStyleClassForSelectedItem()); } })
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); }
@Override public void perform() { Graphene.waitGui().until().element(getRootElement()).attribute("class").contains(getStyleClassForSelectedItem()); } })
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()); }
@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); }
@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()); } }