Skip to content

Commit

Permalink
feat(assertions): pass options to "Then I see heading"
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Dec 18, 2023
1 parent 9dfc233 commit 5cb402b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/assertions/heading.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Then } from '@badeball/cypress-cucumber-preprocessor';
import { DataTable, Then } from '@badeball/cypress-cucumber-preprocessor';

import { When_I_find_headings_by_text } from '../queries';
import { getCypressElement } from '../utils';
Expand All @@ -18,12 +18,22 @@ import { getCypressElement } from '../utils';
* Then I see heading "Heading"
* ```
*
* With [options](https://docs.cypress.io/api/commands/get#Arguments):
*
* ```gherkin
* Then I see heading "Heading"
* | log | true |
* | timeout | 4000 |
* | withinSubject | null |
* | includeShadowDom | false |
* ```
*
* @see
*
* - {@link Then_I_see_text | Then I see text}
*/
export function Then_I_see_heading(text: string) {
When_I_find_headings_by_text(text);
export function Then_I_see_heading(text: string, options?: DataTable) {
When_I_find_headings_by_text(text, options);
getCypressElement().should('exist');
}

Expand Down

0 comments on commit 5cb402b

Please sign in to comment.