Skip to content

Instantly share code, notes, and snippets.

@walterg2
Created March 27, 2013 13:33
Show Gist options
  • Save walterg2/5254189 to your computer and use it in GitHub Desktop.
Save walterg2/5254189 to your computer and use it in GitHub Desktop.
CucmberJVM, SeleniumWebDriver, HTMLUnit, Geb issue: AJAX call firing when page loads is not able to be validated by script. As far as I'm aware, this should workas I'm waiting for the page to get the loanInformation object to be present
com.temp.myApp.cucumber.pages
import geb.Page
class HomePage extends Page {
static url = ""
static at = { title == "Home" }
static content = {
mainHeading { $('h1') }
loanInformation(required: false) { $('dl', 0) }
loanNumber(required: false) { $('dl > dd', 0) }
}
}
Scenario Outline: Home page is displayed with the loan information
When I go to the Home Page with <Loan Number> at the end of the URL
Then I should be presented with the Home Page
And I should see the loan number of <Loan Number>
package com.temp.myApp.cucumber.steps
this.metaClass.mixin(cucumber.api.groovy.EN)
Then(~'^I should see the loan number of (\\d+)$') { String loanNumber ->
waitFor(10) { page.loanInformation.present }
assert page.loanNumberText() == loanNumber
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment