source: branches/features/purchaseOrders/test/functional/gnumims/functional/LoginSpec.groovy @ 929

Last change on this file since 929 was 929, checked in by gav, 13 years ago

Add GebReportingSpecBase class.

File size: 1.1 KB
Line 
1package gnumims.functional
2
3import gnumims.functional.pages.HomePage
4import gnumims.functional.pages.LoginPage
5import spock.lang.Stepwise
6
7@Stepwise
8class LoginSpec extends GebReportingSpecBase {
9
10    def "We start at the login page"() {
11        when:
12        go getBaseUrl()
13
14        then:
15        $("h1").text() == "Welcome to gnuMims please log in"
16    }
17
18    def "When we click login we go to the home page"() {
19        when:
20        to LoginPage
21        form.j_username = "admin"
22        form.j_password = "pass"
23        login.click(HomePage)
24
25        then:
26        at(HomePage)
27    }
28
29    def "When we click logout, we go back to the login page"() {
30        when:
31        to HomePage
32        logout.click()
33
34        then:
35        at(LoginPage)
36    }
37
38    def "If we type in the wrong password"() {
39        when:
40        to LoginPage
41        form.j_username = "admin"
42        form.j_password = "bogus"
43        login.click(LoginPage)
44
45        then:
46        $("div.login_message").text() == "[admin] wrong username/password."
47    }
48
49}
Note: See TracBrowser for help on using the repository browser.