it("MOTD is hidden", function () {
expect($(".mkwsMOTD").length).toBe(1);
expect($(".mkwsMOTD").is(":hidden")).toBe(true);
- debug("motd " + $(".mkwsMOTD") );
- debug("motd t=" + $(".mkwsMOTD").text() );
- debug("motd v=" + $(".mkwsMOTD").is(":visible") );
+ //debug("motd " + $(".mkwsMOTD"));
+ debug("motd t=" + $(".mkwsMOTD").text());
+ debug("motd v=" + $(".mkwsMOTD").is(":visible"));
//expect($("div.mkwsBytarget").is(":visible")).toBe(true);
});
});
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 () {
break;
}
}
+ if ($("div.mkwsFacetSources div.term:nth-child(" + source_number + ") a").text().length == 0) {
+ debug("No good source found. Not clicking on the bad ones");
+ return;
+ }
$("div.mkwsFacetSources div.term:nth-child(" + source_number + ") a").trigger("click");
-
+
waitsFor(function () {
if ($("div.mkwsNavi").length && $("div.mkwsNavi").text().match(/(Source|datenquelle|kilder): /i)) {
return true;
});
});
+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());
+ return ($(linkaddr).length > 0);
+ }, "wait until we see a link", 1 * jasmine_config.second);
+
+ runs(function () {
+ var link = $(linkaddr);
+ debug("== waited (" + waitcount + ") for the link..." + $(linkaddr) + " =" + $(linkaddr).length + " " + $(linkaddr).text());
+ expect(link.length).toBe(1);
+ // link.trigger("click");
+ });
+ });
+});
+
+
describe("Show record", function () {
var record_number = 1; // the Nth record in hit list
it("show record author", function () {
- $("div.mkwsRecords div.record:nth-child(" + record_number + ") a").trigger("click");
+ 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 () {
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); // LoC has records without links
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("");
}
});
});