Skip to content

Add support to specify the type of node which is selected #47

@JonathanStoye

Description

@JonathanStoye

So I ran into an issue when I was working with cypress. I wanted to .click() a button which had the exact same wording as the headline right above. getByTextalways took the headline instead of the button so I had to use .get('button:contains("[...]")') to be able to get the button.

screen shot 2018-06-01 at 08 45 35

So I thought to be able to always use getByText it would be nice to be able to specify the type of node I want to get as part of the options maybe something like getByText(container, 'text', { node: 'button' }).

Of course I would volunteer to do it if it was discussed and approved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions