Skip to content

Commit

Permalink
feat(actions): pass options to "When I click on link"
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Nov 11, 2023
1 parent 8a6955d commit c0e3aa2
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 @@ -118,12 +118,29 @@ When('I click on button {string}', When_I_click_on_button);
* When I click on link "Link"
* ```
*
* With [options](https://docs.cypress.io/api/commands/click#Arguments):
*
* ```gherkin
* When I click on link "Link"
* | 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_link(text: string) {
cy.contains('a', text).first().click();
export function When_I_click_on_link(text: string, options?: DataTable) {
cy.contains('a', text).first().click(getOptions(options));
}

When('I click on link {string}', When_I_click_on_link);
Expand Down

0 comments on commit c0e3aa2

Please sign in to comment.