X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=blobdiff_plain;f=test%2Fspec%2Fmkws-pazpar2.js;h=d042366ce50998ee91c7603ac40c506a2fc868d0;hp=4c26dab41a8ce5259d602ac531913265ef7509b6;hb=c1b2e03ab72aca44ffab13f0b066f93fbc29921d;hpb=6ee57ca3d7fbf96d3e9e6668f8cc70b61f88164c diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index 4c26dab..d042366 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -314,12 +314,12 @@ describe("Check Termlist", function () { }); }); -describe("Show record", function () { - var record_number = 1; // the Nth record in hit list - it("show record author", function () { +describe("Check record list", function () { + it("got a record", function () { // make sure we have a link. var linkaddr = "div.mkwsRecords div.record:nth-child(1) a"; var waitcount = 0; + waitsFor(function () { waitcount++; debug("waiting for the link " + waitcount + " " + $(linkaddr) + " =" + $(linkaddr).length + " " + $(linkaddr).text()); @@ -330,8 +330,18 @@ describe("Show record", function () { var link = $(linkaddr); debug("== waited (" + waitcount + ") for the link..." + $(linkaddr) + " =" + $(linkaddr).length + " " + $(linkaddr).text()); expect(link.length).toBe(1); - link.trigger("click"); + // link.trigger("click"); }); + }); +}); + + +describe("Show record", function () { + var record_number = 1; // the Nth record in hit list + it("show record author", function () { + var click = $("div.mkwsRecords div.record:nth-child(" + record_number + ") a").trigger("click"); + debug("show record click is success: " + click.length); + expect(click.length).toBe(1); // wait until the record pops up waitsFor(function () {