Skip to content

clickButton(String) is overly permissive in finding buttons #2594

@jtnord

Description

@jtnord

#2592 was prompted as the text matching on clickButton was overly permissive, looking for contains rather than being equal.

If a button contains an SVG with text then that text should be included in the match, ie if the button is defined as follows:

<button>this is a button
  <svg viewBox="0 0 240 80" xmlns="http://www.w3.org/2000/svg">
    <text x="20" y="35" class="small">My</text>
    <text x="40" y="35" class="heavy">cat</text>
    <text x="55" y="55" class="small">is</text>
    <text x="65" y="55" class="Rrrrr">Grumpy!</text>
  </svg>  
</button>

then clickButton() should be called as clickButton("this is a button\nMy\ncat\nis\nGrumpy"); not clickButton("this is a button");

This causes issues when in the example of the referenced PR there are other buttons that contain "Run" that are matched.

TL;DR ByFactory.byButton with String should take exact text to match, or an ID. it should not use partial text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions