wait longer for Firefox
[mkws-moved-to-github.git] / test / spec / mkws-pazpar2.js
1 /* Copyright (c) 2013-2014 IndexData ApS. http://indexdata.com
2  *
3  * perform papzpar2 / pz2.js search & retrieve request in the browser
4  *
5  */
6
7 // get references from mkws.js, lazy evaluation
8 var debug = function (text) {
9         mkws.log("Jasmine: " + text)
10     }
11
12     // Define empty jasmine_config for simple applications that don't define it.
13 if (jasmine_config == null || typeof jasmine_config != 'object') {
14     var jasmine_config = {};
15 }
16
17 var jasmine_status = {
18     source_click: 0
19 };
20
21 /* check config for jasmine test
22  *
23  * you can override the default values in the config
24  * object: jasmine_config = {};
25  *
26  */
27 function init_jasmine_config() {
28
29     var jasmine_config_default = {
30         search_query: "freebsd",
31         max_time: 17,
32         // in seconds
33         expected_hits: 80,
34         // at least expected hit counter
35         second: 1000,
36         // miliseconds to seconds
37         show_record_url: true,
38         // check for valid URL in records
39         check_motd: true,
40
41         // check sort by and per page menu
42         check_sortby: false,
43
44         dummy: false
45     };
46
47     // use default values for undefined values
48     for (var key in jasmine_config_default) {
49         if (!jasmine_config.hasOwnProperty(key)) {
50             jasmine_config[key] = jasmine_config_default[key];
51         }
52         debug("jasmine config: " + key + " => " + jasmine_config[key]);
53     }
54
55     mkws.jasmine_done = false;
56 }
57
58 var get_hit_counter = function () {
59         // not yet here
60         if (mkws.$(".mkwsPager").length == 0) return -1;
61
62         var found = mkws.$(".mkwsPager").text();
63         var re = /\([A-Za-z]+:\s+([0-9]+)\)/;
64         re.exec(found);
65         var hits = -1;
66
67         if (RegExp.$1) {
68             hits = parseInt(RegExp.$1);
69             if (hits <= 0) {
70                 debug("Oooops in get_hit_counter: " + RegExp.$1 + " '" + found + "'");
71             }
72         }
73
74         //debug("Hits: " + hits);
75         return hits;
76     }
77
78 describe("Init jasmine config", function () {
79     it("jasmine was successfully initialized", function () {
80         init_jasmine_config();
81
82         expect(jasmine_config.search_query).toMatch(/\w/);
83         expect(jasmine_config.second).toBeGreaterThan(100);
84         expect(jasmine_config.max_time).toBeGreaterThan(1);
85         expect(jasmine_config.expected_hits).toBeGreaterThan(1);
86     });
87 });
88
89 //disabled
90 xdescribe("Check MOTD before search", function () {
91     // Check that the MOTD has been moved into its container, and
92     // is visible before the search.
93     // the mkwsMOTD div was originally inside a testMOTD div, which should
94     // now be empty
95     // Note that the testMOTD is a regular div, and uses #testMOTD,
96     // since the automagic class-making does not apply to it.
97     it("MOTD is hidden", function () {
98         expect(mkws.$(".mkwsMOTD").length).toBe(1);
99         expect(mkws.$("#testMOTD").length).toBe(1);
100         expect(mkws.$("#testMOTD").text()).toMatch("^ *$");
101     });
102
103     it("mkwsMOTDContainer has received the text", function () {
104         expect(mkws.$(".mkwsMOTDContainer").length).toBe(1);
105         expect(mkws.$(".mkwsMOTDContainer").text()).toMatch(/MOTD/);
106     });
107 });
108
109 describe("Check pazpar2 search", function () {
110     it("pazpar2 was successfully initialized", function () {
111         expect(mkws.config.error).toBe(undefined);
112     });
113
114     it("validate HTML id's", function () {
115         expect(mkws.$("input.mkwsQuery").length).toBe(1);
116         expect(mkws.$("input.mkwsButton").length).toBe(1);
117
118         expect(mkws.$(".mkwsNext").length).not.toBe(1);
119         expect(mkws.$(".mkwsPrev").length).not.toBe(1);
120     });
121
122     it("run search query", function () {
123         var search_query = jasmine_config.search_query; // short hit counter with some paging
124         mkws.$("input.mkwsQuery").val(search_query);
125         debug("set search query: " + search_query)
126         expect(mkws.$("input.mkwsQuery").val()).toMatch("^" + search_query + "$");
127
128         if (mkws.config.use_service_proxy) {
129             // wait for service proxy auth
130             waitsFor(function () {
131                 return mkws.authenticated;
132             }, "SP auth done", 10 * jasmine_config.second);
133         } else {
134             debug("running raw pp2, don't wait for mkws auth");
135         }
136
137         runs(function () {
138             debug("Click on submit button");
139             mkws.$("input.mkwsButton").trigger("click");
140         })
141     });
142 });
143
144 describe("Check MOTD after search", function () {
145     it("MOTD is hidden", function () {
146         if (!jasmine_config.check_motd) {
147             return;
148         }
149
150         expect(mkws.$(".mkwsMOTD").length).toBe(1);
151         expect(mkws.$(".mkwsMOTD").is(":hidden")).toBe(true);
152         debug("motd t=" + mkws.$(".mkwsMOTD").text());
153         debug("motd v=" + mkws.$(".mkwsMOTD").is(":visible"));
154     });
155 });
156
157
158 /*
159  * This part runs in background. It should be rewritten with
160  * async jasmine functions
161  *
162  */
163 describe("Check pazpar2 navigation", function () {
164     // Asynchronous part
165     it("check running search next/prev", function () {
166         expect(mkws.$(".mkwsPager").length).toBe(1);
167
168         function my_click(id, time) {
169             setTimeout(function () {
170                 debug("trigger click on id: " + id);
171                 mkws.$(id).trigger("click");
172             }, time * jasmine_config.second);
173         }
174
175         waitsFor(function () {
176             return mkws.$("div.mkwsPager div:nth-child(2) a").length >= 2 ? true : false;
177         }, "Expect next link 2", 10 * jasmine_config.second);
178
179         runs(function () {
180             // click next/prev after N seconds
181             my_click(".mkwsNext", 0);
182         });
183
184         waitsFor(function () {
185             return mkws.$("div.mkwsPager div:nth-child(2) a").length >= 3 ? true : false;
186         }, "Expect next link 3", 5 * jasmine_config.second);
187
188         runs(function () {
189             // click next/prev after N seconds
190             my_click(".mkwsNext", 0);
191             my_click(".mkwsPrev", 0.2);
192         });
193     });
194 });
195
196 describe("Check pazpar2 hit counter", function () {
197     it("check running search hit counter", function () {
198         var max_time = jasmine_config.max_time; // in seconds
199         var expected_hits = jasmine_config.expected_hits; // at least expected hit counter
200         var hits = 0;
201
202         waitsFor(function () {
203             hits = get_hit_counter();
204             return hits > expected_hits;
205         }, "Expect " + expected_hits + " hits", max_time * jasmine_config.second);
206
207         runs(function () {
208             debug("mkws pager found records: '" + hits + "'");
209             expect(mkws.$(".mkwsPager").length).toBe(1);
210             expect(hits).toBeGreaterThan(expected_hits);
211         });
212     });
213 });
214
215 describe("Check Termlist", function () {
216     it("found Termlist", function () {
217         var termlist = mkws.$("div.mkwsTermlists");
218         debug("Termlist success: " + termlist.length);
219         expect(termlist.length).toBe(1);
220
221         waitsFor(function () {
222             return mkws.$("div.mkwsFacet[data-mkws-facet='xtargets']").length == 1 ? true : false;
223         }, "check for facet sources", 4 * jasmine_config.second);
224
225         // everything displayed?
226         runs(function () {
227             var sources = mkws.$("div.mkwsFacet[data-mkws-facet='xtargets']");
228             debug("Termlist sources success: " + sources.length);
229             expect(sources.length).toBe(1);
230
231             var subjects = mkws.$("div.mkwsFacet[data-mkws-facet='subject']");
232             expect(subjects.length).toBe(1);
233
234             var authors = mkws.$("div.mkwsFacet[data-mkws-facet='author']");
235             expect(authors.length).toBe(1);
236         });
237
238         waitsFor(function () {
239             return mkws.$("div.mkwsFacet[data-mkws-facet='author'] div.mkwsTerm").length >= 2 ? true : false;
240         }, "At least one author link displayed", 4 * jasmine_config.second);
241
242         runs(function () {
243             expect(mkws.$("div.mkwsFacet[data-mkws-facet='author'] div.mkwsTerm").length).toBeGreaterThan(1);
244         });
245     });
246 });
247
248
249
250 describe("Check Author Facets", function () {
251     it("limit search to first author", function () {
252         if (mkws.config.disable_facet_authors_search) {
253             debug("Facets: ignore limit search for authors");
254             return;
255         }
256
257         var hits_all_targets = get_hit_counter();
258         var author_number = 2; // 2=first author
259         // do not click on author with numbers, e.g.: "Bower, James M. Beeman, David, 1938-"
260         // do not click on author names without a comma, e.g.: "Joe Barbara"
261         // because searching on such authors won't find anything.
262         runs(function () {
263             var terms = mkws.$("div.mkwsFacet[data-mkws-facet='author'] div.mkwsTerm a");
264             for (var i = 0; i < terms.length; i++) {
265                 var term = mkws.$(terms[i]).text();
266                 if (term.match(/[0-9].+[0-9]/i) || !term.match(/,/)) {
267                     debug("ignore author facet: " + term);
268                     author_number++;
269                 } else {
270                     break;
271                 }
272             }
273             if (mkws.$("div.mkwsFacet[data-mkws-facet='author'] div.mkwsTerm:nth-child(" + author_number + ") a").text().length == 0) {
274                 debug("No good authors found. Not clicking on the bad ones");
275                 return;
276             }
277
278             debug("Clicking on author (" + author_number + ") " + mkws.$("div.mkwsFacet[data-mkws-facet='author'] div.mkwsTerm:nth-child(" + author_number + ") a").text());
279             mkws.$("div.mkwsFacet[data-mkws-facet='author'] div.mkwsTerm:nth-child(" + author_number + ") a").trigger("click");
280         });
281
282         waitsFor(function () {
283             var hits_single_target = get_hit_counter();
284             // debug("hits_single_target='" + hits_single_target + "' cf. hits_all_targets='" + hits_all_targets + "'");
285             return hits_single_target > 0 && hits_single_target < hits_all_targets ? true : false;
286         }, "Limited author search for less than " + hits_all_targets + " hits", 4.5 * jasmine_config.second);
287
288         runs(function () {
289             var hits_single_target = get_hit_counter();
290             debug("get less hits for authors: " + hits_all_targets + " > " + hits_single_target);
291         });
292     });
293 });
294
295 describe("Check active clients author", function () {
296     it("check for active clients after limited author search", function () {
297         waitsFor(function () {
298             var clients = mkws.$("div.mkwsStat span.mkwsClientCount");
299             // debug("clients: " + clients.text());
300             return clients.length == 1 && clients.text().match("/[1-9]+[0-9]*$");
301         }, "wait for Active clients: x/y", 5.5 * jasmine_config.second);
302
303         runs(function () {
304             var clients = mkws.$("div.mkwsStat span.mkwsClientCount");
305             debug("span.mkwsClientCount: " + clients.text());
306             expect(clients.text()).toMatch("/[1-9]+[0-9]*$");
307
308             // exact match of active clients (e.g. a SP misconfiguration)
309             if (jasmine_config.active_clients) {
310                 debug("check for " + jasmine_config.active_clients + " active connections");
311                 expect(clients.text()).toMatch(" [0-9]+/" + jasmine_config.active_clients + "$");
312             }
313         });
314     });
315 });
316
317 describe("Check Source Facets", function () {
318     it("limit search to first source", function () {
319         var hits_all_targets = get_hit_counter();
320         var source_number = 2; // 2=first source
321         // wait for a stat response
322         var waitcount = 0;
323         // do not click on wikipedia link - no author or subject facets possible
324         var link = "div.mkwsFacet[data-mkws-facet='xtargets'] div.mkwsTerm a";
325
326         // wait for a visible source link in facets
327         waitsFor(function () {
328             var terms = mkws.$(link);
329             return terms && terms.length > 0;
330         }, "wait for source facets after author search", 5 * jasmine_config.second);
331
332
333         runs(function () {
334             var terms = mkws.$(link);
335             for (var i = 0; i < terms.length; i++) {
336                 var term = mkws.$(terms[i]).text();
337                 debug("check for good source: " + term);
338
339                 if (term.match(/wikipedia/i)) {
340                     debug("ignore source facet: " + term);
341                     source_number++;
342                 } else {
343                     break;
344                 }
345             }
346             debug("Source counter: " + terms.length + ", select: " + (source_number - 1));
347
348             if (mkws.$("div.mkwsFacet[data-mkws-facet='xtargets'] div.mkwsTerm:nth-child(" + source_number + ") a").text().length == 0) {
349                 debug("No good source found. Not clicking on the bad ones");
350                 return;
351             }
352
353             debug("click on source link nth-child(): " + source_number);
354             mkws.$("div.mkwsFacet[data-mkws-facet='xtargets'] div.mkwsTerm:nth-child(" + source_number + ") a").trigger("click");
355
356             mkws.$(".mkwsPager").bind("DOMNodeInserted DOMNodeRemoved propertychange", function () {
357                 waitcount++;
358                 debug("DOM wait for stat: " + waitcount);
359             });
360         });
361
362         waitsFor(function () {
363             if (mkws.$("div.mkwsNavi").length && mkws.$("div.mkwsNavi").text().match(/(Source|datenquelle|kilder): /i)) {
364                 return true;
365             } else {
366                 return false;
367             }
368         }, "Search for source in navi bar", 4 * jasmine_config.second);
369
370         // Note: it may happens that limited source search returns the same number of hits
371         // as before. Thats not really an error, but unfortunate
372         waitsFor(function () {
373             var hits_single_target = get_hit_counter();
374
375             return waitcount >= 2 && hits_single_target > 0 && hits_single_target <= hits_all_targets ? true : false;
376         }, "Limited source search for less than " + hits_all_targets + " hits", 5 * jasmine_config.second);
377
378         runs(function () {
379             var hits_single_target = get_hit_counter();
380             debug("get less hits for sources: " + hits_all_targets + " >= " + hits_single_target);
381             expect(hits_all_targets).not.toBeLessThan(hits_single_target);
382             jasmine_status.source_click = 1;
383
384             mkws.$(".mkwsPager").unbind("DOMNodeInserted DOMNodeRemoved propertychange");
385         });
386     });
387 });
388
389
390 describe("Check record list", function () {
391     it("check for single active client", function () {
392         if (!jasmine_status.source_click) {
393             debug("skip clients check due missing source click");
394             return;
395         }
396
397         waitsFor(function () {
398             var clients = mkws.$("div.mkwsStat span.mkwsClientCount");
399             //debug("clients: " + clients.text());
400             return clients.length == 1 && clients.text().match("/1$");
401         }, "wait for Active clients: x/1", 5 * jasmine_config.second);
402
403         runs(function () {
404             var clients = mkws.$("div.mkwsStat span.mkwsClientCount");
405             debug("span.mkwsClientCount: " + clients.text());
406             expect(clients.text()).toMatch("/1$");
407         });
408     });
409
410     it("got a record", function () {
411         var linkaddr = "div.mkwsRecords div.mkwsSummary:nth-child(1) a";
412
413         waitsFor(function () {
414             // remove + insert node: must be at least 2
415             return mkws.$(linkaddr).length > 0;
416         }, "wait until we see a new record", 2.5 * jasmine_config.second);
417
418         runs(function () {
419             expect(mkws.$(linkaddr).length).toBeGreaterThan(0);
420         });
421     });
422 });
423
424 describe("Show record", function () {
425     var record_number = 1; // the Nth record in hit list
426     it("show record author", function () {
427         var click = mkws.$("div.mkwsRecords div.mkwsSummary:nth-child(" + record_number + ") a").trigger("click");
428         debug("show record click is success: " + click.length);
429         expect(click.length).toBe(1);
430
431         // wait until the record pops up
432         waitsFor(function () {
433             var show = mkws.$("div.mkwsRecords div.mkwsSummary:nth-child(" + record_number + ") > div.mkwsDetails");
434             //debug("poprecord: " + (show ? show.length : -1) + " " + mkws.$("div.mkwsRecords div.mkwsSummary").text());
435             return show != null && show.length ? true : false;
436         }, "wait some miliseconds to show up a record", 2 * jasmine_config.second);
437
438         runs(function () {
439             debug("show record pop up");
440             expect(mkws.$("div.mkwsRecords div.mkwsSummary:nth-child(" + record_number + ") div")).not.toBe(null);
441         });
442     });
443
444     it("extract URL", function () {
445         if (jasmine_config.show_record_url == false) {
446             debug("ignore test for URL in record")
447             return;
448         }
449
450         var urls = mkws.$("div.mkwsRecords div.mkwsSummary:nth-child(" + record_number + ") div table tbody tr td a");
451         debug("number of extracted URL from record: " + urls.length);
452         // expect(urls.length).toBeGreaterThan(0); // LoC has records without links
453         for (var i = 0; i < urls.length; i++) {
454             var url = mkws.$(urls[i]);
455             debug("URL: " + url.attr('href') + " text: " + url.text());
456
457             expect(url.attr('href')).not.toBe(null);
458             expect(url.attr('href')).toMatch(/^https?:\/\/[a-z0-9\-]+\.[0-9a-z].*\//i);
459             expect(url.text()).not.toBe("");
460         }
461     });
462 });
463
464 describe("Check switch menu Records/Targets", function () {
465     it("check mkwsSwitch", function () {
466         expect(mkws.$("div.mkwsSwitch").length).toBe(1);
467
468         // expect 2 clickable links
469         expect(mkws.$("div.mkwsSwitch > a").length).toBe(2);
470     });
471
472     it("switch to target view", function () {
473         mkws.$("div.mkwsSwitch > a").eq(1).trigger("click");
474
475         // now the target table must be visible
476         expect(mkws.$("div.mkwsTargets").is(":visible")).toBe(true);
477         expect(mkws.$("div.mkwsRecords").is(":visible")).toBe(false);
478
479         // wait a half second, to show the target view
480         var time = (new Date).getTime();
481         waitsFor(function () {
482             return (new Date).getTime() - time > 700 ? true : false;
483         }, "wait some miliseconds", 1 * jasmine_config.second);
484
485         // look for table header
486         runs(function () {
487             expect(mkws.$("div.mkwsTargets").html()).toMatch(/Target ID/);
488         });
489     });
490
491     it("switch back to record view", function () {
492         mkws.$("div.mkwsSwitch > a").eq(0).trigger("click");
493
494         // now the target table must be visible
495         expect(mkws.$("div.mkwsTargets").is(":visible")).toBe(false);
496         expect(mkws.$("div.mkwsRecords").is(":visible")).toBe(true);
497     });
498 });
499
500 describe("Check status client counter", function () {
501     function get_time() {
502         var date = new Date();
503         return date.getTime();
504     }
505     var time = get_time();
506
507     it("check status clients", function () {
508         if (!jasmine_status.source_click) {
509             debug("skip clients check due missing source click");
510             return;
511         }
512
513         waitsFor(function () {
514             var clients = mkws.$("div.mkwsStat span.mkwsClientCount");
515             debug("clients: " + clients.text());
516             if (clients.length == 1 && clients.text().match("0/1$")) {
517                 return true;
518             } else {
519                 return false;
520             }
521         }, "wait for Active clients: 0/1", 4 * jasmine_config.second);
522
523         runs(function () {
524             var clients = mkws.$("div.mkwsStat span.mkwsClientCount");
525             debug("span.mkwsClientCount: " + clients.text());
526             expect(clients.text()).toMatch("0/1$");
527         });
528     });
529 });
530
531 /* remove the "source" and "author" facet link to get more records again */
532 describe("Check removable facets links", function () {
533     var $ = mkws.$;
534
535     it("remove links for source and author", function () {
536         var waitcount = 0;
537         if (!jasmine_config.check_sortby) {
538             debug("ignore check for removable facets");
539             return;
540         }
541
542
543         runs(function () {
544             var click = $("a.mkwsRemovable").eq(0).trigger("click");
545             debug("Removed first facets link: " + click.length);
546             expect(click.length).toBe(1);
547         });
548
549         runs(function () {
550             $(".mkwsPager").bind("DOMNodeInserted DOMNodeRemoved propertychange", function () {
551                 waitcount++;
552                 debug("DOM change for removeable: " + waitcount);
553             });
554         });
555
556         waitsFor(function () {
557             return $("a.mkwsRemovable").length == 1 ? 1 : 0;
558         });
559
560         runs(function () {
561             var click = $("a.mkwsRemovable").eq(0).trigger("click");
562             debug("Removed second facets link: " + click.length);
563             expect(click.length).toBe(1);
564         });
565
566         waitsFor(function () {
567             // debug("wait for: " + waitcount);
568             return waitcount >= 2 ? true : false;
569         }, "Records DOM change, by per page", 2 * jasmine_config.second);
570
571
572         runs(function () {
573             debug("unbind removable");
574             $(".mkwsPager").unbind("DOMNodeInserted DOMNodeRemoved propertychange");
575         });
576     });
577 });
578
579
580 describe("Check per page options", function () {
581     var $ = mkws.$;
582
583     it("show per page", function () {
584         if (!jasmine_config.check_sortby) {
585             debug("ignore check for per page select");
586             return;
587         }
588         var waitcount = 0;
589         var per_page_number = 20;
590
591
592         runs(function () {
593             var select = $("select.mkwsPerpage option[selected='selected']");
594             debug("per page default is: " + select.text() + " and unselect it");
595             select.removeAttr('selected');
596
597             select = $("select.mkwsPerpage option[value='" + per_page_number + "']").attr('selected', true);
598             debug("per page is set to: " + select.text());
599             select.trigger("change");
600
601             $("div.mkwsRecords").bind("DOMNodeInserted DOMNodeRemoved propertychange", function () {
602                 waitcount++;
603                 debug("DOM wait for change, per page: " + waitcount);
604             });
605         });
606
607         waitsFor(function () {
608             //debug("wait for: " + waitcount);
609             return waitcount >= 30 ? true : false;
610         }, "Records DOM change, by per page", 3 * jasmine_config.second);
611
612         runs(function () {
613             $("div.mkwsRecords").unbind("DOMNodeInserted DOMNodeRemoved propertychange");
614             debug("unbind per page");
615         });
616
617         runs(function () {
618             var records = $("div.mkwsRecords > div.mkwsSummary");
619             debug("Got now " + records.length + " records");
620             expect(records.length).toBe(per_page_number);
621         });
622     });
623 });
624
625 describe("Check SortBy options", function () {
626     var $ = mkws.$;
627
628     it("show per page", function () {
629         if (!jasmine_config.check_sortby) {
630             debug("ignore check for sort by");
631             return;
632         }
633
634         var waitcount = 0;
635         var sort_value = 'title:1';
636         var per_page_number = 20;
637         var title_list_old = title_list("xxx ");
638
639         function title_list(prefix) {
640             var list = [];
641             var terms = $("div.mkwsRecords > div.mkwsSummary > a");
642             for (var i = 0; i < terms.length; i++) {
643                 var term = $(terms[i]).text();
644                 list.push(term);
645                 // debug(prefix + "title: " + term);
646             }
647             return list;
648         }
649
650         runs(function () {
651             $("div.mkwsRecords").bind("DOMNodeInserted DOMNodeRemoved propertychange", function () {
652                 waitcount++;
653                 //debug("DOM wait for change, sort by: " + waitcount);
654             });
655
656             var select = $("select.mkwsSort option[selected='selected']");
657             debug("Sort by default is: " + select.text() + " and unselect it");
658             select.removeAttr('selected');
659
660             select = $("select.mkwsSort option[value='" + sort_value + "']").attr('selected', true);
661             debug("sort by is set to: " + select.text());
662             select.trigger("change");
663         });
664
665         waitsFor(function () {
666             //debug("wait for2: " + waitcount);
667             return waitcount >= 6 ? true : false;
668         }, "Records DOM change, by sort page", 3 * jasmine_config.second);
669
670         runs(function () {
671             $("div.mkwsRecords").unbind("DOMNodeInserted DOMNodeRemoved propertychange");
672             debug("unbind per page");
673         });
674
675         runs(function () {
676             var records = $("div.mkwsRecords > div.mkwsSummary a");
677             debug("Got now " + records.length + " records");
678             expect(records.length).toBe(per_page_number);
679         });
680
681         runs(function () {
682             var title_list_new = title_list("yyy ");
683             var diff_flag = 0;
684             for (var i = 0; i < title_list_old.length; i++) {
685                 debug(title_list_old[i] + " :: " + title_list_new[i]);
686
687                 if (title_list_old[i] != title_list_new[i]) {
688                     diff_flag++;
689                 }
690             }
691             debug("Title changes: " + diff_flag + " out of " + per_page_number);
692             expect(diff_flag).not.toBe(0);
693         });
694     });
695 });
696
697
698 /* done */
699 describe("All tests are done", function () {
700     it(">>> hooray <<<", function () {
701         mkws.jasmine_done = true;
702     });
703 });