Skip to content

Commit

Permalink
feat(actions): pass click options to "When I click on text"
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Dec 23, 2023
1 parent 2c8039f commit 962f64e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/actions/click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,23 @@ When('I click on link {string}', When_I_click_on_link);
* When I click on text "Text"
* ```
*
* With [options](https://docs.cypress.io/api/commands/contains#Arguments):
* With options:
*
* ```gherkin
* When I click on text "Text"
* | matchCase | true |
* | altKey | false |
* | animationDistanceThreshold | 5 |
* | ctrlKey | false |
* | force | false |
* | includeShadowDom | false |
* | log | true |
* | matchCase | true |
* | metaKey | false |
* | multiple | false |
* | scrollBehavior | top |
* | shiftKey | false |
* | timeout | 4000 |
* | includeShadowDom | false |
* | waitForAnimations | true |
* ```
*
* @see
Expand All @@ -327,7 +336,8 @@ When('I click on link {string}', When_I_click_on_link);
* - {@link When_I_click_on_link | When I click on link}
*/
export function When_I_click_on_text(text: string, options?: DataTable) {
cy.contains(text, getOptions(options)).click();
const opts = getOptions(options);
cy.contains(text, opts).click(opts);
}

When('I click on text {string}', When_I_click_on_text);
Expand Down

0 comments on commit 962f64e

Please sign in to comment.