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

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

Functional test, extend 'If we type in the wrong password or username' to be data driven.

File size: 2.1 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
5
6@Stepwise
[929]7class LoginSpec extends GebReportingSpecBase {
[901]8
9    def "We start at the login page"() {
10        when:
[947]11        go baseUrl
[901]12
13        then:
[947]14        at LoginPage
[901]15    }
16
[948]17    def "When we login, we go to the home page"() {
[901]18        when:
[948]19        login('admin', 'pass')
[901]20
21        then:
[947]22        at HomePage
[901]23    }
24
[948]25    def "When we logout, we go to the logout page"() {
[901]26        when:
27        logout.click()
28
29        then:
[947]30        at LogoutPage
31        verifyLogoutMessage()
[901]32    }
33
[949]34    def "If we type in the wrong password or username"() {
35        expect:
36        login(username, password)
[947]37        at LoginPage
38        verifyLoginFailureMessage()
[949]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.
[901]68    }
69
70}
Note: See TracBrowser for help on using the repository browser.