Skip to content

Commit

Permalink
feat(actions): pass options to "When I click on label"
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Nov 11, 2023
1 parent 293280e commit 1637c8d
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/actions/click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,30 @@ When('I click on text {string}', When_I_click_on_text);
* When I click on label "Label"
* ```
*
* With [options](https://docs.cypress.io/api/commands/click#Arguments):
*
* ```gherkin
* When I click on label "Label"
* | altKey | false |
* | animationDistanceThreshold | 5 |
* | ctrlKey | false |
* | log | true |
* | force | false |
* | metaKey | false |
* | multiple | false |
* | scrollBehavior | top |
* | shiftKey | false |
* | timeout | 4000 |
* | waitForAnimations | true |
* ```
*
* @see
*
* - {@link When_I_click_on_text | When I click on text}
*/
export function When_I_click_on_label(text: string) {
export function When_I_click_on_label(text: string, options?: DataTable) {
When_I_find_element_by_label_text(text);
getCypressElement().click();
getCypressElement().click(getOptions(options));
}

When('I click on label {string}', When_I_click_on_label);

0 comments on commit 1637c8d

Please sign in to comment.