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

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

Functional tests, factor out login method.

File size: 851 bytes
Line 
1import gnumims.functional.pages.HomePage
2import gnumims.functional.pages.LoginPage
3import gnumims.functional.pages.LogoutPage
4import spock.lang.Stepwise
5
6@Stepwise
7class 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"() {
35        when:
36        login('admin', 'bogus')
37
38        then:
39        at LoginPage
40        verifyLoginFailureMessage()
41    }
42
43}
Note: See TracBrowser for help on using the repository browser.