vendredi 18 septembre 2015

Geb cannot see my class as content page

When i try to run my test i get this Exception:

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?

Here my test class

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 IndexFactPage
        then: $("form", name: code).find("input", type: "button")
    }
}

And below the class who describe my page content

import geb.Page

class IndexFactPage 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") }      
}

}

Please help me to resolve my class IndexFactPage as a content page..

Thank you in advance..

Aucun commentaire:

Enregistrer un commentaire