+
+ it("switch to target view", function () {
+ var click = $("a#mkwsSwitch_targets").trigger("click");
+ debug("target view click is success: " + click.length);
+ expect(click.length).toBe(1);
+
+ // now the target table must be visible
+ expect($("div#mkwsBytarget").is(":visible")).toBe(true);
+ expect($("div#mkwsRecords").is(":visible")).toBe(false);
+
+ // wait a half second, to show the target view
+ var time = (new Date).getTime();
+ waitsFor(function () {
+ return (new Date).getTime() - time > 700 ? true : false;
+ }, "wait some miliseconds", 1 * 1000);
+
+ // look for table header
+ runs(function () {
+ expect($("div#mkwsBytarget").html()).toMatch(/Target ID/);
+ });
+ });
+
+ it("switch back to record view", function () {
+ var click = $("a#mkwsSwitch_records").trigger("click");
+ debug("record view click is success: " + click.length);
+ expect(click.length).toBe(1);
+
+ // now the target table must be visible
+ expect($("div#mkwsBytarget").is(":visible")).toBe(false);
+ expect($("div#mkwsRecords").is(":visible")).toBe(true);
+ });
+});
+
+describe("Check status client counter", function () {
+ function get_time() {
+ var date = new Date();
+ return date.getTime();
+ }
+ var time = get_time();
+
+ it("check status clients", function () {
+ waitsFor(function () {
+ var clients = $("div#mkwsStat span.clients");
+ if (clients.length == 1 && clients.text().match("0/1$")) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }, "wait for Active clients: 0/1", 4 * 1000);
+
+/*
+ runs(function () {
+ var clients = $("div#mkwsStat span.clients");
+ debug("span.clients: " + clients.text());
+ expect(clients.text()).toEqual("0/1");
+ });
+ */
+
+ });
+
+});
+
+/* dummy EOF */
+describe("All tests are done", function () {
+ it(">>> hooray <<<", function () {});