Skip to content

Support for regular expression on toHaveText method #4914

Description

@mattiaTuri

Description

Describe your idea
Support for regular expression on toHaveText method.

The matcher by.text(text) supports regex matching

text(text: string | RegExp): NativeMatcher;

Is possible make a change to the current API, from:

toHaveText(text: string): R;

To:

toHaveText (text: string | RegExp): R;

In my test suite I used detox in combination with jest for achive this behaviour, but i think it can be useful on method toHaveText since text may include dynamic content (e.g. date, id).

Thanks in advance

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