X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=test%2Fspec%2Fmkws-pazpar2.js;h=2651e9f9ea3b3c214edb8c9ea7cd2d875a5d5db4;hb=8b258338f867a9dc69e90e2c918d4291fd11a02f;hp=7313287fd5882376d9858053d75a765b118d6906;hpb=3928471be5d0982fb13158d1842b28a7ed1cb542;p=mkws-moved-to-github.git diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index 7313287..2651e9f 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -179,6 +179,25 @@ describe("Show record", function () { var click = $("div#mkwsRecords div.record:nth-child(3) :nth-child(2)").trigger("click"); debug("show click is success: " + click.length); expect(click.length == 1).toBe(true); + + // wait until the record pops up + waitsFor(function () { + var show = $("div#mkwsRecords div.record:nth-child(3) div"); + return show != null && show.length ? true : false; + }, "wait some miliseconds", 1 * 1000); + + runs(function () { + debug("show record pop up"); + expect($("div#mkwsRecords div.record:nth-child(3) div")).not.toBe(null); + }); + }); + + it("extract URL", function () { + var url = $("div#mkwsRecords div.record:nth-child(3) div table tbody tr td a").text(); + debug("extracted URL from record: " + url); + + expect(url).not.toBe(null); + expect(url).toMatch(/^http:\/\/[a-z0-9]+\.[0-9a-z].*\//i); }); });