Geb can't recognize my content page -> Unable to resolve code as content for pages

798 views
Skip to first unread message

Bocar Alpha Ba

unread,
Sep 18, 2015, 9:03:25 AM9/18/15
to Geb User Mailing List


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"(){
}
}

Kito Mann

unread,
Sep 18, 2015, 9:18:22 AM9/18/15
to geb-...@googlegroups.com
It looks like you didn't declare "code" or you meant for "code" to be a String value, not a variable. 
--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/869c7b1e-f55e-4678-a288-fa145a21a1c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
___

Kito D. Mann | @kito99 | Author, JSF in Action
Virtua, Inc. | http://www.virtua.com | JSF/Java EE training and consulting
http://www.JSFCentral.com | @jsfcentral
+1 203-998-0403

* Listen to the Enterprise Java Newscast: http://enterprisejavanews.com
* JSFCentral Interviews Podcast: http://www.jsfcentral.com/resources/jsfcentralpodcasts/
* Sign up for the JSFCentral Newsletter: http://oi.vresp.com/?fid=ac048d0e17

Reply all
Reply to author
Forward
0 new messages