assume batch testing if running on http://localhost:4040
[mkws-moved-to-github.git] / test / spec / mkws-pazpar2.js
index b5e3707..1717551 100644 (file)
@@ -30,6 +30,9 @@ var jasmine_status = {
 function init_jasmine_config() {
 
     var jasmine_config_default = {
+        // tune parameter for batch testing
+        batch_tuning: true,
+
         search_query: "freebsd",
         max_time: 17,
         // in seconds
@@ -55,6 +58,21 @@ function init_jasmine_config() {
         debug("jasmine config: " + key + " => " + jasmine_config[key]);
     }
 
+    // jenkins batch tests
+    if (jasmine_config.batch_tuning) {
+        var sec = mkws.getParameterByName("second", document.location);
+
+        // run on localhost
+        if (!sec && document.location.href.match(/^http:\/\/localhost:4040/)) {
+            sec = 2000;
+        }
+
+        if (sec && parseInt(sec) >= 100) {
+            jasmine_config.second = parseInt(sec);
+            debug("longer timeouts for batch testing: " + jasmine_config.second);
+        }
+    }
+
     mkws.jasmine_done = false;
 };
 
@@ -618,10 +636,10 @@ describe("Check translations", function () {
         }
 
 
-        expect($("select.mkws-sort > option[selected=selected").text()).toBe(M("relevance"));
+        expect($("select.mkws-sort > option[selected=selected]").text()).toBe(M("relevance"));
     });
 
-    xit("facets sidebar", function () {
+    it("facets sidebar", function () {
         var list = $(".mkws-facet-title");
         var text = ["Sources", "Subjects", "Authors"];
 
@@ -654,6 +672,12 @@ describe("Check translations", function () {
 
         check_translation(list, text);
     });
+
+/* not tested
+     *
+     * Status line:  -- Active clients : 0/1 -- Retrieved records : 4/4
+     *
+     */
 });
 
 describe("Check status client counter", function () {