diff --git a/src/actions/click.ts b/src/actions/click.ts index 2a3bf7e23..94f8c03c0 100644 --- a/src/actions/click.ts +++ b/src/actions/click.ts @@ -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);