var jasmine_config_default = {
search_query: "freebsd",
- max_time: 16,
+ max_time: 17,
// in seconds
expected_hits: 80,
// at least expected hit counter
// miliseconds to seconds
show_record_url: true,
// check for valid URL in records
+ check_motd: true,
dummy: false
};
if (RegExp.$1) {
hits = parseInt(RegExp.$1);
if (hits <= 0) {
- debug("Oooops in get_hit_counter: " + RegExp.$1);
+ debug("Oooops in get_hit_counter: " + RegExp.$1 + " '" + found + "'");
}
- expect(hits).toBeGreaterThan(0);
}
//debug("Hits: " + hits);
describe("Check MOTD after search", function () {
it("MOTD is hidden", function () {
+ if (!jasmine_config.check_motd) {
+ return;
+ }
+
expect($(".mkwsMOTD").length).toBe(1);
expect($(".mkwsMOTD").is(":hidden")).toBe(true);
debug("motd t=" + $(".mkwsMOTD").text());
runs(function () {
var hits_single_target = get_hit_counter();
debug("get less hits for authors: " + hits_all_targets + " > " + hits_single_target);
- expect(hits_all_targets).toBeGreaterThan(hits_single_target);
});
});
});
describe("Check active clients author", function () {
it("check for active clients after limited author search", function () {
waitsFor(function () {
- var clients = $("div.mkwsStat span.clients");
- //debug("clients: " + clients.text());
- return clients.length == 1 && clients.text().match("/[1-9]+[0-9]+$");
- }, "wait for Active clients: x/y", 5 * jasmine_config.second);
+ var clients = $("div.mkwsStat span.mkwsClientCount");
+ // debug("clients: " + clients.text());
+ return clients.length == 1 && clients.text().match("/[1-9]+[0-9]*$");
+ }, "wait for Active clients: x/y", 5.5 * jasmine_config.second);
runs(function () {
- var clients = $("div.mkwsStat span.clients");
- debug("span.clients: " + clients.text());
- expect(clients.text()).toMatch("/[1-9]+[0-9]+$");
+ var clients = $("div.mkwsStat span.mkwsClientCount");
+ debug("span.mkwsClientCount: " + clients.text());
+ expect(clients.text()).toMatch("/[1-9]+[0-9]*$");
// exact match of active clients (e.g. a SP misconfiguration)
if (jasmine_config.active_clients) {
runs(function () {
var hits_single_target = get_hit_counter();
- debug("get less hits for sources: " + hits_all_targets + " > " + hits_single_target);
+ debug("get less hits for sources: " + hits_all_targets + " >= " + hits_single_target);
expect(hits_all_targets).not.toBeLessThan(hits_single_target);
jasmine_status.source_click = 1;
}
waitsFor(function () {
- var clients = $("div.mkwsStat span.clients");
+ var clients = $("div.mkwsStat span.mkwsClientCount");
//debug("clients: " + clients.text());
return clients.length == 1 && clients.text().match("/1$");
}, "wait for Active clients: x/1", 5 * jasmine_config.second);
runs(function () {
- var clients = $("div.mkwsStat span.clients");
- debug("span.clients: " + clients.text());
+ var clients = $("div.mkwsStat span.mkwsClientCount");
+ debug("span.mkwsClientCount: " + clients.text());
expect(clients.text()).toMatch("/1$");
});
});
it("got a record", function () {
- var linkaddr = "div.mkwsRecords div.record:nth-child(1) a";
+ var linkaddr = "div.mkwsRecords div.mkwsSummary:nth-child(1) a";
waitsFor(function () {
// remove + insert node: must be at least 2
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");
+ var click = $("div.mkwsRecords div.mkwsSummary: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 () {
- var show = $("div.mkwsRecords div.record:nth-child(" + record_number + ") > div.details");
- //debug("poprecord: " + (show ? show.length : -1) + " " + $("div.mkwsRecords div.record").text());
+ var show = $("div.mkwsRecords div.mkwsSummary:nth-child(" + record_number + ") > div.mkwsDetails");
+ //debug("poprecord: " + (show ? show.length : -1) + " " + $("div.mkwsRecords div.mkwsSummary").text());
return show != null && show.length ? true : false;
}, "wait some miliseconds to show up a record", 2 * jasmine_config.second);
runs(function () {
debug("show record pop up");
- expect($("div.mkwsRecords div.record:nth-child(" + record_number + ") div")).not.toBe(null);
+ expect($("div.mkwsRecords div.mkwsSummary:nth-child(" + record_number + ") div")).not.toBe(null);
});
});
return;
}
- var urls = $("div.mkwsRecords div.record:nth-child(" + record_number + ") div table tbody tr td a");
+ var urls = $("div.mkwsRecords div.mkwsSummary: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++) {
$("div.mkwsSwitch").children('a').eq(1).trigger("click");
// now the target table must be visible
- expect($("div.mkwsBytarget").is(":visible")).toBe(true);
+ expect($("div.mkwsTargets").is(":visible")).toBe(true);
expect($("div.mkwsRecords").is(":visible")).toBe(false);
// wait a half second, to show the target view
// look for table header
runs(function () {
- expect($("div.mkwsBytarget").html()).toMatch(/Target ID/);
+ expect($("div.mkwsTargets").html()).toMatch(/Target ID/);
});
});
$("div.mkwsSwitch").children('a').eq(0).trigger("click");
// now the target table must be visible
- expect($("div.mkwsBytarget").is(":visible")).toBe(false);
+ expect($("div.mkwsTargets").is(":visible")).toBe(false);
expect($("div.mkwsRecords").is(":visible")).toBe(true);
});
});
}
waitsFor(function () {
- var clients = $("div.mkwsStat span.clients");
+ var clients = $("div.mkwsStat span.mkwsClientCount");
debug("clients: " + clients.text());
if (clients.length == 1 && clients.text().match("0/1$")) {
return true;
}, "wait for Active clients: 0/1", 4 * jasmine_config.second);
runs(function () {
- var clients = $("div.mkwsStat span.clients");
- debug("span.clients: " + clients.text());
+ var clients = $("div.mkwsStat span.mkwsClientCount");
+ debug("span.mkwsClientCount: " + clients.text());
expect(clients.text()).toMatch("0/1$");
});
});