X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fspec%2Fmkws-pazpar2.js;h=3433115646fef3542bf21b06bc77eef6d8fb8633;hb=9f5634aae3265dff242615b82419ca15f3dc3d14;hp=6ba8fdffcfbc3778c7c2a4ff939ba9a7b50e5e00;hpb=0a911e328080194a1dd92c6f69ae12a84fdba5df;p=mkws-moved-to-github.git diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index 6ba8fdf..3433115 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -28,7 +28,7 @@ function init_jasmine_config() { var jasmine_config_default = { search_query: "freebsd", - max_time: 16, + max_time: 17, // in seconds expected_hits: 80, // at least expected hit counter @@ -36,6 +36,7 @@ function init_jasmine_config() { // miliseconds to seconds show_record_url: true, // check for valid URL in records + check_motd: true, dummy: false }; @@ -62,9 +63,8 @@ var get_hit_counter = function () { if (RegExp.$1) { hits = parseInt(RegExp.$1); if (hits <= 0) { - debug("Oooops in get_hit_counter: " + RegExp.$1); + debug("Oooops in get_hit_counter: " + RegExp.$1 + " '" + found + "'"); } - expect(hits).toBeGreaterThan(0); } //debug("Hits: " + hits); @@ -139,6 +139,10 @@ describe("Check pazpar2 search", function () { describe("Check MOTD after search", function () { it("MOTD is hidden", function () { + if (!jasmine_config.check_motd) { + return; + } + expect($(".mkwsMOTD").length).toBe(1); expect($(".mkwsMOTD").is(":hidden")).toBe(true); debug("motd t=" + $(".mkwsMOTD").text()); @@ -285,14 +289,14 @@ describe("Check active clients author", function () { it("check for active clients after limited author search", function () { waitsFor(function () { var clients = $("div.mkwsStat span.clients"); - //debug("clients: " + clients.text()); - return clients.length == 1 && clients.text().match("/[1-9]+[0-9]+$"); - }, "wait for Active clients: x/y", 5 * jasmine_config.second); + // debug("clients: " + clients.text()); + return clients.length == 1 && clients.text().match("/[1-9]+[0-9]*$"); + }, "wait for Active clients: x/y", 5.5 * jasmine_config.second); runs(function () { var clients = $("div.mkwsStat span.clients"); debug("span.clients: " + clients.text()); - expect(clients.text()).toMatch("/[1-9]+[0-9]+$"); + expect(clients.text()).toMatch("/[1-9]+[0-9]*$"); // exact match of active clients (e.g. a SP misconfiguration) if (jasmine_config.active_clients) {