-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
button.ts
74 lines (69 loc) 路 1.64 KB
/
button.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import { DataTable, Then } from '@badeball/cypress-cucumber-preprocessor';
import { PseudoSelector } from '../constants';
import { getButtonElements } from '../utils';
/**
* Then I see button:
*
* ```gherkin
* Then I see button {string}
* ```
*
* Assert button with text **_exists_** and is **_visible_** in the screen.
*
* @example
*
* ```gherkin
* Then I see button "Button"
* ```
*
* With [options](https://docs.cypress.io/api/commands/get#Arguments):
*
* ```gherkin
* Then I see button "Button"
* | log | true |
* | timeout | 4000 |
* | withinSubject | null |
* | includeShadowDom | false |
* ```
*
* @see
*
* - {@link Then_I_see_text | Then I see text}
*/
export function Then_I_see_button(text: string, options?: DataTable) {
getButtonElements(text, PseudoSelector.visible, options).should('exist');
}
Then('I see button {string}', Then_I_see_button);
/**
* Then I do not see button:
*
* ```gherkin
* Then I do not see button {string}
* ```
*
* Assert button with text **_does not exist_** in the screen.
*
* @example
*
* ```gherkin
* Then I do not see button "Button"
* ```
*
* With [options](https://docs.cypress.io/api/commands/get#Arguments):
*
* ```gherkin
* Then I do not see button "Button"
* | log | true |
* | timeout | 4000 |
* | withinSubject | null |
* | includeShadowDom | false |
* ```
*
* @see
*
* - {@link Then_I_do_not_see_text | Then I do not see text}
*/
export function Then_I_do_not_see_button(text: string, options?: DataTable) {
getButtonElements(text, PseudoSelector.visible, options).should('not.exist');
}
Then('I do not see button {string}', Then_I_do_not_see_button);