Rev | Line | |
---|
[901] | 1 | import gnumims.functional.pages.HomePage |
---|
[927] | 2 | import gnumims.functional.pages.LoginPage |
---|
[901] | 3 | import spock.lang.Stepwise |
---|
| 4 | |
---|
| 5 | @Stepwise |
---|
[929] | 6 | class LoginSpec extends GebReportingSpecBase { |
---|
[901] | 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 |
---|
[912] | 19 | form.j_username = "admin" |
---|
| 20 | form.j_password = "pass" |
---|
[901] | 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 |
---|
[912] | 39 | form.j_username = "admin" |
---|
[901] | 40 | form.j_password = "bogus" |
---|
| 41 | login.click(LoginPage) |
---|
| 42 | |
---|
| 43 | then: |
---|
[912] | 44 | $("div.login_message").text() == "[admin] wrong username/password." |
---|
[901] | 45 | } |
---|
| 46 | |
---|
| 47 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.