X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=blobdiff_plain;f=test%2Fspec%2Fmkws-pazpar2.js;h=0f19add666705874db6a894a050b87dfaa1a5b02;hp=b32fbb8764e27eace7f3fdec38ce7c83803f2de7;hb=685ffcf938de174c7d869bd4a2acc2fc4fbba904;hpb=b908e407ac8cb8766d5b58d23528635aaf028ffb diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index b32fbb8..0f19add 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 a source facets update", 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 () { @@ -506,10 +537,11 @@ describe("Check switch menu Records/Targets", function () { expect($("div.mkws-records").is(":visible")).toBe(false); // wait a half second, to show the target view + var waittime = 0.7; var time = (new Date).getTime(); waitsFor(function () { - return (new Date).getTime() - time > 700 ? true : false; - }, "wait some miliseconds", 1 * jasmine_config.second); + return (new Date).getTime() - time > (waittime * jasmine_config.second) ? true : false; + }, "wait some miliseconds", (waittime + 0.3) * jasmine_config.second); // look for table header runs(function () { @@ -654,6 +686,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 () {