Open sukima opened 7 years ago
@sukima thanks for your request, I will try to work on this soon 😄
guys I was in need of this feature, thought of raising a pr
do let me know for any changes
tanks :)
cc: @san650
hm.. that's surprising to me. I believe that matchExact
behavior should have been a default.
But changing it now, would probably break some test suites..
just realized we could add support for this directly to the clickable(
:
const p = create();
await p.click('Some button text');
fortunately, currently click(
does not support any arguments, and I can't think of any other than a label to click on. Obviously, it would make clickOnText(
action redundant.
It feels like matchExact=false
behavior should not be allowed at all, cause it's non-deterministic and error prone. So I think we may not need an extra flag for that.
Curious, if there are any real use cases for matchExactly: false
, which is the only possible behavior currently?
I'm considering a breaking change in v2, in order to make clickOnText
to strictly click on exact text only.
I would guess that sometimes you get generated or random text e.g. an auto-generated id or current date so you want to match part of the label instead of the full text
contains
andclickOnText
both use text input to find elements and act on them. Currently that textual match will match any subset of the text to search for.Discussed in the slack channel a possible solution is to add a modifier to say we want to match the exact text instead of a subset.
Example
The above will match both buttons.
Alternatively it could look like:
Which will match only the first button.