From: Wolfram Schneider Date: Fri, 7 Mar 2014 17:06:52 +0000 (+0000) Subject: fix xpath for URL extract check X-Git-Tag: 1.0.0~1318^2~18 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=76825d7130f09981564ecc733b5302ed464f4979;p=mkws-moved-to-github.git fix xpath for URL extract check --- diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index 7c77122..a49598b 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -365,14 +365,17 @@ describe("Show record", function () { return; } - var urls = $("div#mkwsRecords div.record:nth-child(" + record_number + ") div table tbody tr td a"); + var urls = $("div.mkwsRecords div.record:nth-child(" + record_number + ") div table tbody tr td a"); debug("number of extracted URL from record: " + urls.length); + expect(urls.length).toBeGreaterThan(0); + for (var i = 0; i < urls.length; i++) { var url = $(urls[i]); - debug("URL: " + url.attr('href')); + debug("URL: " + url.attr('href') + " text: " + url.text()); + expect(url.attr('href')).not.toBe(null); expect(url.attr('href')).toMatch(/^https?:\/\/[a-z0-9]+\.[0-9a-z].*\//i); - expect(url.attr('href')).toBe(url.text()); + expect(url.text()).not.toBe(""); } }); });