GrailsInAction / graina2

Source code for the 2nd edition of Grails in Action
90 stars 92 forks source link

MEAP v13 ch09 Listing for Timeline Page #81

Closed danhyun closed 10 years ago

danhyun commented 10 years ago

Using geb 0.9.2

The static at verification fails. In addition to [https://github.com/GrailsInAction/graina2/issues/70], the selector for title is returning an empty set in the navigator object.

Failure:  |
Submitting a new post(com.grailsinaction.UserTimelineFunctionalSpec)
 |
Assertion failed: 

$("title").text()
|          |
|          ""
[[[[[ChromeDriver: chrome on XP (1ae2004ddb96ddce6bdcf7385471acd3)] -> tag name: html]] -> css selector: title]]

It seems that the page abstraction also provides a title as a member of the Page object. The following at verification works:

static at = {
    title.startsWith("Hubbub ${StringEscapeUtils.unescapeHtml("»")} Timeline for ")
    $(".allPosts")
}

Also, as you are aware, as of Grails 2.3, spock is automatically included as a plugin so there is no need to add spock as a manual dependency.

pledbrook commented 10 years ago

That seems odd. I'll check that when I come back to this chapter. Thanks for the report.

pledbrook commented 10 years ago

Somebody pointed me at a StackOverflow question, which explains why this is the case.

pledbrook commented 10 years ago

I've added a quick explanation to the chapter manuscript.