Skip to content

Support ClientFunctions for findByRole's name option #354

Description

@dantman

Is your feature request related to a problem? Please describe.
I had a list of buttons containing years and wanted to do a numeric comparison to a year number in a variable instead of a string comparison. findByRole's types suggest that it supports a function form of the name option and thought that would work.

However because the name function is executed on the client it loses the context necessary to work (i.e. the function cannot use any variable outside it).

Describe the solution you'd like
testcafe has an API for supporting this. Its ClientFunction API allows defining dependencies that will be passed to the ClientFunction's context.

It would be great if we could pass a ClientFunction to the name option of findByRole so we could define our own ClientFunction with any dependencies we need.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions