1 /* Copyright (c) 2013 IndexData ApS. http://indexdata.com
3 * perform papzpar2 / pz2.js search & retrieve request in the browser
7 function my_click(id, time) {
8 setTimeout(function () {
9 debug("trigger click on id: " + id);
10 $(id).trigger("click");
14 function found(time) {
15 setTimeout(function () {
16 var found = $("#mkwsPager").html().match(/found: ([0-9]+)/);
17 debug("mkws pager found records: " + (found != null ? found[0] : "unknown"));
21 describe("Check pazpar2 search", function () {
22 it("pazpar2 was successfully initialize", function () {
23 expect(mkws_config.error).toBe(undefined);
26 it("validate HTML id's", function () {
27 expect($("input#mkwsQuery").length == 1).toBe(true);
28 expect($("input#mkwsButton").length == 1).toBe(true);
30 expect($("#mkwsNext").length == 1).toBe(false);
31 expect($("#mkwsPrev").length == 1).toBe(false);
34 it("run search query", function () {
35 $("input#mkwsQuery").val("freebsd");
36 expect($("input#mkwsQuery").val()).toMatch(/^freebsd$/);
38 setTimeout(function () {
39 $("input#mkwsButton").trigger("click");
44 it("check running search", function () {
45 my_click("#mkwsNext", 10);
46 my_click("#mkwsNext", 13);
47 my_click("#mkwsPrev", 15);
49 if ($("#mkwsPager").length) {
57 debug("no mkws page found");