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

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

Formatting only.

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