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
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
34    def "If we type in the wrong password"() {
35        when:
[948]36        login('admin', 'bogus')
[901]37
38        then:
[947]39        at LoginPage
40        verifyLoginFailureMessage()
[901]41    }
42
43}
Note: See TracBrowser for help on using the repository browser.