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
Line 
1import gnumims.functional.pages.HomePage
2import gnumims.functional.pages.LoginPage
3import gnumims.functional.pages.LogoutPage
4import spock.lang.Stepwise
5import spock.lang.Unroll
6
7@Stepwise
8class LoginSpec extends GebReportingSpecBase {
9
10    def "We start at the login page"() {
11        when:
12        go baseUrl
13
14        then:
15        at LoginPage
16    }
17
18    def "When we login, we go to the home page"() {
19        when:
20        login('admin', 'pass')
21
22        then:
23        at HomePage
24    }
25
26    def "When we logout, we go to the logout page"() {
27        when:
28        logout.click()
29
30        then:
31        at LogoutPage
32        verifyLogoutMessage()
33    }
34
35    //@Unroll("Username: '#username' with password: '#password' should fail to login.")
36    def "If we type in the wrong password or username"() {
37        expect:
38        login(username, password)
39        at LoginPage
40        verifyLoginFailureMessage()
41
42        where:
43        username  | password
44        'admin'   | 'bogus' /* Bogus Password. */
45        'admin'   | ''      // None.
46        'admin'   | ' '      // Blank.
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.
52        'admin'   | ' pass' // Leading space.
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. */
60        ''        | 'pass'  // None
61        ' '       | 'pass'  // Blank
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.
67        //' admin'  | 'pass' // Leading space.
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.
74    }
75
76}
Note: See TracBrowser for help on using the repository browser.