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

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

Location:
branches/features/purchaseOrders/test/functional/gnumims/functional/pages
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/features/purchaseOrders/test/functional/gnumims/functional/pages/HomePage.groovy

    r925 r947  
    11package gnumims.functional.pages
    22
    3 import geb.Page
    4 
    5 class HomePage extends Page {
    6     static url = "appCore/start"
    7 
    8     static at = { $("div#menu li.navigation_active").text() == "Home" }
     3class HomePage extends GrailsPage {
     4    static controller = "appCore"
     5    static action = "start"
    96
    107    static content = {
    118        message { $("div.body div.message").text() }
    12         logout(to:LoginPage) { $("a[class=logoutButton]") }
     9        logout(to:LogoutPage) { $("a[class=logoutButton]") }
    1310    }
    1411}
  • branches/features/purchaseOrders/test/functional/gnumims/functional/pages/LoginPage.groovy

    r938 r947  
    11package gnumims.functional.pages
    22
    3 import geb.Page
    4 
    5 class LoginPage extends Page {
    6     static url = "login/auth"
    7 
    8     static at = {$("h1").text() == "Welcome to gnuMims please log in"}
     3class LoginPage extends GrailsPage {
     4    static controller = "login"
     5    static action = "auth"
    96
    107    static content = {
    11         login { $('#loginForm input[value=Login]') }
     8        login(to:HomePage) { $('#loginForm input[value=Login]') }
    129        form { $("#loginForm") }
    1310        password { $("input[name=j_password]").value() }
     11        message { $("div.login_message").text() }
     12    }
     13
     14    def verifyLoginFailureMessage() {
     15        assert message.contains("wrong username/password.")
     16        return true
    1417    }
    1518}
Note: See TracChangeset for help on using the changeset viewer.