Здравейте, получих тази грешка, когато се опитах да стартирам моя тест.
Моля, помогнете ми да разбера защо не може да щракне върху моя бутон за изпращане
geb.error.RequiredPageContentNotPresent: The required page content 'loginButton - SimplePageContent (owner: LoginPage, args: [], value: null)' is not present
Под моята страница за вход
import geb.Page
import pages.IndexPage
class LoginPage extends Page {
static url = "login/auth"
static at = { title == "[Paynum] Identification" }
static content = {
loginForm { $("form") }
loginButton { $("input", type: "submit") }
}
}
Под тестовата ми страница
import geb.spock.GebReportingSpec
import pages.*
import spock.lang.Stepwise
@Stepwise
class FactControllerSpec extends GebReportingSpec {
def "invalid login"() {
given: "I am at the login page"
to LoginPage
when: "I am entering invalid password"
loginForm.j_username = "bba"
loginForm.j_password = "Bocxy1990"
loginButton.click()
then: "I am being redirected to the login page, the password I entered is wrong"
at LoginPage
loginForm.j_username == "bba"
!loginButton.j_password
}
}
И ето фрагмент от моя бутон за изпращане
<div>
<button id='submit' type='submit'>
<em class='fa fa-sign-in fa-lg'></em>
<g:message code='springSecurity.login.button' />
</button>
</div>