From f10f7caa69b0422d2f23ba69e70d09fbe9fee431 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Fri, 6 Sep 2013 11:53:55 +0000 Subject: [PATCH] reorder tests: first limit by author, than by sources Otherwise it could happens that the wikipedia target is the first source, but wikipedia has no authors --- test/spec/mkws-pazpar2.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index 25b18e0..fa695bc 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -129,46 +129,46 @@ describe("Check Termlist", function () { expect(authors.length == 1).toBe(true); }); - it("limit search to first source", function () { + it("limit search to first author", function () { var hits_all_targets = get_hit_counter(); - var click = $("div#mkwsFacetSources div.term:nth-child(2) a").trigger("click"); - debug("limit source click is success: " + click.length); + var click = $("div#mkwsFacetAuthors div.term:nth-child(2) a").trigger("click"); + debug("limit author click is success: " + click.length); expect(click.length == 1).toBe(true); waitsFor(function () { - if ($("div#mkwsNavi").length && $("div#mkwsNavi").text().match(/^Source/)) { - return true; - } else { - return false; - } - }, "Search for source in navi bar", 1000); - - waitsFor(function () { return get_hit_counter() < hits_all_targets ? true : false; }, "Search for with less hits", 9 * 1000); runs(function () { var hits_single_target = get_hit_counter(); - debug("get less hits for sources: " + hits_all_targets + " > " + hits_single_target); + debug("get less hits for authors: " + hits_all_targets + " > " + hits_single_target); expect(hits_all_targets).toBeGreaterThan(hits_single_target); }); }); - it("limit search to first author", function () { + it("limit search to first source", function () { var hits_all_targets = get_hit_counter(); - var click = $("div#mkwsFacetAuthors div.term:nth-child(2) a").trigger("click"); - debug("limit author click is success: " + click.length); + var click = $("div#mkwsFacetSources div.term:nth-child(2) a").trigger("click"); + debug("limit source click is success: " + click.length); expect(click.length == 1).toBe(true); waitsFor(function () { + if ($("div#mkwsNavi").length && $("div#mkwsNavi").text().match(/^Source/)) { + return true; + } else { + return false; + } + }, "Search for source in navi bar", 1000); + + waitsFor(function () { return get_hit_counter() < hits_all_targets ? true : false; }, "Search for with less hits", 9 * 1000); runs(function () { var hits_single_target = get_hit_counter(); - debug("get less hits for authors: " + hits_all_targets + " > " + hits_single_target); + debug("get less hits for sources: " + hits_all_targets + " > " + hits_single_target); expect(hits_all_targets).toBeGreaterThan(hits_single_target); }); }); -- 1.7.10.4