run a basic search for "freebsd", check the hit counter and click on next/prev
authorWolfram Schneider <wosch@indexdata.dk>
Thu, 22 Aug 2013 12:37:51 +0000 (14:37 +0200)
committerWolfram Schneider <wosch@indexdata.dk>
Thu, 22 Aug 2013 12:37:51 +0000 (14:37 +0200)
examples/htdocs/index-jasmine.html

index dd6f882..1aa6731 100644 (file)
         </td>
       </tr>
     </table>
+    <script>
+    $(document).ready(function() {
+       debug("document ready");
+       setTimeout(function () {
+         debug("start search");
+         $("input#mkwsQuery").val("freebsd");
+         $("input#mkwsButton").trigger("click");
+
+         function my_click (id, time) {
+           setTimeout(function () {
+             debug("trigger click on id: " + id);
+             $(id).trigger("click");
+           }, time*1000);
+         }
+
+         function found (time) {
+           setTimeout(function() {
+             var found = $("#mkwsPager").html().match(/found: ([0-9]+)/);
+             debug("mkws pager found records: " + (found != null ? found[0] : "unknown"));
+           }, time*1000);
+         }
+
+         my_click("#mkwsNext", 10);
+         my_click("#mkwsNext", 13);
+         my_click("#mkwsPrev", 15);
+
+         if ($("#mkwsPager").length) {
+           found(0);
+           found(5);
+           found(10);
+           found(15);
+           found(25);
+
+         } else {
+           debug("no mkws page found");
+         }
+       }, 1000);
+    });
+    </script>
   </body>
 </html>