Ignore:
Timestamp:
May 29, 2011, 10:52:16 AM (13 years ago)
Author:
gav
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/features/purchaseOrders/test/functional/LoginSpec.groovy

    r937 r947  
    11import gnumims.functional.pages.HomePage
    22import gnumims.functional.pages.LoginPage
     3import gnumims.functional.pages.LogoutPage
    34import spock.lang.Stepwise
    45
     
    89    def "We start at the login page"() {
    910        when:
    10         go getBaseUrl()
     11        go baseUrl
    1112
    1213        then:
    13         $("h1").text() == "Welcome to gnuMims please log in"
     14        at LoginPage
    1415    }
    1516
     
    1920        form.j_username = "admin"
    2021        form.j_password = "pass"
    21         login.click(HomePage)
     22        login.click()
    2223
    2324        then:
    24         at(HomePage)
     25        at HomePage
    2526    }
    2627
    27     def "When we click logout, we go back to the login page"() {
     28    def "When we click logout, we go to the logout page"() {
    2829        when:
    29         to HomePage
    3030        logout.click()
    3131
    3232        then:
    33         at(LoginPage)
     33        at LogoutPage
     34        verifyLogoutMessage()
    3435    }
    3536
     
    3940        form.j_username = "admin"
    4041        form.j_password = "bogus"
    41         login.click(LoginPage)
     42        login.click()
    4243
    4344        then:
    44         $("div.login_message").text() == "[admin] wrong username/password."
     45        at LoginPage
     46        verifyLoginFailureMessage()
    4547    }
    4648
Note: See TracChangeset for help on using the changeset viewer.