I was wondering what the expected outcome should be of attempting to click 
on an element that does not exist within a page, but has the `required: 
false` option applied to it.

Given this page:

class SomePage {

  ...

  static content = {
    button(required: false) { 
$('.some-incorrect-selector').module(SomeButtonModule) }

    ...
  }

}


and given this Spec:

class SomeSpec {

  def 'Clicking on the button should take user to AnotherPage' () {

    given:
      def page = to SomePage

    when:
      page.button.click()

    then:
      at AnotherPage
  }
}



When the button doesn't exist on `SomePage` the test is still reaching the 
`at` check for `AnotherPage`, I would have thought that an exception would 
have been thrown when the button element is missing and can't be clicked.


-- 
You received this message because you are subscribed to the Google Groups "Geb 
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/6473dd1f-5120-46f9-becc-4c4e404c3b66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to