forked from bem/bem-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect.gemini.js
More file actions
48 lines (43 loc) · 1.62 KB
/
Copy pathselect.gemini.js
File metadata and controls
48 lines (43 loc) · 1.62 KB
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
var animationTime = 300;
gemini.suite('select', function(root) {
root.setUrl('desktop.tests/select/gemini/gemini.html');
[
'radio_check-no_text',
'size_m-check-much_text',
'size_l-radio-text',
'size_xl-checked-disabled_item',
'size_s-select-group',
'select-icon'
]
.forEach(function(test) {
var selectSelector = '.' + test,
buttonSelector = selectSelector + ' .button';
gemini.suite(test, function(suite) {
suite
// popup's class is defined in the select.tests/gemini.blocks/select/select.bemhtml
.setCaptureElements(buttonSelector, selectSelector + '-popup')
.before(function(actions, find) {
this.button = find(buttonSelector);
})
.capture('plain')
.capture('focused-hard', function(actions){
actions.sendKeys(this.button, '-');
})
.capture('pressed', function(actions) {
actions
.mouseDown(this.button)
.wait(animationTime);
})
.capture('clicked', function(actions) {
actions
.mouseUp(this.button)
.wait(animationTime);
});
});
});
gemini.suite('disabled', function(suite) {
suite
.setCaptureElements('.disabled')
.capture('plain');
});
});