Function When_I_find_element_by_label_text

  • When I find element by label text:

    When I find element by label text {string}
    

    Find the first visible label, aria-labelledby, or aria-label that matches the text.

    Parameters

    • text: string
    • Optionaloptions: DataTable

    Returns void

    When I find element by label text "Email"
    

    With options:

    When I find element by label text "Email"
    | log | true |
    | timeout | 4000 |
    | withinSubject | null |
    | includeShadowDom | false |
    | pseudoSelector | visible |

    This precedes steps like "When I type". For example:

    When I find element by label text "Email"
    And I type "[email protected]"

    Inspired by Testing Library's ByLabelText.