Привет, я получил эту ошибку, когда пытаюсь запустить свой тест.
Пожалуйста, помогите мне понять, почему он не может нажать на кнопку отправки
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>