Detect the case when no author is good enough to click. MKWS-137
authorHeikki Levanto <heikki@indexdata.dk>
Fri, 7 Mar 2014 15:01:32 +0000 (16:01 +0100)
committerHeikki Levanto <heikki@indexdata.dk>
Fri, 7 Mar 2014 15:01:32 +0000 (16:01 +0100)
Detects and logs the situation. Unfortunately, when that happens,
the next test seems to fail...

test/spec/mkws-pazpar2.js

index 50dfa94..3f3278b 100644 (file)
@@ -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 () {