Skip to content

Commit

Permalink
feat(actions): pass click options to "When I click on label"
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Dec 23, 2023
1 parent 962f64e commit 1d97bdc
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/actions/click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,23 @@ 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/get#Arguments):
* With options:
*
* ```gherkin
* When I click on label "Label"
* | altKey | false |
* | animationDistanceThreshold | 5 |
* | ctrlKey | false |
* | force | false |
* | includeShadowDom | false |
* | log | true |
* | metaKey | false |
* | multiple | false |
* | scrollBehavior | top |
* | shiftKey | false |
* | timeout | 4000 |
* | waitForAnimations | true |
* | withinSubject | null |
* | includeShadowDom | false |
* ```
*
* @see
Expand All @@ -371,7 +380,7 @@ When('I click on text {string}', When_I_click_on_text);
*/
export function When_I_click_on_label(text: string, options?: DataTable) {
When_I_find_element_by_label_text(text, options);
getCypressElement().click();
getCypressElement().click(getOptions(options));
}

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

0 comments on commit 1d97bdc

Please sign in to comment.