Skip to content

Commit

Permalink
feat(actions): add "When I clear"
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Dec 15, 2022
1 parent aeac2ae commit e4d4f4d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/actions/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,40 @@ import { When } from '@badeball/cypress-cucumber-preprocessor';

import { getCypressElement } from '../utils';

/**
* When I clear:
*
* ```gherkin
* When I clear
* ```
*
* Alias for {@link When_I_type | "When I type"}:
*
* ```gherkin
* When I type "{selectall}{backspace}"
* ```
*
* @example
*
* ```gherkin
* When I clear
* ```
*
* @remarks
*
* This requires a preceding step like {@link When_I_get_element_by_label_text | "When I get element by label text"}. For example:
*
* ```gherkin
* When I get element by label text "Input"
* And I clear
* ```
*/
export function When_I_clear() {
getCypressElement(this).clear();
}

When('I clear', When_I_clear);

/**
* When I type:
*
Expand Down

0 comments on commit e4d4f4d

Please sign in to comment.