-
-
Notifications
You must be signed in to change notification settings - Fork 2k
/
99_bootstrap.feature
45 lines (32 loc) · 1 KB
/
99_bootstrap.feature
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
Feature:
Background:
* driver serverUrl + '/99_bootstrap'
Scenario: using the mouse to click and select something in a js-powered dropdown
# can help for some pages that take time to load
* waitUntil("document.readyState == 'complete'")
# click on button to show dropdown options
* mouse('button').click()
# click on first option
* mouse('a.dropdown-item').click()
# asserted expected result
* match text('#container') == 'First'
Scenario: looping over data to repeat an action
# can help for some pages that take time to load
* waitUntil("document.readyState == 'complete'")
# get all possible drop-down elements
* def list = locateAll('a.dropdown-item')
* def results = []
* def fun =
"""
function(e) {
mouse('button').click();
e.mouse().click();
let result = text('#container').trim();
results.push(result);
delay(2000);
}
"""
# perform the loop to click on all dropdown items
* list.forEach(fun)
# assert at the end for the data collected
* match results == ['First', 'Second', 'Third']