| 1 | import gnumims.functional.pages.HomePage |
|---|
| 2 | import gnumims.functional.pages.LoginPage |
|---|
| 3 | import gnumims.functional.pages.LogoutPage |
|---|
| 4 | import spock.lang.Stepwise |
|---|
| 5 | |
|---|
| 6 | @Stepwise |
|---|
| 7 | class LoginSpec extends GebReportingSpecBase { |
|---|
| 8 | |
|---|
| 9 | def "We start at the login page"() { |
|---|
| 10 | when: |
|---|
| 11 | go baseUrl |
|---|
| 12 | |
|---|
| 13 | then: |
|---|
| 14 | at LoginPage |
|---|
| 15 | } |
|---|
| 16 | |
|---|
| 17 | def "When we login, we go to the home page"() { |
|---|
| 18 | when: |
|---|
| 19 | login('admin', 'pass') |
|---|
| 20 | |
|---|
| 21 | then: |
|---|
| 22 | at HomePage |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | def "When we logout, we go to the logout page"() { |
|---|
| 26 | when: |
|---|
| 27 | logout.click() |
|---|
| 28 | |
|---|
| 29 | then: |
|---|
| 30 | at LogoutPage |
|---|
| 31 | verifyLogoutMessage() |
|---|
| 32 | } |
|---|
| 33 | |
|---|
| 34 | def "If we type in the wrong password or username"() { |
|---|
| 35 | expect: |
|---|
| 36 | login(username, password) |
|---|
| 37 | at LoginPage |
|---|
| 38 | verifyLoginFailureMessage() |
|---|
| 39 | |
|---|
| 40 | where: |
|---|
| 41 | username | password |
|---|
| 42 | 'admin' | 'bogus' /* Bogus Password. */ |
|---|
| 43 | 'admin' | '' // Blank. |
|---|
| 44 | 'admin' | 'PASS' // Capitals |
|---|
| 45 | 'admin' | 'Pass' // First Capital. |
|---|
| 46 | 'admin' | 'pasS' // Last Capital. |
|---|
| 47 | 'admin' | 'pas' // One letter short. |
|---|
| 48 | 'admin' | 'passs' // One letter longer. |
|---|
| 49 | 'admin' | 'pass ' // Trailing space. |
|---|
| 50 | 'admin' | '*' // Star Wildcard. |
|---|
| 51 | 'admin' | '%' // Percentage Wildcard. |
|---|
| 52 | 'admin' | '.' // Dot Wildcard. |
|---|
| 53 | 'admin' | 'pas*' // Star Wildcard in pattern. |
|---|
| 54 | 'admin' | 'pas%' // Percentage Wildcard in pattern. |
|---|
| 55 | 'bogus' | 'pass' /* Bogus Username. */ |
|---|
| 56 | '' | 'pass' // Blank |
|---|
| 57 | 'ADMIN' | 'pass' // Capitals |
|---|
| 58 | 'Admin' | 'pass' // First Capital. |
|---|
| 59 | 'admiN' | 'pass' // Last Capital. |
|---|
| 60 | 'admi' | 'pass' // One letter short. |
|---|
| 61 | 'adminn' | 'pass' // One letter longer. |
|---|
| 62 | //'admin ' | 'pass' // Trailing space. |
|---|
| 63 | '*' | 'pass' // Star Wildcard. |
|---|
| 64 | '%' | 'pass' // Percentage Wildcard. |
|---|
| 65 | '.' | 'pass' // Dot Wildcard. |
|---|
| 66 | 'admi*' | 'pass' // Star Wildcard in pattern. |
|---|
| 67 | 'admi%' | 'pass' // Percentage Wildcard in pattern. |
|---|
| 68 | } |
|---|
| 69 | |
|---|
| 70 | } |
|---|