This repository has been archived by the owner on Jul 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui-test-_misc.js
207 lines (141 loc) · 4.68 KB
/
ui-test-_misc.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
const kDefaultRoute = require('./ui-behaviour.js').OLSKControllerRoutes().shift();
describe('AppMain_Misc', function () {
before(function() {
return browser.OLSKVisit(kDefaultRoute);
});
it('sets lang', function() {
browser.assert.attribute('html', 'lang', 'en');
});
it('sets title', function() {
browser.assert.text('title', 'webxdc-checklist');
});
it('sets encoding', function () {
browser.assert.attribute('meta[http-equiv="Content-Type"]', 'content', 'text/html; charset=utf-8');
});
it('sets viewport', function () {
browser.assert.attribute('meta[name="viewport"]', 'content', 'width=device-width');
});
describe('AppHeading', function test_AppHeading () {
it('sets text', function () {
browser.assert.text(AppHeading, 'webxdc-checklist');
});
});
describe('AppCreate', function test_AppCreate () {
it('classes AppListItemForm', function () {
browser.assert.hasClass(AppCreate, 'AppListItemForm');
});
});
describe('AppCreateField', function test_AppCreateField () {
it('sets type', function () {
browser.assert.attribute(AppCreateField, 'type', 'text');
});
it('sets placeholder', function () {
browser.assert.attribute(AppCreateField, 'placeholder', 'Description');
});
it('sets autofocus', function () {
browser.assert.attribute(AppCreateField, 'autofocus', '');
});
it('sets required', function () {
browser.assert.attribute(AppCreateField, 'required', '');
});
it('classes AppListItemField', function () {
browser.assert.hasClass(AppCreateField, 'AppListItemField');
});
});
describe('AppCreateButton', function test_AppCreateButton () {
it('sets type', function () {
browser.assert.attribute(AppCreateButton, 'type', 'submit');
});
it('sets value', function () {
browser.assert.attribute(AppCreateButton, 'value', 'Create');
});
it('classes AppListItemButton', function () {
browser.assert.hasClass(AppCreateButton, 'AppListItemButton');
});
});
describe('AppListItemName', function test_AppListItemName () {
const item = Math.random().toString();
before(function () {
return browser.fill(AppCreateField, item);
});
before(function () {
return browser.click(AppCreateButton);
});
it('sets text', function () {
browser.assert.text(AppListItemName, item);
});
context('click', function () {
const item = Math.random().toString();
before(function () {
return browser.click(AppListItemName);
});
before(function () {
return browser.fill(AppListItemUpdateField, item);
});
before(function () {
return browser.click(AppListItemUpdateButton);
});
it('sets text', function () {
browser.assert.text(AppListItemName, item);
});
});
});
describe('AppListItemToggle', function test_AppListItemToggle () {
it('sets type', function () {
browser.assert.attribute(AppListItemToggle, 'type', 'checkbox');
});
context('check', function () {
before(function () {
return browser.check(AppListItemToggle);
});
it('classes AppListItemDone', function () {
browser.assert.hasClass(AppListItem, 'AppListItemDone');
});
});
context('uncheck', function () {
before(function () {
return browser.uncheck(AppListItemToggle);
});
it('classes AppListItemDone', function () {
browser.assert.hasNoClass(AppListItem, 'AppListItemDone');
});
});
});
context('edit', function () {
let item;
before(function () {
item = browser.query(AppListItemName).textContent;
});
before(function () {
return browser.click(AppListItemName);
});
describe('AppListItemUpdateField', function test_AppListItemUpdateField () {
it('sets type', function () {
browser.assert.attribute(AppListItemUpdateField, 'type', 'text');
});
it('sets value', function () {
browser.assert.attribute(AppListItemUpdateField, 'value', item);
});
it('sets autofocus', function () {
browser.assert.attribute(AppListItemUpdateField, 'autofocus', '');
});
it('classes AppListItemField', function () {
browser.assert.hasClass(AppListItemUpdateField, 'AppListItemField');
});
});
describe('AppListItemUpdateButton', function test_AppListItemUpdateButton () {
it('sets type', function () {
browser.assert.attribute(AppListItemUpdateButton, 'type', 'submit');
});
it('sets value', function () {
browser.assert.attribute(AppListItemUpdateButton, 'value', 'Update');
});
it('classes AppListItemButton', function () {
browser.assert.hasClass(AppListItemUpdateButton, 'AppListItemButton');
});
});
});
after(function () {
return browser.evaluate('window.clearXdcStorage()');
});
});