Incorrect <title> tag found by Geb in Grails app

84 views Asked by At

The page title is "Page1" (https://github.com/biomq/geb-example-grails/blob/master/grails-app/views/person/page1.gsp#L8), but the Page DSL is checking for a title of "Person List" (https://github.com/biomq/geb-example-grails/blob/master/test/functional/pages/LinkPage1.groovy#L9).

To run tests: grails -Dgeb.env=firefox test-app functional:

If you edit LinkPage1's title ==~ /Page1/ to the incorrect value title ==~ /Person List/ [as it is now, in the repo] while leaving Page1 in page1.gsp, the test passes! The test failure then occurs further down with 'testLink' "page content not found".

If you edit person/page1.gsp and replace g:link controller="Person" action="page2" id="testLink" ... with a href="/person/page2" id="testLink"... i.e. provide an explicit testLink id, and use testLink { $("#testLink") } in LinkPage1.groovy, the page content not found error persists.

hmmmm...

1

There are 1 answers

0
erdi On

It should be to LinkPage1 and not at LinkPage1 here if you want to go to /person/page1.gsp. Have a look at the Book of Geb, the difference between at() and to() is described there.