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

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

Enhance and refactor functional tests to use pageId (for at{} verify) in main.gsp layout.

File size: 1.0 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
17    def "When we click login we go to the home page"() {
18        when:
19        to LoginPage
[912]20        form.j_username = "admin"
21        form.j_password = "pass"
[947]22        login.click()
[901]23
24        then:
[947]25        at HomePage
[901]26    }
27
[947]28    def "When we click logout, we go to the logout page"() {
[901]29        when:
30        logout.click()
31
32        then:
[947]33        at LogoutPage
34        verifyLogoutMessage()
[901]35    }
36
37    def "If we type in the wrong password"() {
38        when:
39        to LoginPage
[912]40        form.j_username = "admin"
[901]41        form.j_password = "bogus"
[947]42        login.click()
[901]43
44        then:
[947]45        at LoginPage
46        verifyLoginFailureMessage()
[901]47    }
48
49}
Note: See TracBrowser for help on using the repository browser.