From 7ea430e024cd7ea2fa9d04bd9c4ebf3a2f3f4f12 Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Fri, 7 Mar 2014 16:01:32 +0100 Subject: [PATCH] Detect the case when no author is good enough to click. MKWS-137 Detects and logs the situation. Unfortunately, when that happens, the next test seems to fail... --- test/spec/mkws-pazpar2.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index 50dfa94..3f3278b 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -256,7 +256,13 @@ describe("Check Termlist", function () { break; } } - + if ($("div.mkwsFacetAuthors div.term:nth-child(" + author_number + ") a").text().length == 0) { + debug("No good authors found. Not clicking on the bad ones"); + return; + } + + debug("Clicking on author (" + author_number +") " + + $("div.mkwsFacetAuthors div.term:nth-child(" + author_number + ") a").text() ); $("div.mkwsFacetAuthors div.term:nth-child(" + author_number + ") a").trigger("click"); waitsFor(function () { -- 1.7.10.4