Line | |
---|
1 | package gnumims.functional |
---|
2 | |
---|
3 | import gnumims.functional.pages.HomePage |
---|
4 | import gnumims.functional.pages.LoginPage |
---|
5 | import spock.lang.Stepwise |
---|
6 | |
---|
7 | @Stepwise |
---|
8 | class 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.