@Override public void perform() { Graphene.waitGui().until().element(item).attribute("class").contains(OrderingListInPickList.SELECTED_ITEM_CLASS); } })
@Override protected void performWait(FluentWait<WebDriver, Void> wait) { wait.until().element(getMenuPopup()).is().visible(); } }.withMessage("The " + getNameOfFragment() + " did not show in the given timeout!")
@Override protected void performWait(FluentWait<WebDriver, Void> wait) { wait.until().element(getRoot()).is().not().visible(); } }.withMessage("Waiting for header controls to be not visible.")
@Override protected void performWait(FluentWait<WebDriver, Void> wait) { wait.until().element(getMenuPopup()).is().not().visible(); } }.withMessage("Waiting for menu to hide.")
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(); }
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); }
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 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()); } }
@Override public void perform() { Graphene.waitGui().until().element(getRootElement()).attribute("class").contains(getStyleClassForSelectedItem()); } })
private void switchTo(By by) { WebElement element = advanced().getRootElement().findElement(by); element.click(); Graphene.waitModel().until().element(element).attribute("class").contains(advanced().getActiveClass()); }
@Override public void deselectRow(int rowIndex, Keys... keys) { clickOnRow(rowIndex, keys); Graphene.waitAjax().until().element(advanced().getTableRowsElements().get(rowIndex)).attribute("class").not() .contains(advanced().getStyleClassForSelectedRow()); }
@Test public void testElementTextEqualsIgnoreCase() { textInput.clear(); textInput.sendKeys("florence and the machine"); updateButton.click(); Graphene.waitModel().until().element(header).text().equalToIgnoreCase("FLORENCE aNd THE machIne"); textInput.sendKeys("Tested Header"); updateButton.click(); Graphene.waitModel().until().element(header).text().not().equalToIgnoreCase("FLORENCE aNd THE machIne"); }
@Test public void testElementTextContainsWithBy() { textInput.clear(); textInput.sendKeys("florence and the machine"); updateButton.click(); Graphene.waitModel().until().element(BY_HEADER).text().contains("machine"); textInput.clear(); textInput.sendKeys("Tested Header"); updateButton.click(); Graphene.waitModel().until().element(BY_HEADER).text().not().contains("machine"); }
@Test public void testElementIsClickable() { Graphene.waitModel().until().element(hideButton).is().clickable(); hideButton.click(); Graphene.waitModel().until().element(hideButton).is().not().clickable(); Graphene.waitModel().until().element(appearButton).is().clickable(); appearButton.click(); Graphene.waitModel().until().element(appearButton).is().not().clickable(); }
@Test public void testElementIsSelected() { loadPage(); checkElementIsSelected(Graphene.waitModel().until().element(BY_JQUERY_OPTION1)); }
@Test public void testValueEquals() { checkAttributeValueEquals(Graphene.waitModel().until().element(BY_TEXT_INPUT).value()); } }