*
*/
-function get_hit_counter() {
+var debug = mkws.debug;
+
+var get_hit_counter = function () {
if ($("#mkwsPager").length == 0) return -1;
var found = $("#mkwsPager").text();
- var re = /found: ([0-9]+)/;
+ var re = /\([A-Za-z]+:\s+([0-9]+)\)/;
re.exec(found);
var hits = -1;
});
it("run search query", function () {
- $("input#mkwsQuery").val("freebsd");
- expect($("input#mkwsQuery").val()).toMatch(/^freebsd$/);
+ var search_query = "freebsd"; // short hit counter with some paging
+
+ $("input#mkwsQuery").val(search_query);
+ debug("set search query: " + search_query)
+ expect($("input#mkwsQuery").val()).toMatch("^" + search_query + "$");
+
+ // wait for service proxy auth
+ waitsFor(function () {
+ return mkws.service_proxy_auth;
+ }, "SP auth done", 10 * 1000);
- setTimeout(function () {
- $("input#mkwsButton").trigger("click");
- }, 3 * 1000);
+ runs(function () {
+ debug("Submit search");
+ var click = $("input#mkwsButton").trigger("click");
+ expect(click.length == 1).toBe(true);
+ })
});
});
}
var time = get_time();
- it("limit search to first author", function () {
+ it("check status clients", function () {
waitsFor(function () {
var clients = $("div#mkwsStat span.clients");