From b5c1d1eb4a29e9fba366ac253c02f27e6f6d8142 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Fri, 24 Jan 2014 14:15:20 +0000 Subject: [PATCH] use the more portable $(obj).text() instead obj.text, MKWS-77 jquery xpath match returns a list of HTML object, so we need to convert the object back to jquery, and run the .text() method on it instead .text property --- test/spec/mkws-pazpar2.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index e52e0f8..657b5dd 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -212,7 +212,7 @@ describe("Check Termlist", function () { // do not click on author names without a comma, e.g.: "Joe Barbara" var terms = $("div#mkwsFacetAuthors div.term a"); for (var i = 0; i < terms.length; i++) { - var term = terms[i].text; + var term = $(terms[i]).text(); if (term.match(/[0-9].+[0-9]/i) || !term.match(/,/)) { debug("ignore author facet: " + term); author_number++; @@ -239,11 +239,13 @@ describe("Check Termlist", function () { it("limit search to first source", function () { var hits_all_targets = get_hit_counter(); var source_number = 2; // 2=first source + // do not click on wikipedia link - no author or subject facets possible var terms = $("div#mkwsFacetSources div.term a"); for (var i = 0; i < terms.length; i++) { - if (terms[i].text.match(/wikipedia/i)) { - debug("ignore source facet: " + terms[i].text); + var term = $(terms[i]).text(); + if (term.match(/wikipedia/i)) { + debug("ignore source facet: " + term); source_number++; } else { break; -- 1.7.10.4