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

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

Add @Unroll (optional/commented) to LoginSpec.

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