Hii
I got this error when a launch my tests classes
groovy.lang.MissingPropertyException: Unable to resolve code as content for pages.FactIndexPage, or as a property on its Navigator context. Is code a class you forgot to import?
below my FactIndexPage who describe my page and FactControllerSpec who contains my functional tests..
Thank you for helping me to configure FactIndexPage as a content page
import geb.Page
class FactIndexPage extends Page {
static url = "/fact/mmapay"
static at = {
$("h2").text() == "Pour régler votre facture, veuillez saisir:" }
static content = {
codeField { $("input[name = code]") }
nomField { $("input[name = nom]") }
prenomField { $("input[name = prenom]") }
montantField { $("input[name = montant]") }
chercher1 { $("input", type: "button") }
abandonner1 { $("input", type: "button") }
}
}
import geb.spock.GebReportingSpec
import pages.*
import spock.lang.Stepwise
@Stepwise
class FactControllerSpec extends GebReportingSpec {
def "test de la presence du code dans la page d'acceuil"() {
given: "test que le champ code de facture est bien present"
when:
to FactIndexPage
then: $("form", name: code).find("input", type: "button")
}
def "entrer dans la page de detail de facture"(){
}
}