Hi, Thanks for reporting. This looks like an oversight, especially as all click() overloads on EmptyNavigator apart from the one taking no arguments are actually throwing UnsupportedOperationException, see https://github.com/geb/geb/blob/master/module/geb-core/src/main/groovy/geb/navigator/EmptyNavigator.groovy#L51 .
This is a potentially breaking change but I'm looking into releasing 2.0 anyway so we could fix it in that release. I need to make a bunch of other breaking changes due to upgrading to WebDriver 3.x which requires Java 8 and Geb was until now built with Java 7 hence the need for a new major version. Would you mind creating an issue for this in the tracker at https://github.com/geb/issues/issues? Cheers, Marcin On Tue, Oct 3, 2017 at 11:40 AM, stuplum <[email protected]> wrote: > 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 > <https://groups.google.com/d/msgid/geb-user/6473dd1f-5120-46f9-becc-4c4e404c3b66%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CA%2B52dQQJiqdYg0Rb8%2Bht%2By9M%3DqhPpNF0WAjGMaxLqAQ43Xog7w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
