-var get_hit_counter = function () {
- // not yet here
- if ($("#mkwsPager").length == 0)
- return -1;
-
- var found = $("#mkwsPager").text();
- var re = /\([A-Za-z]+:\s+([0-9]+)\)/;
- re.exec(found);
- var hits = -1;
-
- if (RegExp.$1) {
- hits = parseInt(RegExp.$1);
- expect(hits).toBeGreaterThan(0);
+ // Define empty mkws_config for simple applications that don't define it.
+if (jasmine_config == null || typeof jasmine_config != 'object') {
+ var jasmine_config = {};
+}
+
+/* check config for jasmine test
+ *
+ * you can override the default values in the config
+ * object: jasmine_config = {};
+ *
+ */
+function init_jasmine_config() {
+
+ var jasmine_config_default = {
+ search_query: "freebsd",
+ max_time: 16,
+ // in seconds
+ expected_hits: 80,
+ // at least expected hit counter
+ second: 1000,
+ // miliseconds to seconds
+ show_record_url: true,
+ // check for valid URL in records
+ dummy: false
+ };
+
+ // use default values for undefined values
+ for (var key in jasmine_config_default) {
+ if (!jasmine_config.hasOwnProperty(key)) {
+ jasmine_config[key] = jasmine_config_default[key];
+ }
+ debug("jasmine config: " + key + " => " + jasmine_config[key]);