X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=blobdiff_plain;f=test%2Fspec%2Fmkws-pazpar2.js;h=39a846163a8cf2a3e1f41cf5b8bd47e93622b719;hp=487636d7fc47e0881a06ea3add81fbec96b43d1f;hb=3352d2985a0abb5898b44cd6cb8e15f515995ae3;hpb=2486a3a6a3cf359ec252100dfb8e0d398918ab58 diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index 487636d..39a8461 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -30,6 +30,9 @@ var jasmine_status = { function init_jasmine_config() { var jasmine_config_default = { + // tune parameter for batch testing + batch_tuning: true, + search_query: "freebsd", max_time: 17, // in seconds @@ -55,6 +58,21 @@ function init_jasmine_config() { debug("jasmine config: " + key + " => " + jasmine_config[key]); } + // jenkins batch tests + if (jasmine_config.batch_tuning) { + var sec = mkws.getParameterByName("second", document.location); + + // run on localhost + if (!sec && document.location.href.match(/^http:\/\/localhost:4040/)) { + sec = 2000; + } + + if (sec && parseInt(sec) >= 100) { + jasmine_config.second = parseInt(sec); + debug("longer timeouts for batch testing: " + jasmine_config.second); + } + } + mkws.jasmine_done = false; }; @@ -333,6 +351,19 @@ describe("Check active clients author", function () { } }); }); + + // avoid race conditions of source facets updates + it("wait a little bit for source facets", function () { + // wait a half second, to show the target view + var waittime = 0.5; + var time = (new Date).getTime(); + + waitsFor(function () { + return (new Date).getTime() - time > waittime * jasmine_config.second ? true : false; + }, "wait some miliseconds", (waittime + 0.5) * jasmine_config.second); + + runs(function () {}); + }); }); describe("Check Source Facets", function () { @@ -580,6 +611,10 @@ describe("Check translations", function () { "Location": "Ort", "Records": "Datensätze", "Targets": "Datenbanken", + "relevance": "Relevanz", + "title": "Titel", + "newest": "Neueste", + "oldest": "Älteste", "dummy": "dummy" }, @@ -612,9 +647,12 @@ describe("Check translations", function () { expect("Sorter efter").toBe(M("Sort by")); expect("Sorter efter").toBe($(list[0]).text()); } + + + expect($("select.mkws-sort > option[selected=selected]").text()).toBe(M("relevance")); }); - xit("facets sidebar", function () { + it("facets sidebar", function () { var list = $(".mkws-facet-title"); var text = ["Sources", "Subjects", "Authors"]; @@ -647,6 +685,12 @@ describe("Check translations", function () { check_translation(list, text); }); + +/* not tested + * + * Status line: -- Active clients : 0/1 -- Retrieved records : 4/4 + * + */ }); describe("Check status client counter", function () {