Ниже моя страница и спецификации.Я могу ввести значение для firstName
, но я получаю приведенную ниже ошибку для lastName
.Я думал, что мы можем присвоить значение с помощью оператора '=' на основе Geb doc здесь http://www.gebish.org/manual/current/navigator.html#text_inputs_and_textareas
geb.error.UnresolvablePropertyException: Unable to resolve lastName as a property to set on NewConsumerApplicationPage's Navigator context
at geb.content.NavigableSupport.propertyMissing(NavigableSupport.groovy:141)
at geb.Browser.propertyMissing(Browser.groovy:182)
at geb.spock.GebSpec.propertyMissing(GebSpec.groovy:59)
at WorkItemSpec.Create workitem(WorkItemSpec.groovy:32)
Страница
class NewConsumerApplicationPage extends Page
{static content =
{
newApplicationForm
{ $("form", id: "newApplicationConsumerForm") }
firstName
{newApplicationForm.find("input", id: "newApplication_primaryApplicant:consumerIdentification:firstName")}
lastName
{newApplicationForm.find("input", id: "newApplication_primaryApplicant:consumerIdentification:lastName")}
submitButton
{
$("button", id: "newConsumerApplication_submit")
}
}
}
Spec
def "Create workitem"()
{
given : "I am successfully logged into the application"
to NewConsumerApplicationPage
when:
firstName.value "CCERASTOSTIGMA"
lastName = "PAULA"
submitButton.click()
then :
at ApplicationSummaryPage
}