@Override protected void performWait(FluentWait<WebDriver, Void> wait) { wait.until().element(getMenuPopup()).is().visible(); } }.withMessage("The " + getNameOfFragment() + " did not show in the given timeout!")
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 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.")
@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(); }
@Override public void perform() { Graphene.waitGui().until().element(element).is().present(); Utils.triggerJQ((JavascriptExecutor) driver, event.getEventName(), element); } });
@Test public void testElementIsPresent() { idInput.clear(); idInput.sendKeys("header2"); updateButton.click(); Graphene.waitModel(browser).until().element(header).is().not().present(); idInput.clear(); idInput.sendKeys("header"); updateButton.click(); Graphene.waitModel(browser).until().element(header).is().present(); }
@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 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 testElementIsClickableWithBy() { Graphene.waitModel().until().element(BY_HIDE_BUTTON).is().clickable(); hideButton.click(); Graphene.waitModel().until().element(BY_HIDE_BUTTON).is().not().clickable(); Graphene.waitModel().until().element(BY_APPEAR_BUTTON).is().clickable(); appearButton.click(); Graphene.waitModel().until().element(BY_APPEAR_BUTTON).is().not().clickable(); }