I have a secured grails application with the spring security plugin and right now I am trying to do some tests with the login process with no success till now. Has anybody an idea of what is the problem?
This is my LoginPage.groovy
package pages.login
import geb.Page
class LoginPage extends Page {
static url = "login/auth"
static at = {
title ==~ /Login/
}
static content = {
loginForm { $("form") }
username { $("input", type:"text", name:"j_username") }
password { $("input", type:"password", name:"j_password") }
loginButton{ $("input", type:"submit", value:"Login") }
}
}
And this is the test using junit4:
import geb.junit4.GebReportingTest
import pages.copyright.*
import pages.login.LoginPage
import org.junit.Test
class CopyrightCRUDTests extends GebReportingTest {
@Test
void doSomeCrud() {
to LoginPage
at LoginPage
$("form").j_username() << "admin"
$("form").j_password() << "XXXXX"
loginButton.click()
to AuthenticatedPage
at AuthenticatedPage
}
}
The AuthenticatedPage is a page which needs authentication, but in this moment it is imposible to be authenticated using geb. Does anybody know anything about this issue?
Thanks in advance!
at LoginPageis unnecessary - Armand