forked from vmware-archive/clarity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datepicker.js
124 lines (115 loc) · 3.99 KB
/
datepicker.js
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
* Copyright (c) 2016-2018 VMware, Inc. All Rights Reserved.
* This software is released under MIT license.
* The full license information can be found in LICENSE in the root directory of this project.
*/
var WAIT_TIME = 5000;
var WAIT_LOAD_TIME = 1000;
gemini.suite('datepicker', child => {
gemini.suite('layout', child => {
child
.setUrl('/datepicker/layout')
.before((actions, find) => {
actions.waitForElementToShow('.clr-input-wrapper');
})
.setCaptureElements('.content-area')
.capture('default');
});
gemini.suite('no-input', child => {
child
.setUrl('/datepicker/css-regression')
.before((actions, find) => {
actions.waitForElementToShow('.clr-example-1', WAIT_TIME);
actions.wait(WAIT_LOAD_TIME);
})
.setCaptureElements('.clr-example-1 .clr-input')
.capture('default');
});
gemini.suite('disabled', child => {
child
.setUrl('/datepicker/disabled')
.before((actions, find) => {
actions.waitForElementToShow('[clrForm]', WAIT_TIME);
actions.wait(WAIT_LOAD_TIME);
})
.setCaptureElements('[clrForm]')
.capture('default');
});
gemini.suite('user-input', child => {
child
.setUrl('/datepicker/css-regression')
.before((actions, find) => {
actions.waitForElementToShow('.clr-example-2', WAIT_TIME);
actions.wait(WAIT_LOAD_TIME);
this.trigger = find('.clr-example-2 .clr-input-group-icon-action');
})
.setCaptureElements('.clr-example-2')
.capture('default')
.capture('trigger-hovered', (actions, find) => {
actions.mouseMove(this.trigger);
actions.wait(WAIT_LOAD_TIME);
});
});
gemini.suite('datepicker', child => {
child
.setUrl('/datepicker/css-regression')
.before((actions, find) => {
actions.waitForElementToShow('.clr-example-2', WAIT_TIME);
actions.wait(WAIT_LOAD_TIME);
this.trigger = find('.clr-example-2 .clr-input-group-icon-action');
actions.click(this.trigger);
actions.wait(WAIT_LOAD_TIME);
})
.setCaptureElements('.clr-example-2')
.capture('default');
});
gemini.suite('monthpicker', child => {
child
.setUrl('/datepicker/css-regression')
.before((actions, find) => {
actions.waitForElementToShow('.clr-example-2', WAIT_TIME);
actions.wait(WAIT_LOAD_TIME);
this.trigger = find('.clr-example-2 .clr-input-group-icon-action');
actions.click(this.trigger);
actions.wait(WAIT_LOAD_TIME);
this.monthpickerTrigger = find('.monthpicker-trigger');
actions.click(this.monthpickerTrigger);
actions.wait(WAIT_LOAD_TIME);
actions.mouseMove('.month');
actions.wait(WAIT_LOAD_TIME);
})
.setCaptureElements('.clr-example-2')
.capture('default');
});
gemini.suite('yearpicker', child => {
child
.setUrl('/datepicker/css-regression')
.before((actions, find) => {
actions.waitForElementToShow('.clr-example-2', WAIT_TIME);
actions.wait(WAIT_LOAD_TIME);
this.trigger = find('.clr-example-2 .clr-input-group-icon-action');
actions.click(this.trigger);
actions.wait(WAIT_LOAD_TIME);
this.yearpickerTrigger = find('.yearpicker-trigger');
actions.click(this.yearpickerTrigger);
actions.wait(WAIT_LOAD_TIME);
actions.mouseMove('.year');
actions.wait(WAIT_LOAD_TIME);
})
.setCaptureElements('.clr-example-2')
.capture('default');
});
gemini.suite('datepicker nested in table', child => {
child
.setUrl('/datepicker/css-regression')
.before((actions, find) => {
actions.waitForElementToShow('.clr-example-3', WAIT_TIME);
actions.wait(WAIT_LOAD_TIME);
this.trigger = find('.clr-example-3 .datepicker-trigger');
actions.click(this.trigger);
actions.wait(WAIT_LOAD_TIME);
})
.setCaptureElements('.clr-example-3')
.capture('default');
});
});