This repository has been archived by the owner on Apr 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.html
591 lines (501 loc) · 18.4 KB
/
report.html
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
<html>
<head>
<title>Mocha</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@charset "utf-8";
body {
margin:0;
}
#mocha {
font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 60px 50px;
}
#mocha ul,
#mocha li {
margin: 0;
padding: 0;
}
#mocha ul {
list-style: none;
}
#mocha h1,
#mocha h2 {
margin: 0;
}
#mocha h1 {
margin-top: 15px;
font-size: 1em;
font-weight: 200;
}
#mocha h1 a {
text-decoration: none;
color: inherit;
}
#mocha h1 a:hover {
text-decoration: underline;
}
#mocha .suite .suite h1 {
margin-top: 0;
font-size: .8em;
}
#mocha .hidden {
display: none;
}
#mocha h2 {
font-size: 12px;
font-weight: normal;
cursor: pointer;
}
#mocha .suite {
margin-left: 15px;
}
#mocha .test {
margin-left: 15px;
overflow: hidden;
}
#mocha .test.pending:hover h2::after {
content: '(pending)';
font-family: arial, sans-serif;
}
#mocha .test.pass.medium .duration {
background: #c09853;
}
#mocha .test.pass.slow .duration {
background: #b94a48;
}
#mocha .test.pass::before {
content: '✓';
font-size: 12px;
display: block;
float: left;
margin-right: 5px;
color: #00d6b2;
}
#mocha .test.pass .duration {
font-size: 9px;
margin-left: 5px;
padding: 2px 5px;
color: #fff;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
}
#mocha .test.pass.fast .duration {
display: none;
}
#mocha .test.pending {
color: #0b97c4;
}
#mocha .test.pending::before {
content: '◦';
color: #0b97c4;
}
#mocha .test.fail {
color: #c00;
}
#mocha .test.fail pre {
color: black;
}
#mocha .test.fail::before {
content: '✖';
font-size: 12px;
display: block;
float: left;
margin-right: 5px;
color: #c00;
}
#mocha .test pre.error {
color: #c00;
max-height: 300px;
overflow: auto;
}
#mocha .test .html-error {
overflow: auto;
color: black;
display: block;
float: left;
clear: left;
font: 12px/1.5 monaco, monospace;
margin: 5px;
padding: 15px;
border: 1px solid #eee;
max-width: 85%; /*(1)*/
max-width: -webkit-calc(100% - 42px);
max-width: -moz-calc(100% - 42px);
max-width: calc(100% - 42px); /*(2)*/
max-height: 300px;
word-wrap: break-word;
border-bottom-color: #ddd;
-webkit-box-shadow: 0 1px 3px #eee;
-moz-box-shadow: 0 1px 3px #eee;
box-shadow: 0 1px 3px #eee;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
#mocha .test .html-error pre.error {
border: none;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: 0;
-moz-box-shadow: 0;
box-shadow: 0;
padding: 0;
margin: 0;
margin-top: 18px;
max-height: none;
}
/**
* (1): approximate for browsers not supporting calc
* (2): 42 = 2*15 + 2*10 + 2*1 (padding + margin + border)
* ^^ seriously
*/
#mocha .test pre {
display: block;
float: left;
clear: left;
font: 12px/1.5 monaco, monospace;
margin: 5px;
padding: 15px;
border: 1px solid #eee;
max-width: 85%; /*(1)*/
max-width: -webkit-calc(100% - 42px);
max-width: -moz-calc(100% - 42px);
max-width: calc(100% - 42px); /*(2)*/
word-wrap: break-word;
border-bottom-color: #ddd;
-webkit-box-shadow: 0 1px 3px #eee;
-moz-box-shadow: 0 1px 3px #eee;
box-shadow: 0 1px 3px #eee;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
#mocha .test h2 {
position: relative;
}
#mocha .test a.replay {
position: absolute;
top: 3px;
right: 0;
text-decoration: none;
vertical-align: middle;
display: block;
width: 15px;
height: 15px;
line-height: 15px;
text-align: center;
background: #eee;
font-size: 15px;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
-webkit-transition:opacity 200ms;
-moz-transition:opacity 200ms;
-o-transition:opacity 200ms;
transition: opacity 200ms;
opacity: 0.3;
color: #888;
}
#mocha .test:hover a.replay {
opacity: 1;
}
#mocha-report.pass .test.fail {
display: none;
}
#mocha-report.fail .test.pass {
display: none;
}
#mocha-report.pending .test.pass,
#mocha-report.pending .test.fail {
display: none;
}
#mocha-report.pending .test.pass.pending {
display: block;
}
#mocha-error {
color: #c00;
font-size: 1.5em;
font-weight: 100;
letter-spacing: 1px;
}
#mocha-stats {
position: fixed;
top: 15px;
right: 10px;
font-size: 12px;
margin: 0;
color: #888;
z-index: 1;
}
#mocha-stats .progress {
float: right;
padding-top: 0;
/**
* Set safe initial values, so mochas .progress does not inherit these
* properties from Bootstrap .progress (which causes .progress height to
* equal line height set in Bootstrap).
*/
height: auto;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
background-color: initial;
}
#mocha-stats em {
color: black;
}
#mocha-stats a {
text-decoration: none;
color: inherit;
}
#mocha-stats a:hover {
border-bottom: 1px solid #eee;
}
#mocha-stats li {
display: inline-block;
margin: 0 5px;
list-style: none;
padding-top: 11px;
}
#mocha-stats canvas {
width: 40px;
height: 40px;
}
#mocha code .comment { color: #ddd; }
#mocha code .init { color: #2f6fad; }
#mocha code .string { color: #5890ad; }
#mocha code .keyword { color: #8a6343; }
#mocha code .number { color: #2f6fad; }
@media screen and (max-device-width: 480px) {
#mocha {
margin: 60px 0px;
}
#mocha #stats {
position: absolute;
}
}
#mocha .test.pass pre {
display: none;
}
#mocha .test.fail pre {
display: none;
}
#mocha .test pre.error {
display: block;
}
#mocha .test .html-error pre.error {
box-shadow: none;
}
#mocha .test:hover h2:after {
color: #888888;
content: "(view source)";
font-family: arial;
font-size: 12px;
position: relative;
right: -10px;
top: 0;
}
#mocha .test.pass.pending h2 {
cursor: auto;
}
#mocha .mocha-header {
right: 30px;
position: fixed;
top: 15px;
font-size: 14px;
margin: 0;
color: #888;
z-index: 1;
}
#mocha .mocha-header em {
font-style: normal;
color: black;
}
#mocha .mocha-header ul {
display: inline-block;
}
#mocha .mocha-stats li {
display: inline-block;
margin: 0 5px;
list-style: none;
padding-top: 11px;
}
#mocha .mocha-menu {
margin-right: 10px;
}
#mocha .mocha-menu li {
display: inline-block;
margin-left: 10px;
list-style: none;
}
#mocha .mocha-menu li span {
display: inline-block;
cursor: pointer;
color: #fff;
font-size: 14px;
padding: 3px 7px 2px;
box-shadow: 1px 1px 3px rgba(0,0,0,.2);
border-radius: 5px;
user-select: none;
}
#mocha .mocha-menu li span.checked {
box-shadow: inset 1px 1px 3px rgba(0,0,0,.2);
}
#mocha .toggle-passes {
background: #b94a48;
}
</style>
</head>
<body>
<div id="mocha">
<div class="mocha-header">
<ul class="mocha-menu">
<li><span id="toggle-passes" class="toggle-passes">show failures only</span></li>
</ul>
<ul class="mocha-stats">
<li class="passes">passes: <em>19</em></li>
<li class="pending">pending: <em>0</em></li>
<li class="failures">failures: <em>0</em></li>
<li class="duration">duration: <em>25.4s</em></li>
</ul>
</div>
<ul id="report"><li class="suite"><h1>Browser Tests</h1><ul><li class="suite"><h1>Home page #home</h1><ul><li class="suite"><h1>General Tests</h1><ul><li class="test pass fast"><h2>Background color should have .bg-black-pearl class in homepage<span class="duration">3ms</span></h2><pre><code>async function() {
const bodyClassList = await page.evaluate(() => {
const body = document.querySelector("body");
const classList = Array.from(body.classList);
return Promise.resolve(classList);
});
expect(bodyClassList).to.be.include("bg-black-pearl");
}</code></pre></li></ul></li><li class="suite"><h1>Logo Tests</h1><ul><li class="test pass fast"><h2>Logo should be represent in DOM<span class="duration">0ms</span></h2><pre><code>expect(logoDOMNode).not.to.be.null;</code></pre></li><li class="test pass fast"><h2>Logo should have src attribute with './images/Logo.png'<span class="duration">1ms</span></h2><pre><code>async function() {
const expectedSrc = "./images/Logo.png";
const logoDOMNodeSrcAttr = await logoDOMNode.evaluate(node => node.getAttribute("src"));
expect(logoDOMNodeSrcAttr).to.be.equal(expectedSrc);
}</code></pre></li></ul></li><li class="suite"><h1>Search Form Properties</h1><ul><li class="suite"><h1>Search Input Test</h1><ul><li class="test pass fast"><h2>Search input should be exist<span class="duration">0ms</span></h2><pre><code>expect(searchInputDOMNode).not.to.be.null;</code></pre></li><li class="test pass fast"><h2>Search input should have a placeholder with 'Type here'<span class="duration">1ms</span></h2><pre><code>async function() {
const searchInputDOMNodePlaceholderAttr = await searchInputDOMNode.evaluate(node => node.getAttribute("placeholder"));
expect(searchInputDOMNodePlaceholderAttr).to.be.equal("Type here");
}</code></pre></li><li class="test pass medium"><h2>We can change input's value attribute with typing<span class="duration">45ms</span></h2><pre><code>async function() {
await page.type(SEARCH_INPUT_SELECTOR, SEARCH_INPUT_TYPED_VALUE);
const searchInputDOMNodeValueAttr = await searchInputDOMNode.evaluate(node => node.value);
expect(searchInputDOMNodeValueAttr).to.be.equal(SEARCH_INPUT_TYPED_VALUE);
}</code></pre></li></ul></li><li class="suite"><h1>Collections selectbox test</h1><ul><li class="test pass fast"><h2>Collections selectbox should be exist<span class="duration">0ms</span></h2><pre><code>expect(collectionsSelectboxDOMNode).not.to.be.null;</code></pre></li><li class="suite"><h1>Collections selectbox placeholder</h1><ul><li class="test pass fast"><h2>Collection selectbox should have placeholder with 'Collections'<span class="duration">2ms</span></h2><pre><code>async function() {
expect(await getCollectionSelectboxValue()).to.be.equal("Collections");
}</code></pre></li><li class="test pass fast"><h2>Collection selectbox selected value should have 'is-placeholder' class with placeholder<span class="duration">2ms</span></h2><pre><code>async function() {
const selectedValueClasslist = await page.$eval(COLLECTION_SELECTBOX_SELECTED_ITEM_SELECTOR, node => Array.from(node.classList));
expect(selectedValueClasslist).to.be.include("is-placeholder");
}</code></pre></li></ul></li><li class="suite"><h1>Collection selectbox other tests</h1><ul><li class="test pass fast"><h2>Collections selectbox should toggle with click<span class="duration">11ms</span></h2><pre><code>async function() {
const situtationOne = await isSelectboxToggled();
await collectionsSelectboxToggleAct();
//await page.waitFor(500);
const situtationTwo = await isSelectboxToggled();
expect(situtationOne).to.be.false;
expect(situtationTwo).to.be.true;
}</code></pre></li><li class="test pass fast"><h2>Collection selectbox items to should represent<span class="duration">3ms</span></h2><pre><code>async function() {
const availableSelecboxItemsFixtures = [
"Concert and Performance",
"Northern Europe",
"Europe",
"Turkey",
"Party / Concerts"
];
const selectedboxItems = await page.$$eval(COLLECTION_SELECTBOX_OPTIONS_SELECTOR, items => items.map(item => item.innerText));
expect(selectedboxItems).to.have.members(availableSelecboxItemsFixtures);
}</code></pre></li><li class="test pass fast"><h2>Collection selectbox value should be change with click items<span class="duration">9ms</span></h2><pre><code>async function() {
expect(await getAndClickSelectboxElementAtFirst()).to.be.equal(await getCollectionSelectboxValue());
}</code></pre></li><li class="test pass fast"><h2>The dropdown menu should hide after the click item<span class="duration">26ms</span></h2><pre><code>async function() {
await collectionsSelectboxToggleAct();
await getAndClickSelectboxElementAtFirst();
expect(await isSelectboxToggled()).to.be.false;
}</code></pre></li></ul></li></ul></li></ul></li><li class="suite"><h1>Intergration test #integration. Test full of functionality of home-page</h1><ul><li class="test pass fast"><h2>Immediately Clicking to Search button should show warning message<span class="duration">16ms</span></h2><pre><code>async function() {
await page.click(SEARCH_BUTTON_NODE_SELECTOR);
expect(await isWarningMessageShowing()).to.be.true;
}</code></pre></li><li class="test pass medium"><h2>Click search button when search input is typed and collection selectbox is default should show warning message.<span class="duration">40ms</span></h2><pre><code>async function() {
await page.type(SEARCH_INPUT_SELECTOR, SEARCH_INPUT_TYPED_VALUE);
await clickToSelector(SEARCH_BUTTON_NODE_SELECTOR);
expect(await isWarningMessageShowing()).to.be.true;
}</code></pre></li><li class="test pass fast"><h2>Click search button when search input is default and collection selection is selected should show warning message<span class="duration">17ms</span></h2><pre><code>async function() {
await getAndClickSelectboxElementAtFirst();
await clickToSelector(SEARCH_BUTTON_NODE_SELECTOR);
expect(await isWarningMessageShowing()).to.be.true;
}</code></pre></li><li class="suite"><h1>Check form whole functionality</h1><ul><li class="suite"><h1>Clicking the submit button</h1><ul><li class="test pass fast"><h2>Loading indicator should show in the page<span class="duration">0ms</span></h2><pre><code>async function() {
before(async function() {
await page.setOfflineMode(true);
await clickToSelector(SEARCH_BUTTON_NODE_SELECTOR);
});
after(async function() {
await page.setOfflineMode(false);
await reloadPage();
});
const loadingIndicatorNode = page.$(LOADING_INDICATOR_SELECTOR);
expect(loadingIndicatorNode).not.to.be.null;
}</code></pre></li><li class="suite"><h1>The user should redirect after clicking to submit button</h1><ul><li class="test pass fast"><h2>Redirect path should be '/search'<span class="duration">0ms</span></h2><pre><code>async function() {
const {pathname} = location;
expect(pathname).to.be.equal("/search");
}</code></pre></li><li class="test pass fast"><h2>The form properties should carry to redirected URL Search Parameters.<span class="duration">1ms</span></h2><pre><code>async function() {
const expectationSearchParams = {
query: "Concert",
collections: "785618"
};
const searchParams = await page.evaluate(function() {
const locationSearch = window.location.search;
const urlSearchParams = new URLSearchParams(locationSearch);
return Object.fromEntries(urlSearchParams.entries());
});
expect(searchParams).to.deep.equal(expectationSearchParams);
}</code></pre></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul>
</div>
<script>
function hideSuitesWithout(className) {
var suites = document.querySelectorAll('#report > .suite');
for (var i = 0; i < suites.length; i++) {
let suite = suites[i];
var els = suite.getElementsByClassName(className);
if (!els.length) {
suite.classList.add('hidden');
}
}
}
function unhide() {
var suites = document.getElementsByClassName('suite hidden');
while (suites.length) {
suites[0].classList.remove('hidden');
}
}
function togglePasses() {
var report = document.getElementById('report');
report.classList.toggle('hide-passes');
if (report.classList.contains('hide-passes')) {
hideSuitesWithout('test fail');
} else {
unhide();
}
}
document.getElementById('toggle-passes').addEventListener('click', function(e) {
e.preventDefault();
this.classList.toggle('checked');
togglePasses();
});
var tests = document.getElementsByClassName('test');
for (var i = 0; i < tests.length; i++) {
var elem = tests[i];
var head = elem.children[0];
head.onclick = function () {
var code = this.parentElement.children[1];
var display = code.style.display;
if (display && display === 'block') {
code.style.display = 'none';
} else {
code.style.display = 'block';
}
};
}
</script>
</body>
</html>