Skip to content

clicking on non existent element does not throw error #501

@stuplum

Description

@stuplum

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
    }
}

Expected behaviour:
An exception should be thrown when the button element is missing and can't be clicked.

Actual behaviour:
When the button doesn't exist on SomePage the test is still reaching the at check for AnotherPage

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions