Skip to content

Commit

Permalink
feat(assertions): add "Then I see element exists"
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Dec 5, 2023
1 parent d2bb40b commit 2c78e9d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/assertions/exist.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Then } from '@badeball/cypress-cucumber-preprocessor';

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

/**
* Then I see element exists:
*
* ```gherkin
* Then I see element exists
* ```
*
* Assert element **_exists_** in the screen.
*
* @example
*
* ```gherkin
* Then I see element exists
* ```
*
* @remarks
*
* A preceding step like {@link When_I_find_element_by_text | "When I find element by text"} is required. For example:
*
* ```gherkin
* When I find element by text "Text"
* Then I see element exists
* ```
*/
export function Then_I_see_element_exists() {
getCypressElement().should('exist');
}

Then('I see element exists', Then_I_see_element_exists);
1 change: 1 addition & 0 deletions src/assertions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export * from './button';
export * from './cookie';
export * from './count';
export * from './document-title';
export * from './exist';
export * from './hash';
export * from './heading';
export * from './label';
Expand Down

0 comments on commit 2c78e9d

Please sign in to comment.