myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hno...@apache.org
Subject [myfaces-tobago] 01/02: migrate QUnit tests to Jasmine
Date Fri, 24 Apr 2020 11:48:45 GMT
This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 31d9d349dcaf5b50925df9296cd6a07da0e2bb2c
Author: Jasmin Kroeger <jasmin.kroeger@irian.eu>
AuthorDate: Thu Apr 16 16:20:27 2020 +0200

    migrate QUnit tests to Jasmine
    
    * migrate tests
---
 .../080-sheet/10-sort/Sheet_Sorting.test.js        | 1371 ++++++++++----------
 .../080-sheet/30-event/Sheet_Event.test.js         |  295 ++---
 .../080-sheet/70-tree/Sheet_Tree.test.js           |   68 +-
 3 files changed, 799 insertions(+), 935 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/Sheet_Sorting.test.js b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/Sheet_Sorting.test.js
index e4eeba2..772f1a4 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/Sheet_Sorting.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/Sheet_Sorting.test.js
@@ -15,214 +15,188 @@
  * limitations under the License.
  */
 
-import {testFrameQuerySelectorAllFn, testFrameQuerySelectorFn} from "/script/tobago-test.js";
-import {TobagoTestTool} from "/tobago/test/tobago-test-tool.js";
+import {querySelectorAllFn, querySelectorFn} from "/script/tobago-test.js";
+import {JasmineTestTool} from "/tobago/test/tobago-test-tool.js";
 
-QUnit.test("Basics: Name", function (assert) {
-  let colNameFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:columnName_sorter");
-  let rowsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
-  let leftPagingFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-left input");
+it("Basics: Name", function (done) {
+  let colNameFn = querySelectorFn("#page\\:mainForm\\:s1\\:columnName_sorter");
+  let rowsFn = querySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
+  let leftPagingFn = querySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-left input");
 
-  let TTT = new TobagoTestTool(assert);
-  if (!colNameFn().classList.contains("tobago-sheet-header-markup-ascending")) {
-    TTT.action(function () {
-      colNameFn().dispatchEvent(new Event("click", {bubbles: true}));
-    });
-    TTT.waitForResponse();
-  }
-  TTT.asserts(3, function () {
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-sortable"));
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-ascending"));
-    assert.notOk(colNameFn().classList.contains("tobago-sheet-header-markup-descending"));
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "22";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Earth", "365.26", "",
-        "Elara", "259.65", "1905",
-        "Enceladus", "1.37", "1789",
-        "Epimetheus", "0.69", "1980");
-  });
-  TTT.action(function () {
-    colNameFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Proteus", "1.12", "1989",
-        "Prospero", "-1962.95", "1999",
-        "Prometheus", "0.61", "1980",
-        "Praxidike", "625.3", "2000");
-  });
-  TTT.action(function () {
-    colNameFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Earth", "365.26", "",
-        "Elara", "259.65", "1905",
-        "Enceladus", "1.37", "1789",
-        "Epimetheus", "0.69", "1980");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.setup(
+      () => colNameFn().classList.contains("tobago-sheet-header-markup-ascending"),
+      () => colNameFn().dispatchEvent(new Event("click", {bubbles: true}))
+  );
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-sortable")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-ascending")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-descending")).not.toBe(true));
+  test.do(() => leftPagingFn().value = "22");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Earth", "365.26", "",
+      "Elara", "259.65", "1905",
+      "Enceladus", "1.37", "1789",
+      "Epimetheus", "0.69", "1980"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Earth", "365.26", "",
+      "Elara", "259.65", "1905",
+      "Enceladus", "1.37", "1789",
+      "Epimetheus", "0.69", "1980"));
+  test.do(() => colNameFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Proteus", "1.12", "1989",
+      "Prospero", "-1962.95", "1999",
+      "Prometheus", "0.61", "1980",
+      "Praxidike", "625.3", "2000"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Proteus", "1.12", "1989",
+      "Prospero", "-1962.95", "1999",
+      "Prometheus", "0.61", "1980",
+      "Praxidike", "625.3", "2000"
+  ));
+  test.do(() => colNameFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Earth", "365.26", "",
+      "Elara", "259.65", "1905",
+      "Enceladus", "1.37", "1789",
+      "Epimetheus", "0.69", "1980"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Earth", "365.26", "",
+      "Elara", "259.65", "1905",
+      "Enceladus", "1.37", "1789",
+      "Epimetheus", "0.69", "1980"
+  ));
+  test.start();
 });
 
-QUnit.test("Basics: Period", function (assert) {
-  let colPeriodFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:columnPeriod_sorter");
-  let rowsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
-  let leftPagingFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-left input");
+it("Basics: Period", function (done) {
+  let colPeriodFn = querySelectorFn("#page\\:mainForm\\:s1\\:columnPeriod_sorter");
+  let rowsFn = querySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
+  let leftPagingFn = querySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-left input");
 
-  let TTT = new TobagoTestTool(assert);
-  if (!colPeriodFn().classList.contains("tobago-sheet-header-markup-ascending")) {
-    TTT.action(function () {
-      colPeriodFn().dispatchEvent(new Event("click", {bubbles: true}));
-    });
-    TTT.waitForResponse();
-  }
-  TTT.asserts(3, function () {
-    assert.ok(colPeriodFn().classList.contains("tobago-sheet-header-markup-sortable"));
-    assert.ok(colPeriodFn().classList.contains("tobago-sheet-header-markup-ascending"));
-    assert.notOk(colPeriodFn().classList.contains("tobago-sheet-header-markup-descending"));
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "29";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Rosalind", "0.56", "1986",
-        "Pan", "0.58", "1990",
-        "Atlas", "0.6", "1980",
-        "Prometheus", "0.61", "1980");
-  });
-  TTT.action(function () {
-    colPeriodFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Callisto", "16.69", "1610",
-        "Titan", "15.95", "1655",
-        "Oberon", "13.46", "1787",
-        "Titania", "8.71", "1787");
-  });
-  TTT.action(function () {
-    colPeriodFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Rosalind", "0.56", "1986",
-        "Pan", "0.58", "1990",
-        "Atlas", "0.6", "1980",
-        "Prometheus", "0.61", "1980");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.setup(
+      () => colPeriodFn().classList.contains("tobago-sheet-header-markup-ascending"),
+      () => colPeriodFn().dispatchEvent(new Event("click", {bubbles: true}))
+  );
+  test.do(() => expect(colPeriodFn().classList.contains("tobago-sheet-header-markup-sortable")).toBe(true));
+  test.do(() => expect(colPeriodFn().classList.contains("tobago-sheet-header-markup-ascending")).toBe(true));
+  test.do(() => expect(colPeriodFn().classList.contains("tobago-sheet-header-markup-descending")).not.toBe(true));
+  test.do(() => leftPagingFn().value = "29");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Rosalind", "0.56", "1986",
+      "Pan", "0.58", "1990",
+      "Atlas", "0.6", "1980",
+      "Prometheus", "0.61", "1980"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Rosalind", "0.56", "1986",
+      "Pan", "0.58", "1990",
+      "Atlas", "0.6", "1980",
+      "Prometheus", "0.61", "1980"));
+  test.do(() => colPeriodFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Callisto", "16.69", "1610",
+      "Titan", "15.95", "1655",
+      "Oberon", "13.46", "1787",
+      "Titania", "8.71", "1787"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Callisto", "16.69", "1610",
+      "Titan", "15.95", "1655",
+      "Oberon", "13.46", "1787",
+      "Titania", "8.71", "1787"));
+  test.do(() => colPeriodFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Rosalind", "0.56", "1986",
+      "Pan", "0.58", "1990",
+      "Atlas", "0.6", "1980",
+      "Prometheus", "0.61", "1980"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Rosalind", "0.56", "1986",
+      "Pan", "0.58", "1990",
+      "Atlas", "0.6", "1980",
+      "Prometheus", "0.61", "1980"));
+  test.start();
 });
 
-QUnit.test("Basics: Year", function (assert) {
-  let colYearFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:columnDiscoverYear_sorter");
-  let rowsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
-  let leftPagingFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-left input");
+it("Basics: Year", function (done) {
+  let colYearFn = querySelectorFn("#page\\:mainForm\\:s1\\:columnDiscoverYear_sorter");
+  let rowsFn = querySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
+  let leftPagingFn = querySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-left input");
 
-  let TTT = new TobagoTestTool(assert);
-  if (!colYearFn().classList.contains("tobago-sheet-header-markup-ascending")) {
-    TTT.action(function () {
-      colYearFn().dispatchEvent(new Event("click", {bubbles: true}));
-    });
-    TTT.waitForResponse();
-  }
-  TTT.asserts(3, function () {
-    assert.ok(colYearFn().classList.contains("tobago-sheet-header-markup-sortable"));
-    assert.ok(colYearFn().classList.contains("tobago-sheet-header-markup-ascending"));
-    assert.notOk(colYearFn().classList.contains("tobago-sheet-header-markup-descending"));
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "22";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(4, function () {
-    assert.equal(rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1892", "row0col2");
-    assert.equal(rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1898", "row1col2");
-    assert.equal(rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1904", "row2col2");
-    assert.equal(rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1905", "row3col2");
-  });
-  TTT.action(function () {
-    colYearFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(4, function () {
-    assert.equal(rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1999", "row0col2");
-    assert.equal(rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1999", "row1col2");
-    assert.equal(rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1997", "row2col2");
-    assert.equal(rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1997", "row3col2");
-  });
-  TTT.action(function () {
-    colYearFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(4, function () {
-    assert.equal(rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1892", "row0col2");
-    assert.equal(rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1898", "row1col2");
-    assert.equal(rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1904", "row2col2");
-    assert.equal(rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1905", "row3col2");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.setup(
+      () => colYearFn().classList.contains("tobago-sheet-header-markup-ascending"),
+      () => colYearFn().dispatchEvent(new Event("click", {bubbles: true}))
+  );
+  test.do(() => expect(colYearFn().classList.contains("tobago-sheet-header-markup-sortable")).toBe(true));
+  test.do(() => expect(colYearFn().classList.contains("tobago-sheet-header-markup-ascending")).toBe(true));
+  test.do(() => expect(colYearFn().classList.contains("tobago-sheet-header-markup-descending")).not.toBe(true));
+  test.do(() => leftPagingFn().value = "22");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => rowsFn() && rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim() === "1892");
+  test.do(() => expect(rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1892", "row0col2"));
+  test.do(() => expect(rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1898", "row1col2"));
+  test.do(() => expect(rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1904", "row2col2"));
+  test.do(() => expect(rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1905", "row3col2"));
+  test.do(() => colYearFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => rowsFn() && rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim() === "1999");
+  test.do(() => expect(rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1999", "row0col2"));
+  test.do(() => expect(rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1999", "row1col2"));
+  test.do(() => expect(rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1997", "row2col2"));
+  test.do(() => expect(rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1997", "row3col2"));
+  test.do(() => colYearFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => rowsFn() && rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim() === "1892");
+  test.do(() => expect(rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1892", "row0col2"));
+  test.do(() => expect(rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1898", "row1col2"));
+  test.do(() => expect(rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1904", "row2col2"));
+  test.do(() => expect(rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1905", "row3col2"));
+  test.start();
 });
 
 /**
  * 1. goto line 8
  * 2. goto line 9
  */
-QUnit.test("Basics: left paging", function (assert) {
-  let colNameFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:columnName_sorter");
-  let rowsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
-  let leftPagingFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-left input");
+it("Basics: left paging", function (done) {
+  let colNameFn = querySelectorFn("#page\\:mainForm\\:s1\\:columnName_sorter");
+  let rowsFn = querySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
+  let leftPagingFn = querySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-left input");
 
-  let TTT = new TobagoTestTool(assert);
-  if (!colNameFn().classList.contains("tobago-sheet-header-markup-ascending")) {
-    TTT.action(function () {
-      colNameFn().dispatchEvent(new Event("click", {bubbles: true}));
-    });
-    TTT.waitForResponse();
-  }
-  TTT.asserts(3, function () {
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-sortable"));
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-ascending"));
-    assert.notOk(colNameFn().classList.contains("tobago-sheet-header-markup-descending"));
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "8";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Bianca", "0.43", "1986",
-        "Caliban", "-579.39", "1997",
-        "Callirrhoe", "758.8", "2000",
-        "Callisto", "16.69", "1610");
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "9";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Caliban", "-579.39", "1997",
-        "Callirrhoe", "758.8", "2000",
-        "Callisto", "16.69", "1610",
-        "Calypso", "1.89", "1980");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.setup(
+      () => colNameFn().classList.contains("tobago-sheet-header-markup-ascending"),
+      () => colNameFn().dispatchEvent(new Event("click", {bubbles: true}))
+  );
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-sortable")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-ascending")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-descending")).not.toBe(true));
+  test.do(() => leftPagingFn().value = "8");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Bianca", "0.43", "1986",
+      "Caliban", "-579.39", "1997",
+      "Callirrhoe", "758.8", "2000",
+      "Callisto", "16.69", "1610"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Bianca", "0.43", "1986",
+      "Caliban", "-579.39", "1997",
+      "Callirrhoe", "758.8", "2000",
+      "Callisto", "16.69", "1610"));
+  test.do(() => leftPagingFn().value = "9");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Caliban", "-579.39", "1997",
+      "Callirrhoe", "758.8", "2000",
+      "Callisto", "16.69", "1610",
+      "Calypso", "1.89", "1980"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Caliban", "-579.39", "1997",
+      "Callirrhoe", "758.8", "2000",
+      "Callisto", "16.69", "1610",
+      "Calypso", "1.89", "1980"));
+  test.start();
 });
 
 /**
@@ -230,70 +204,66 @@ QUnit.test("Basics: left paging", function (assert) {
  * 2. goto page 16
  * 3. goto page 13
  */
-QUnit.test("Basics: center paging", function (assert) {
-  let colNameFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:columnName_sorter");
-  let rowsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
-  let leftPagingFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-left input");
-  let centerPagingFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-center li .page-link");
+it("Basics: center paging", function (done) {
+  let colNameFn = querySelectorFn("#page\\:mainForm\\:s1\\:columnName_sorter");
+  let rowsFn = querySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
+  let leftPagingFn = querySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-left input");
+  let centerPagingFn = querySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-center li .page-link");
 
-  let TTT = new TobagoTestTool(assert);
-  if (!colNameFn().classList.contains("tobago-sheet-header-markup-ascending")) {
-    TTT.action(function () {
-      colNameFn().dispatchEvent(new Event("click", {bubbles: true}));
-    });
-    TTT.waitForResponse();
-  }
-  TTT.asserts(3, function () {
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-sortable"));
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-ascending"));
-    assert.notOk(colNameFn().classList.contains("tobago-sheet-header-markup-descending"));
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "1";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "1986U10", "0.64", "1999",
-        "Adrastea", "0.3", "1979",
-        "Amalthea", "0.5", "1892",
-        "Ananke", "-629.77", "1951");
-  });
-  TTT.action(function () {
-    centerPagingFn().item(6).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Epimetheus", "0.69", "1980",
-        "Erinome", "728.3", "2000",
-        "Europa", "3.55", "1610",
-        "Galatea", "0.43", "1989");
-  });
-  TTT.action(function () {
-    centerPagingFn().item(10).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Phoebe", "-550.48", "1898",
-        "Pluto", "90800.0", "1930",
-        "Portia", "0.51", "1986",
-        "Praxidike", "625.3", "2000");
-  });
-  TTT.action(function () {
-    centerPagingFn().item(3).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Neptune", "60190.0", "1846",
-        "Nereid", "360.13", "1949",
-        "Oberon", "13.46", "1787",
-        "Ophelia", "0.38", "1986");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.setup(
+      () => colNameFn().classList.contains("tobago-sheet-header-markup-ascending"),
+      () => colNameFn().dispatchEvent(new Event("click", {bubbles: true}))
+  );
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-sortable")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-ascending")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-descending")).not.toBe(true));
+  test.do(() => leftPagingFn().value = "1");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "1986U10", "0.64", "1999",
+      "Adrastea", "0.3", "1979",
+      "Amalthea", "0.5", "1892",
+      "Ananke", "-629.77", "1951"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "1986U10", "0.64", "1999",
+      "Adrastea", "0.3", "1979",
+      "Amalthea", "0.5", "1892",
+      "Ananke", "-629.77", "1951"));
+  test.do(() => centerPagingFn().item(6).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Epimetheus", "0.69", "1980",
+      "Erinome", "728.3", "2000",
+      "Europa", "3.55", "1610",
+      "Galatea", "0.43", "1989"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Epimetheus", "0.69", "1980",
+      "Erinome", "728.3", "2000",
+      "Europa", "3.55", "1610",
+      "Galatea", "0.43", "1989"));
+  test.do(() => centerPagingFn().item(10).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Phoebe", "-550.48", "1898",
+      "Pluto", "90800.0", "1930",
+      "Portia", "0.51", "1986",
+      "Praxidike", "625.3", "2000"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Phoebe", "-550.48", "1898",
+      "Pluto", "90800.0", "1930",
+      "Portia", "0.51", "1986",
+      "Praxidike", "625.3", "2000"));
+  test.do(() => centerPagingFn().item(3).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Neptune", "60190.0", "1846",
+      "Nereid", "360.13", "1949",
+      "Oberon", "13.46", "1787",
+      "Ophelia", "0.38", "1986"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Neptune", "60190.0", "1846",
+      "Nereid", "360.13", "1949",
+      "Oberon", "13.46", "1787",
+      "Ophelia", "0.38", "1986"));
+  test.start();
 });
 
 /**
@@ -303,301 +273,269 @@ QUnit.test("Basics: center paging", function (assert) {
  * 4. goto page 21 by pressing arrow-left
  * 5. goto page 14
  */
-QUnit.test("Basics: right paging", function (assert) {
-  let colNameFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:columnName_sorter");
-  let rowsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
-  let leftPagingFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-left input");
-  let rightPagingFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-right .page-link");
-  let jumpToPageFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-right .page-link input");
+it("Basics: right paging", function (done) {
+  let colNameFn = querySelectorFn("#page\\:mainForm\\:s1\\:columnName_sorter");
+  let rowsFn = querySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
+  let leftPagingFn = querySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-left input");
+  let rightPagingFn = querySelectorAllFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-right .page-link");
+  let jumpToPageFn = querySelectorFn("#page\\:mainForm\\:s1 .tobago-sheet-paging-markup-right .page-link input");
 
-  let TTT = new TobagoTestTool(assert);
-  if (!colNameFn().classList.contains("tobago-sheet-header-markup-ascending")) {
-    TTT.action(function () {
-      colNameFn().dispatchEvent(new Event("click", {bubbles: true}));
-    });
-    TTT.waitForResponse();
-  }
-  TTT.asserts(3, function () {
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-sortable"));
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-ascending"));
-    assert.notOk(colNameFn().classList.contains("tobago-sheet-header-markup-descending"));
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "22";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Earth", "365.26", "",
-        "Elara", "259.65", "1905",
-        "Enceladus", "1.37", "1789",
-        "Epimetheus", "0.69", "1980");
-  });
-  TTT.action(function () {
-    rightPagingFn().item(0).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "1986U10", "0.64", "1999",
-        "Adrastea", "0.3", "1979",
-        "Amalthea", "0.5", "1892",
-        "Ananke", "-629.77", "1951");
-  });
-  TTT.action(function () {
-    rightPagingFn().item(3).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Ariel", "2.52", "1851",
-        "Atlas", "0.6", "1980",
-        "Belinda", "0.62", "1986",
-        "Bianca", "0.43", "1986");
-  });
-  TTT.action(function () {
-    rightPagingFn().item(4).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Triton", "-5.88", "1846",
-        "Umbriel", "4.14", "1851",
-        "Uranus", "30685.0", "1781",
-        "Venus", "224.7", "");
-  });
-  TTT.action(function () {
-    rightPagingFn().item(1).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Thebe", "0.67", "1979",
-        "Themisto", "130.02", "2000",
-        "Titan", "15.95", "1655",
-        "Titania", "8.71", "1787");
-  });
-  TTT.action(function () {
-    jumpToPageFn().value = "14";
-    jumpToPageFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Neptune", "60190.0", "1846",
-        "Nereid", "360.13", "1949",
-        "Oberon", "13.46", "1787",
-        "Ophelia", "0.38", "1986");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.setup(
+      () => colNameFn().classList.contains("tobago-sheet-header-markup-ascending"),
+      () => colNameFn().dispatchEvent(new Event("click", {bubbles: true}))
+  );
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-sortable")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-ascending")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-descending")).not.toBe(true));
+  test.do(() => leftPagingFn().value = "22");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Earth", "365.26", "",
+      "Elara", "259.65", "1905",
+      "Enceladus", "1.37", "1789",
+      "Epimetheus", "0.69", "1980"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Earth", "365.26", "",
+      "Elara", "259.65", "1905",
+      "Enceladus", "1.37", "1789",
+      "Epimetheus", "0.69", "1980"));
+  test.do(() => rightPagingFn().item(0).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "1986U10", "0.64", "1999",
+      "Adrastea", "0.3", "1979",
+      "Amalthea", "0.5", "1892",
+      "Ananke", "-629.77", "1951"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "1986U10", "0.64", "1999",
+      "Adrastea", "0.3", "1979",
+      "Amalthea", "0.5", "1892",
+      "Ananke", "-629.77", "1951"));
+  test.do(() => rightPagingFn().item(3).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Ariel", "2.52", "1851",
+      "Atlas", "0.6", "1980",
+      "Belinda", "0.62", "1986",
+      "Bianca", "0.43", "1986"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Ariel", "2.52", "1851",
+      "Atlas", "0.6", "1980",
+      "Belinda", "0.62", "1986",
+      "Bianca", "0.43", "1986"));
+  test.do(() => rightPagingFn().item(4).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Triton", "-5.88", "1846",
+      "Umbriel", "4.14", "1851",
+      "Uranus", "30685.0", "1781",
+      "Venus", "224.7", ""));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Triton", "-5.88", "1846",
+      "Umbriel", "4.14", "1851",
+      "Uranus", "30685.0", "1781",
+      "Venus", "224.7", ""));
+  test.do(() => rightPagingFn().item(1).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Thebe", "0.67", "1979",
+      "Themisto", "130.02", "2000",
+      "Titan", "15.95", "1655",
+      "Titania", "8.71", "1787"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Thebe", "0.67", "1979",
+      "Themisto", "130.02", "2000",
+      "Titan", "15.95", "1655",
+      "Titania", "8.71", "1787"));
+  test.do(() => jumpToPageFn().value = "14");
+  test.do(() => jumpToPageFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Neptune", "60190.0", "1846",
+      "Nereid", "360.13", "1949",
+      "Oberon", "13.46", "1787",
+      "Ophelia", "0.38", "1986"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Neptune", "60190.0", "1846",
+      "Nereid", "360.13", "1949",
+      "Oberon", "13.46", "1787",
+      "Ophelia", "0.38", "1986"));
+  test.start();
 });
 
-QUnit.test("Custom Sorting: Name", function (assert) {
-  let colNameFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s2\\:customColumnName_sorter");
-  let rowsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
-  let leftPagingFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-left input");
+it("Custom Sorting: Name", function (done) {
+  let colNameFn = querySelectorFn("#page\\:mainForm\\:s2\\:customColumnName_sorter");
+  let rowsFn = querySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
+  let leftPagingFn = querySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-left input");
 
-  let TTT = new TobagoTestTool(assert);
-  if (!colNameFn().classList.contains("tobago-sheet-header-markup-ascending")) {
-    TTT.action(function () {
-      colNameFn().dispatchEvent(new Event("click", {bubbles: true}));
-    });
-    TTT.waitForResponse();
-  }
-  TTT.asserts(3, function () {
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-sortable"));
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-ascending"));
-    assert.notOk(colNameFn().classList.contains("tobago-sheet-header-markup-descending"));
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "22";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Earth", "365.26", "",
-        "Elara", "259.65", "1905",
-        "Enceladus", "1.37", "1789",
-        "Epimetheus", "0.69", "1980");
-  });
-  TTT.action(function () {
-    colNameFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Proteus", "1.12", "1989",
-        "Prospero", "-1962.95", "1999",
-        "Prometheus", "0.61", "1980",
-        "Praxidike", "625.3", "2000");
-  });
-  TTT.action(function () {
-    colNameFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Earth", "365.26", "",
-        "Elara", "259.65", "1905",
-        "Enceladus", "1.37", "1789",
-        "Epimetheus", "0.69", "1980");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.setup(
+      () => colNameFn().classList.contains("tobago-sheet-header-markup-ascending"),
+      () => colNameFn().dispatchEvent(new Event("click", {bubbles: true}))
+  );
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-sortable")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-ascending")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-descending")).not.toBe(true));
+  test.do(() => leftPagingFn().value = "22");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Earth", "365.26", "",
+      "Elara", "259.65", "1905",
+      "Enceladus", "1.37", "1789",
+      "Epimetheus", "0.69", "1980"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Earth", "365.26", "",
+      "Elara", "259.65", "1905",
+      "Enceladus", "1.37", "1789",
+      "Epimetheus", "0.69", "1980"));
+  test.do(() => colNameFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Proteus", "1.12", "1989",
+      "Prospero", "-1962.95", "1999",
+      "Prometheus", "0.61", "1980",
+      "Praxidike", "625.3", "2000"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Proteus", "1.12", "1989",
+      "Prospero", "-1962.95", "1999",
+      "Prometheus", "0.61", "1980",
+      "Praxidike", "625.3", "2000"));
+  test.do(() => colNameFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Earth", "365.26", "",
+      "Elara", "259.65", "1905",
+      "Enceladus", "1.37", "1789",
+      "Epimetheus", "0.69", "1980"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Earth", "365.26", "",
+      "Elara", "259.65", "1905",
+      "Enceladus", "1.37", "1789",
+      "Epimetheus", "0.69", "1980"));
+  test.start();
 });
 
-QUnit.test("Custom Sorting: Period", function (assert) {
-  let colPeriodFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s2\\:customColumnPeriod_sorter");
-  let rowsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
-  let leftPagingFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-left input");
+it("Custom Sorting: Period", function (done) {
+  let colPeriodFn = querySelectorFn("#page\\:mainForm\\:s2\\:customColumnPeriod_sorter");
+  let rowsFn = querySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
+  let leftPagingFn = querySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-left input");
 
-  let TTT = new TobagoTestTool(assert);
-  if (!colPeriodFn().classList.contains("tobago-sheet-header-markup-ascending")) {
-    TTT.action(function () {
-      colPeriodFn().dispatchEvent(new Event("click", {bubbles: true}));
-    });
-    TTT.waitForResponse();
-  }
-  TTT.asserts(3, function () {
-    assert.ok(colPeriodFn().classList.contains("tobago-sheet-header-markup-sortable"));
-    assert.ok(colPeriodFn().classList.contains("tobago-sheet-header-markup-ascending"));
-    assert.notOk(colPeriodFn().classList.contains("tobago-sheet-header-markup-descending"));
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "29";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Mimas", "0.94", "1789",
-        "Proteus", "1.12", "1989",
-        "Deimos", "1.26", "1877",
-        "Enceladus", "1.37", "1789");
-  });
-  TTT.action(function () {
-    colPeriodFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Elara", "259.65", "1905",
-        "Lysithea", "259.22", "1938",
-        "Himalia", "250.57", "1904",
-        "Leda", "238.72", "1974");
-  });
-  TTT.action(function () {
-    colPeriodFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Mimas", "0.94", "1789",
-        "Proteus", "1.12", "1989",
-        "Deimos", "1.26", "1877",
-        "Enceladus", "1.37", "1789");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.setup(
+      () => colPeriodFn().classList.contains("tobago-sheet-header-markup-ascending"),
+      () => colPeriodFn().dispatchEvent(new Event("click", {bubbles: true}))
+  );
+  test.do(() => expect(colPeriodFn().classList.contains("tobago-sheet-header-markup-sortable")).toBe(true));
+  test.do(() => expect(colPeriodFn().classList.contains("tobago-sheet-header-markup-ascending")).toBe(true));
+  test.do(() => expect(colPeriodFn().classList.contains("tobago-sheet-header-markup-descending")).not.toBe(true));
+  test.do(() => leftPagingFn().value = "29");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Mimas", "0.94", "1789",
+      "Proteus", "1.12", "1989",
+      "Deimos", "1.26", "1877",
+      "Enceladus", "1.37", "1789"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Mimas", "0.94", "1789",
+      "Proteus", "1.12", "1989",
+      "Deimos", "1.26", "1877",
+      "Enceladus", "1.37", "1789"));
+  test.do(() => colPeriodFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Elara", "259.65", "1905",
+      "Lysithea", "259.22", "1938",
+      "Himalia", "250.57", "1904",
+      "Leda", "238.72", "1974"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Elara", "259.65", "1905",
+      "Lysithea", "259.22", "1938",
+      "Himalia", "250.57", "1904",
+      "Leda", "238.72", "1974"));
+  test.do(() => colPeriodFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Mimas", "0.94", "1789",
+      "Proteus", "1.12", "1989",
+      "Deimos", "1.26", "1877",
+      "Enceladus", "1.37", "1789"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Mimas", "0.94", "1789",
+      "Proteus", "1.12", "1989",
+      "Deimos", "1.26", "1877",
+      "Enceladus", "1.37", "1789"));
+  test.start();
 });
 
-QUnit.test("Custom Sorting: Year", function (assert) {
-  let colYearFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s2\\:customColumnYear_sorter");
-  let rowsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
-  let leftPagingFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-left input");
+it("Custom Sorting: Year", function (done) {
+  let colYearFn = querySelectorFn("#page\\:mainForm\\:s2\\:customColumnYear_sorter");
+  let rowsFn = querySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
+  let leftPagingFn = querySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-left input");
 
-  let TTT = new TobagoTestTool(assert);
-  if (!colYearFn().classList.contains("tobago-sheet-header-markup-ascending")) {
-    TTT.action(function () {
-      colYearFn().dispatchEvent(new Event("click", {bubbles: true}));
-    });
-    TTT.waitForResponse();
-  }
-  TTT.asserts(3, function () {
-    assert.ok(colYearFn().classList.contains("tobago-sheet-header-markup-sortable"));
-    assert.ok(colYearFn().classList.contains("tobago-sheet-header-markup-ascending"));
-    assert.notOk(colYearFn().classList.contains("tobago-sheet-header-markup-descending"));
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "22";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(4, function () {
-    assert.equal(rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1789", "row0col2");
-    assert.equal(rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1846", "row1col2");
-    assert.equal(rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1846", "row2col2");
-    assert.equal(rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1848", "row3col2");
-  });
-  TTT.action(function () {
-    colYearFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(4, function () {
-    assert.equal(rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1989", "row0col2");
-    assert.equal(rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1989", "row1col2");
-    assert.equal(rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1989", "row2col2");
-    assert.equal(rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1986", "row3col2");
-  });
-  TTT.action(function () {
-    colYearFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(4, function () {
-    assert.equal(rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1789", "row0col2");
-    assert.equal(rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1846", "row1col2");
-    assert.equal(rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1846", "row2col2");
-    assert.equal(rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim(), "1848", "row3col2");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.setup(
+      () => colYearFn().classList.contains("tobago-sheet-header-markup-ascending"),
+      () => colYearFn().dispatchEvent(new Event("click", {bubbles: true}))
+  );
+  test.do(() => expect(colYearFn().classList.contains("tobago-sheet-header-markup-sortable")).toBe(true));
+  test.do(() => expect(colYearFn().classList.contains("tobago-sheet-header-markup-ascending")).toBe(true));
+  test.do(() => expect(colYearFn().classList.contains("tobago-sheet-header-markup-descending")).not.toBe(true));
+  test.do(() => leftPagingFn().value = "22");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => rowsFn() && rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim() === "1789");
+  test.do(() => expect(rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1789", "row0col2"));
+  test.do(() => expect(rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1846", "row1col2"));
+  test.do(() => expect(rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1846", "row2col2"));
+  test.do(() => expect(rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1848", "row3col2"));
+  test.do(() => colYearFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => rowsFn() && rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim() === "1989");
+  test.do(() => expect(rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1989", "row0col2"));
+  test.do(() => expect(rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1989", "row1col2"));
+  test.do(() => expect(rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1989", "row2col2"));
+  test.do(() => expect(rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1986", "row3col2"));
+  test.do(() => colYearFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => rowsFn() && rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim() === "1789");
+  test.do(() => expect(rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1789", "row0col2"));
+  test.do(() => expect(rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1846", "row1col2"));
+  test.do(() => expect(rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1846", "row2col2"));
+  test.do(() => expect(rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim()).toBe("1848", "row3col2"));
+  test.start();
 });
 
 /**
  * 1. goto line 8
  * 2. goto line 9
  */
-QUnit.test("Custom Sorting: left paging", function (assert) {
-  let colNameFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s2\\:customColumnName_sorter");
-  let rowsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
-  let leftPagingFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-left input");
+it("Custom Sorting: left paging", function (done) {
+  let colNameFn = querySelectorFn("#page\\:mainForm\\:s2\\:customColumnName_sorter");
+  let rowsFn = querySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
+  let leftPagingFn = querySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-left input");
 
-  let TTT = new TobagoTestTool(assert);
-  if (!colNameFn().classList.contains("tobago-sheet-header-markup-ascending")) {
-    TTT.action(function () {
-      colNameFn().dispatchEvent(new Event("click", {bubbles: true}));
-    });
-    TTT.waitForResponse();
-  }
-  TTT.asserts(3, function () {
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-sortable"));
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-ascending"));
-    assert.notOk(colNameFn().classList.contains("tobago-sheet-header-markup-descending"));
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "8";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Bianca", "0.43", "1986",
-        "Caliban", "-579.39", "1997",
-        "Callirrhoe", "758.8", "2000",
-        "Callisto", "16.69", "1610");
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "9";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Caliban", "-579.39", "1997",
-        "Callirrhoe", "758.8", "2000",
-        "Callisto", "16.69", "1610",
-        "Calypso", "1.89", "1980");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.setup(
+      () => colNameFn().classList.contains("tobago-sheet-header-markup-ascending"),
+      () => colNameFn().dispatchEvent(new Event("click", {bubbles: true}))
+  );
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-sortable")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-ascending")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-descending")).not.toBe(true));
+  test.do(() => leftPagingFn().value = "8");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Bianca", "0.43", "1986",
+      "Caliban", "-579.39", "1997",
+      "Callirrhoe", "758.8", "2000",
+      "Callisto", "16.69", "1610"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Bianca", "0.43", "1986",
+      "Caliban", "-579.39", "1997",
+      "Callirrhoe", "758.8", "2000",
+      "Callisto", "16.69", "1610"));
+  test.do(() => leftPagingFn().value = "9");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Caliban", "-579.39", "1997",
+      "Callirrhoe", "758.8", "2000",
+      "Callisto", "16.69", "1610",
+      "Calypso", "1.89", "1980"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Caliban", "-579.39", "1997",
+      "Callirrhoe", "758.8", "2000",
+      "Callisto", "16.69", "1610",
+      "Calypso", "1.89", "1980"));
+  test.start();
 });
 
 /**
@@ -605,70 +543,66 @@ QUnit.test("Custom Sorting: left paging", function (assert) {
  * 2. goto page 16
  * 3. goto page 13
  */
-QUnit.test("Custom Sorting: center paging", function (assert) {
-  let colNameFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s2\\:customColumnName_sorter");
-  let rowsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
-  let leftPagingFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-left input");
-  let centerPagingFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-center li .page-link");
+it("Custom Sorting: center paging", function (done) {
+  let colNameFn = querySelectorFn("#page\\:mainForm\\:s2\\:customColumnName_sorter");
+  let rowsFn = querySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
+  let leftPagingFn = querySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-left input");
+  let centerPagingFn = querySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-center li .page-link");
 
-  let TTT = new TobagoTestTool(assert);
-  if (!colNameFn().classList.contains("tobago-sheet-header-markup-ascending")) {
-    TTT.action(function () {
-      colNameFn().dispatchEvent(new Event("click", {bubbles: true}));
-    });
-    TTT.waitForResponse();
-  }
-  TTT.asserts(3, function () {
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-sortable"));
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-ascending"));
-    assert.notOk(colNameFn().classList.contains("tobago-sheet-header-markup-descending"));
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "1";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "1986U10", "0.64", "1999",
-        "Adrastea", "0.3", "1979",
-        "Amalthea", "0.5", "1892",
-        "Ananke", "-629.77", "1951");
-  });
-  TTT.action(function () {
-    centerPagingFn().item(6).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Epimetheus", "0.69", "1980",
-        "Erinome", "728.3", "2000",
-        "Europa", "3.55", "1610",
-        "Galatea", "0.43", "1989");
-  });
-  TTT.action(function () {
-    centerPagingFn().item(10).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Phoebe", "-550.48", "1898",
-        "Pluto", "90800.0", "1930",
-        "Portia", "0.51", "1986",
-        "Praxidike", "625.3", "2000");
-  });
-  TTT.action(function () {
-    centerPagingFn().item(3).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Neptune", "60190.0", "1846",
-        "Nereid", "360.13", "1949",
-        "Oberon", "13.46", "1787",
-        "Ophelia", "0.38", "1986");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.setup(
+      () => colNameFn().classList.contains("tobago-sheet-header-markup-ascending"),
+      () => colNameFn().dispatchEvent(new Event("click", {bubbles: true}))
+  );
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-sortable")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-ascending")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-descending")).not.toBe(true));
+  test.do(() => leftPagingFn().value = "1");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "1986U10", "0.64", "1999",
+      "Adrastea", "0.3", "1979",
+      "Amalthea", "0.5", "1892",
+      "Ananke", "-629.77", "1951"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "1986U10", "0.64", "1999",
+      "Adrastea", "0.3", "1979",
+      "Amalthea", "0.5", "1892",
+      "Ananke", "-629.77", "1951"));
+  test.do(() => centerPagingFn().item(6).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Epimetheus", "0.69", "1980",
+      "Erinome", "728.3", "2000",
+      "Europa", "3.55", "1610",
+      "Galatea", "0.43", "1989"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Epimetheus", "0.69", "1980",
+      "Erinome", "728.3", "2000",
+      "Europa", "3.55", "1610",
+      "Galatea", "0.43", "1989"));
+  test.do(() => centerPagingFn().item(10).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Phoebe", "-550.48", "1898",
+      "Pluto", "90800.0", "1930",
+      "Portia", "0.51", "1986",
+      "Praxidike", "625.3", "2000"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Phoebe", "-550.48", "1898",
+      "Pluto", "90800.0", "1930",
+      "Portia", "0.51", "1986",
+      "Praxidike", "625.3", "2000"));
+  test.do(() => centerPagingFn().item(3).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Neptune", "60190.0", "1846",
+      "Nereid", "360.13", "1949",
+      "Oberon", "13.46", "1787",
+      "Ophelia", "0.38", "1986"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Neptune", "60190.0", "1846",
+      "Nereid", "360.13", "1949",
+      "Oberon", "13.46", "1787",
+      "Ophelia", "0.38", "1986"));
+  test.start();
 });
 
 /**
@@ -678,121 +612,138 @@ QUnit.test("Custom Sorting: center paging", function (assert) {
  * 4. goto page 21 by pressing arrow-left
  * 5. goto page 14
  */
-QUnit.test("Custom Sorting: right paging", function (assert) {
-  let colNameFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s2\\:customColumnName_sorter");
-  let rowsFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
-  let leftPagingFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-left input");
-  let rightPagingFn = testFrameQuerySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-right .page-link");
-  let rightPagingInputFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-right .page-link input");
+it("Custom Sorting: right paging", function (done) {
+  let colNameFn = querySelectorFn("#page\\:mainForm\\:s2\\:customColumnName_sorter");
+  let rowsFn = querySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
+  let leftPagingFn = querySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-left input");
+  let rightPagingFn = querySelectorAllFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-right .page-link");
+  let rightPagingInputFn = querySelectorFn("#page\\:mainForm\\:s2 .tobago-sheet-paging-markup-right .page-link input");
 
-  let TTT = new TobagoTestTool(assert);
-  if (!colNameFn().classList.contains("tobago-sheet-header-markup-ascending")) {
-    TTT.action(function () {
-      colNameFn().dispatchEvent(new Event("click", {bubbles: true}));
-    });
-    TTT.waitForResponse();
-  }
-  TTT.asserts(3, function () {
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-sortable"));
-    assert.ok(colNameFn().classList.contains("tobago-sheet-header-markup-ascending"));
-    assert.notOk(colNameFn().classList.contains("tobago-sheet-header-markup-descending"));
-  });
-  TTT.action(function () {
-    leftPagingFn().value = "22";
-    leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Earth", "365.26", "",
-        "Elara", "259.65", "1905",
-        "Enceladus", "1.37", "1789",
-        "Epimetheus", "0.69", "1980");
-  });
-  TTT.action(function () {
-    rightPagingFn().item(0).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "1986U10", "0.64", "1999",
-        "Adrastea", "0.3", "1979",
-        "Amalthea", "0.5", "1892",
-        "Ananke", "-629.77", "1951");
-  });
-  TTT.action(function () {
-    rightPagingFn().item(3).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Ariel", "2.52", "1851",
-        "Atlas", "0.6", "1980",
-        "Belinda", "0.62", "1986",
-        "Bianca", "0.43", "1986");
-  });
-  TTT.action(function () {
-    rightPagingFn().item(4).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Triton", "-5.88", "1846",
-        "Umbriel", "4.14", "1851",
-        "Uranus", "30685.0", "1781",
-        "Venus", "224.7", "");
-  });
-  TTT.action(function () {
-    rightPagingFn().item(1).dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Thebe", "0.67", "1979",
-        "Themisto", "130.02", "2000",
-        "Titan", "15.95", "1655",
-        "Titania", "8.71", "1787");
-  });
-  TTT.action(function () {
-    rightPagingInputFn().value = "14";
-    rightPagingInputFn().dispatchEvent(new Event("blur", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(12, function () {
-    ajaxExecuteBodyTableCheck(assert, rowsFn,
-        "Neptune", "60190.0", "1846",
-        "Nereid", "360.13", "1949",
-        "Oberon", "13.46", "1787",
-        "Ophelia", "0.38", "1986");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.setup(
+      () => colNameFn().classList.contains("tobago-sheet-header-markup-ascending"),
+      () => colNameFn().dispatchEvent(new Event("click", {bubbles: true}))
+  );
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-sortable")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-ascending")).toBe(true));
+  test.do(() => expect(colNameFn().classList.contains("tobago-sheet-header-markup-descending")).not.toBe(true));
+  test.do(() => leftPagingFn().value = "22");
+  test.do(() => leftPagingFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Earth", "365.26", "",
+      "Elara", "259.65", "1905",
+      "Enceladus", "1.37", "1789",
+      "Epimetheus", "0.69", "1980"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Earth", "365.26", "",
+      "Elara", "259.65", "1905",
+      "Enceladus", "1.37", "1789",
+      "Epimetheus", "0.69", "1980"));
+  test.do(() => rightPagingFn().item(0).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "1986U10", "0.64", "1999",
+      "Adrastea", "0.3", "1979",
+      "Amalthea", "0.5", "1892",
+      "Ananke", "-629.77", "1951"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "1986U10", "0.64", "1999",
+      "Adrastea", "0.3", "1979",
+      "Amalthea", "0.5", "1892",
+      "Ananke", "-629.77", "1951"));
+  test.do(() => rightPagingFn().item(3).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Ariel", "2.52", "1851",
+      "Atlas", "0.6", "1980",
+      "Belinda", "0.62", "1986",
+      "Bianca", "0.43", "1986"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Ariel", "2.52", "1851",
+      "Atlas", "0.6", "1980",
+      "Belinda", "0.62", "1986",
+      "Bianca", "0.43", "1986"));
+  test.do(() => rightPagingFn().item(4).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Triton", "-5.88", "1846",
+      "Umbriel", "4.14", "1851",
+      "Uranus", "30685.0", "1781",
+      "Venus", "224.7", ""));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Triton", "-5.88", "1846",
+      "Umbriel", "4.14", "1851",
+      "Uranus", "30685.0", "1781",
+      "Venus", "224.7", ""));
+  test.do(() => rightPagingFn().item(1).dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Thebe", "0.67", "1979",
+      "Themisto", "130.02", "2000",
+      "Titan", "15.95", "1655",
+      "Titania", "8.71", "1787"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Thebe", "0.67", "1979",
+      "Themisto", "130.02", "2000",
+      "Titan", "15.95", "1655",
+      "Titania", "8.71", "1787"));
+  test.do(() => rightPagingInputFn().value = "14");
+  test.do(() => rightPagingInputFn().dispatchEvent(new Event("blur", {bubbles: true})));
+  test.wait(() => waitForBodyTable(rowsFn(),
+      "Neptune", "60190.0", "1846",
+      "Nereid", "360.13", "1949",
+      "Oberon", "13.46", "1787",
+      "Ophelia", "0.38", "1986"));
+  test.do(() => expectBodyTable(rowsFn(),
+      "Neptune", "60190.0", "1846",
+      "Nereid", "360.13", "1949",
+      "Oberon", "13.46", "1787",
+      "Ophelia", "0.38", "1986"));
+  test.start();
 });
 
-function ajaxExecuteBodyTableCheck(assert, rowsFn, row0col0, row0col1, row0col2, row1col0, row1col1, row1col2,
-                                   row2col0, row2col1, row2col2, row3col0, row3col1, row3col2) {
-  let $row0Col0 = rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(0).textContent.trim();
-  let $row0Col1 = rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(1).textContent.trim();
-  let $row0Col2 = rowsFn().item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim();
-  let $row1Col0 = rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(0).textContent.trim();
-  let $row1Col1 = rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(1).textContent.trim();
-  let $row1Col2 = rowsFn().item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim();
-  let $row2Col0 = rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(0).textContent.trim();
-  let $row2Col1 = rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(1).textContent.trim();
-  let $row2Col2 = rowsFn().item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim();
-  let $row3Col0 = rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(0).textContent.trim();
-  let $row3Col1 = rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(1).textContent.trim();
-  let $row3Col2 = rowsFn().item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim();
+function waitForBodyTable(rowsFn, row0col0, row0col1, row0col2, row1col0, row1col1, row1col2,
+                          row2col0, row2col1, row2col2, row3col0, row3col1, row3col2) {
+  let $row0Col0 = rowsFn.item(0).querySelectorAll(".tobago-sheet-cell").item(0).textContent.trim();
+  let $row0Col1 = rowsFn.item(0).querySelectorAll(".tobago-sheet-cell").item(1).textContent.trim();
+  let $row0Col2 = rowsFn.item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim();
+  let $row1Col0 = rowsFn.item(1).querySelectorAll(".tobago-sheet-cell").item(0).textContent.trim();
+  let $row1Col1 = rowsFn.item(1).querySelectorAll(".tobago-sheet-cell").item(1).textContent.trim();
+  let $row1Col2 = rowsFn.item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim();
+  let $row2Col0 = rowsFn.item(2).querySelectorAll(".tobago-sheet-cell").item(0).textContent.trim();
+  let $row2Col1 = rowsFn.item(2).querySelectorAll(".tobago-sheet-cell").item(1).textContent.trim();
+  let $row2Col2 = rowsFn.item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim();
+  let $row3Col0 = rowsFn.item(3).querySelectorAll(".tobago-sheet-cell").item(0).textContent.trim();
+  let $row3Col1 = rowsFn.item(3).querySelectorAll(".tobago-sheet-cell").item(1).textContent.trim();
+  let $row3Col2 = rowsFn.item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim();
 
-  assert.equal($row0Col0, row0col0, "row0col0");
-  assert.equal($row0Col1, row0col1, "row0col1");
-  assert.equal($row0Col2, row0col2, "row0col2");
-  assert.equal($row1Col0, row1col0, "row1col0");
-  assert.equal($row1Col1, row1col1, "row1col1");
-  assert.equal($row1Col2, row1col2, "row1col2");
-  assert.equal($row2Col0, row2col0, "row2col0");
-  assert.equal($row2Col1, row2col1, "row2col1");
-  assert.equal($row2Col2, row2col2, "row2col2");
-  assert.equal($row3Col0, row3col0, "row3col0");
-  assert.equal($row3Col1, row3col1, "row3col1");
-  assert.equal($row3Col2, row3col2, "row3col2");
+  return ($row0Col0 === row0col0 && $row0Col1 === row0col1 && $row0Col2 === row0col2
+      && $row1Col0 === row1col0 && $row1Col1 === row1col1 && $row1Col2 === row1col2
+      && $row2Col0 === row2col0 && $row2Col1 === row2col1 && $row2Col2 === row2col2
+      && $row3Col0 === row3col0 && $row3Col1 === row3col1 && $row3Col2 === row3col2);
+}
+
+function expectBodyTable(rowsFn, row0col0, row0col1, row0col2, row1col0, row1col1, row1col2,
+                         row2col0, row2col1, row2col2, row3col0, row3col1, row3col2) {
+  let $row0Col0 = rowsFn.item(0).querySelectorAll(".tobago-sheet-cell").item(0).textContent.trim();
+  let $row0Col1 = rowsFn.item(0).querySelectorAll(".tobago-sheet-cell").item(1).textContent.trim();
+  let $row0Col2 = rowsFn.item(0).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim();
+  let $row1Col0 = rowsFn.item(1).querySelectorAll(".tobago-sheet-cell").item(0).textContent.trim();
+  let $row1Col1 = rowsFn.item(1).querySelectorAll(".tobago-sheet-cell").item(1).textContent.trim();
+  let $row1Col2 = rowsFn.item(1).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim();
+  let $row2Col0 = rowsFn.item(2).querySelectorAll(".tobago-sheet-cell").item(0).textContent.trim();
+  let $row2Col1 = rowsFn.item(2).querySelectorAll(".tobago-sheet-cell").item(1).textContent.trim();
+  let $row2Col2 = rowsFn.item(2).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim();
+  let $row3Col0 = rowsFn.item(3).querySelectorAll(".tobago-sheet-cell").item(0).textContent.trim();
+  let $row3Col1 = rowsFn.item(3).querySelectorAll(".tobago-sheet-cell").item(1).textContent.trim();
+  let $row3Col2 = rowsFn.item(3).querySelectorAll(".tobago-sheet-cell").item(2).textContent.trim();
+
+  expect($row0Col0).toBe(row0col0, "row0col0");
+  expect($row0Col1).toBe(row0col1, "row0col1");
+  expect($row0Col2).toBe(row0col2, "row0col2");
+  expect($row1Col0).toBe(row1col0, "row1col0");
+  expect($row1Col1).toBe(row1col1, "row1col1");
+  expect($row1Col2).toBe(row1col2, "row1col2");
+  expect($row2Col0).toBe(row2col0, "row2col0");
+  expect($row2Col1).toBe(row2col1, "row2col1");
+  expect($row2Col2).toBe(row2col2, "row2col2")
+  expect($row3Col0).toBe(row3col0, "row3col0");
+  expect($row3Col1).toBe(row3col1, "row3col1");
+  expect($row3Col2).toBe(row3col2, "row3col2");
 }
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/Sheet_Event.test.js b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/Sheet_Event.test.js
index 1f28ea9..e18c477 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/Sheet_Event.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/Sheet_Event.test.js
@@ -15,202 +15,123 @@
  * limitations under the License.
  */
 
-import {testFrameQuerySelectorFn} from "/script/tobago-test.js";
-import {TobagoTestTool} from "/tobago/test/tobago-test-tool.js";
+import {querySelectorFn} from "/script/tobago-test.js";
+import {JasmineTestTool} from "/tobago/test/tobago-test-tool.js";
 
-QUnit.test("On click with ajax", function (assert) {
-  let oneClickAjaxFn = testFrameQuerySelectorFn("#page\\:mainForm\\:changeExample\\:\\:0");
-  let venusFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:2\\:sample0");
-  let jupiterFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:5\\:sample0");
-  let saturnFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:6\\:sample0");
-  let namefieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:name\\:\\:field");
+it("On click with ajax", function (done) {
+  let oneClickAjaxFn = querySelectorFn("#page\\:mainForm\\:changeExample\\:\\:0");
+  let venusFn = querySelectorFn("#page\\:mainForm\\:s1\\:2\\:sample0");
+  let jupiterFn = querySelectorFn("#page\\:mainForm\\:s1\\:5\\:sample0");
+  let saturnFn = querySelectorFn("#page\\:mainForm\\:s1\\:6\\:sample0");
+  let namefieldFn = querySelectorFn("#page\\:mainForm\\:name\\:\\:field");
 
-  let TTT = new TobagoTestTool(assert);
-  TTT.action(function () {
-    oneClickAjaxFn().checked = true;
-    oneClickAjaxFn().dispatchEvent(new Event("change", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(3, function () {
-    assert.ok(venusFn());
-    assert.ok(jupiterFn());
-    assert.ok(saturnFn());
-  });
-  TTT.action(function () {
-    venusFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(1, function () {
-    assert.equal(namefieldFn().value, "Venus");
-  });
-  TTT.action(function () {
-    jupiterFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(1, function () {
-    assert.equal(namefieldFn().value, "Jupiter");
-  });
-  TTT.action(function () {
-    saturnFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(1, function () {
-    assert.equal(namefieldFn().value, "Saturn");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.do(() => oneClickAjaxFn().checked = true);
+  test.do(() => oneClickAjaxFn().dispatchEvent(new Event("change", {bubbles: true})));
+  test.wait(() => venusFn());
+  test.do(() => expect(venusFn() != null).toBe(true));
+  test.do(() => expect(jupiterFn() != null).toBe(true));
+  test.do(() => expect(saturnFn() != null).toBe(true));
+  test.do(() => venusFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => namefieldFn() && namefieldFn().value === "Venus");
+  test.do(() => expect(namefieldFn().value).toBe("Venus"));
+  test.do(() => jupiterFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => namefieldFn() && namefieldFn().value === "Jupiter");
+  test.do(() => expect(namefieldFn().value).toBe("Jupiter"));
+  test.do(() => saturnFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => namefieldFn() && namefieldFn().value === "Saturn");
+  test.do(() => expect(namefieldFn().value).toBe("Saturn"));
+  test.start();
 });
 
-QUnit.test("On click with full request", function (assert) {
-  let oneClickFullRequestFn = testFrameQuerySelectorFn("#page\\:mainForm\\:changeExample\\:\\:1");
-  let venusFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:2\\:sample1");
-  let jupiterFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:5\\:sample1");
-  let saturnFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:6\\:sample1");
-  let namefieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:name\\:\\:field");
+it("On click with full request", function (done) {
+  let oneClickFullRequestFn = querySelectorFn("#page\\:mainForm\\:changeExample\\:\\:1");
+  let venusFn = querySelectorFn("#page\\:mainForm\\:s1\\:2\\:sample1");
+  let jupiterFn = querySelectorFn("#page\\:mainForm\\:s1\\:5\\:sample1");
+  let saturnFn = querySelectorFn("#page\\:mainForm\\:s1\\:6\\:sample1");
+  let namefieldFn = querySelectorFn("#page\\:mainForm\\:name\\:\\:field");
 
-  let TTT = new TobagoTestTool(assert);
-  TTT.action(function () {
-    oneClickFullRequestFn().checked = true;
-    oneClickFullRequestFn().dispatchEvent(new Event("change", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(3, function () {
-    assert.ok(venusFn());
-    assert.ok(jupiterFn());
-    assert.ok(saturnFn());
-  });
-  TTT.action(function () {
-    venusFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(1, function () {
-    assert.equal(namefieldFn().value, "Venus");
-  });
-  TTT.action(function () {
-    jupiterFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(1, function () {
-    assert.equal(namefieldFn().value, "Jupiter");
-  });
-  TTT.action(function () {
-    saturnFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(1, function () {
-    assert.equal(namefieldFn().value, "Saturn");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.do(() => oneClickFullRequestFn().checked = true);
+  test.do(() => oneClickFullRequestFn().dispatchEvent(new Event("change", {bubbles: true})));
+  test.wait(() => venusFn());
+  test.do(() => expect(venusFn() != null).toBe(true));
+  test.do(() => expect(jupiterFn() != null).toBe(true));
+  test.do(() => expect(saturnFn() != null).toBe(true));
+  test.do(() => venusFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => namefieldFn() && namefieldFn().value === "Venus");
+  test.do(() => expect(namefieldFn().value).toBe("Venus"));
+  test.do(() => jupiterFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => namefieldFn() && namefieldFn().value === "Jupiter");
+  test.do(() => expect(namefieldFn().value).toBe("Jupiter"));
+  test.do(() => saturnFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => namefieldFn() && namefieldFn().value === "Saturn");
+  test.do(() => expect(namefieldFn().value).toBe("Saturn"));
+  test.start();
 });
 
-QUnit.test("On double click with full request", function (assert) {
-  let doubleClickFullRequestFn = testFrameQuerySelectorFn("#page\\:mainForm\\:changeExample\\:\\:2");
-  let venusFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:2\\:sample2");
-  let jupiterFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:5\\:sample2");
-  let saturnFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:6\\:sample2");
-  let namefieldFn = testFrameQuerySelectorFn("#page\\:mainForm\\:name\\:\\:field");
+it("On double click with full request", function (done) {
+  let doubleClickFullRequestFn = querySelectorFn("#page\\:mainForm\\:changeExample\\:\\:2");
+  let venusFn = querySelectorFn("#page\\:mainForm\\:s1\\:2\\:sample2");
+  let jupiterFn = querySelectorFn("#page\\:mainForm\\:s1\\:5\\:sample2");
+  let saturnFn = querySelectorFn("#page\\:mainForm\\:s1\\:6\\:sample2");
+  let namefieldFn = querySelectorFn("#page\\:mainForm\\:name\\:\\:field");
 
-  let TTT = new TobagoTestTool(assert);
-  TTT.action(function () {
-    doubleClickFullRequestFn().checked = true;
-    doubleClickFullRequestFn().dispatchEvent(new Event("change", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(3, function () {
-    assert.ok(venusFn());
-    assert.ok(jupiterFn());
-    assert.ok(saturnFn());
-  });
-  TTT.action(function () {
-    venusFn().dispatchEvent(new Event("dblclick", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(1, function () {
-    assert.equal(namefieldFn().value, "Venus");
-  });
-  TTT.action(function () {
-    jupiterFn().dispatchEvent(new Event("dblclick", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(1, function () {
-    assert.equal(namefieldFn().value, "Jupiter");
-  });
-  TTT.action(function () {
-    saturnFn().dispatchEvent(new Event("dblclick", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(1, function () {
-    assert.equal(namefieldFn().value, "Saturn");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.do(() => doubleClickFullRequestFn().checked = true);
+  test.do(() => doubleClickFullRequestFn().dispatchEvent(new Event("change", {bubbles: true})));
+  test.wait(() => venusFn());
+  test.do(() => expect(venusFn() != null).toBe(true));
+  test.do(() => expect(jupiterFn() != null).toBe(true));
+  test.do(() => expect(saturnFn() != null).toBe(true));
+  test.do(() => venusFn().dispatchEvent(new Event("dblclick", {bubbles: true})));
+  test.wait(() => namefieldFn() && namefieldFn().value === "Venus");
+  test.do(() => expect(namefieldFn().value).toBe("Venus"));
+  test.do(() => jupiterFn().dispatchEvent(new Event("dblclick", {bubbles: true})));
+  test.wait(() => namefieldFn() && namefieldFn().value === "Jupiter");
+  test.do(() => expect(namefieldFn().value).toBe("Jupiter"));
+  test.do(() => saturnFn().dispatchEvent(new Event("dblclick", {bubbles: true})));
+  test.wait(() => namefieldFn() && namefieldFn().value === "Saturn");
+  test.do(() => expect(namefieldFn().value).toBe("Saturn"));
+  test.start();
 });
 
-QUnit.test("Open popup on click with ajax", function (assert) {
-  let radioButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:changeExample\\:\\:3");
-  let venusFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:2\\:sample3");
-  let jupiterFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:5\\:sample3");
-  let saturnFn = testFrameQuerySelectorFn("#page\\:mainForm\\:s1\\:6\\:sample3");
-  let popupFn = testFrameQuerySelectorFn("#page\\:mainForm\\:popup");
-  let nameFn = testFrameQuerySelectorFn("#page\\:mainForm\\:popup\\:popupName\\:\\:field");
-  let cancelFn = testFrameQuerySelectorFn("#page\\:mainForm\\:popup\\:cancel");
+it("Open popup on click with ajax", function (done) {
+  let radioButtonFn = querySelectorFn("#page\\:mainForm\\:changeExample\\:\\:3");
+  let venusFn = querySelectorFn("#page\\:mainForm\\:s1\\:2\\:sample3");
+  let jupiterFn = querySelectorFn("#page\\:mainForm\\:s1\\:5\\:sample3");
+  let saturnFn = querySelectorFn("#page\\:mainForm\\:s1\\:6\\:sample3");
+  let popupFn = querySelectorFn("#page\\:mainForm\\:popup");
+  let nameFn = querySelectorFn("#page\\:mainForm\\:popup\\:popupName\\:\\:field");
+  let cancelFn = querySelectorFn("#page\\:mainForm\\:popup\\:cancel");
 
-  let TTT = new TobagoTestTool(assert);
-  TTT.action(function () {
-    radioButtonFn().checked = true;
-    radioButtonFn().dispatchEvent(new Event("change", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.asserts(3, function () {
-    assert.ok(venusFn());
-    assert.ok(jupiterFn());
-    assert.ok(saturnFn());
-  });
-  TTT.action(function () {
-    venusFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.waitMs(1000); // wait for animation
-  TTT.asserts(2, function () {
-    assert.ok(popupFn().classList.contains("show"));
-    assert.equal(nameFn().value, "Venus");
-  });
-  TTT.action(function () {
-    cancelFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitMs(1000); // wait for animation
-  TTT.asserts(1, function () {
-    assert.notOk(popupFn().classList.contains("show"));
-  });
-  TTT.action(function () {
-    jupiterFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.waitMs(1000); // wait for animation
-  TTT.asserts(2, function () {
-    assert.ok(popupFn().classList.contains("show"));
-    assert.equal(nameFn().value, "Jupiter");
-  });
-  TTT.action(function () {
-    cancelFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitMs(1000); // wait for animation
-  TTT.asserts(1, function () {
-    assert.notOk(popupFn().classList.contains("show"));
-  });
-  TTT.action(function () {
-    saturnFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitForResponse();
-  TTT.waitMs(1000); // wait for animation
-  TTT.asserts(2, function () {
-    assert.ok(popupFn().classList.contains("show"));
-    assert.equal(nameFn().value, "Saturn");
-  });
-  TTT.action(function () {
-    cancelFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitMs(1000); // wait for animation
-  TTT.asserts(1, function () {
-    assert.notOk(popupFn().classList.contains("show"));
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.do(() => radioButtonFn().checked = true);
+  test.do(() => radioButtonFn().dispatchEvent(new Event("change", {bubbles: true})));
+  test.wait(() => venusFn());
+  test.do(() => expect(venusFn() != null).toBe(true));
+  test.do(() => expect(jupiterFn() != null).toBe(true));
+  test.do(() => expect(saturnFn() != null).toBe(true));
+  test.do(() => venusFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => popupFn() && popupFn().classList.contains("show") === true);
+  test.do(() => expect(popupFn().classList.contains("show")).toBe(true));
+  test.do(() => expect(nameFn().value).toBe("Venus"));
+  test.do(() => cancelFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => popupFn() && popupFn().classList.contains("show") !== true);
+  test.do(() => expect(popupFn().classList.contains("show")).not.toBe(true));
+  test.do(() => jupiterFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => popupFn() && popupFn().classList.contains("show") === true);
+  test.do(() => expect(popupFn().classList.contains("show")).toBe(true));
+  test.do(() => expect(nameFn().value).toBe("Jupiter"));
+  test.do(() => cancelFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => popupFn() && popupFn().classList.contains("show") !== true);
+  test.do(() => expect(popupFn().classList.contains("show")).not.toBe(true));
+  test.do(() => saturnFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => popupFn() && popupFn().classList.contains("show") === true);
+  test.do(() => expect(popupFn().classList.contains("show")).toBe(true));
+  test.do(() => expect(nameFn().value).toBe("Saturn"));
+  test.do(() => cancelFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => popupFn() && popupFn().classList.contains("show") !== true);
+  test.do(() => expect(popupFn().classList.contains("show")).not.toBe(true));
+  test.start();
 });
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/70-tree/Sheet_Tree.test.js b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/70-tree/Sheet_Tree.test.js
index 6161cb5..814506f 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/70-tree/Sheet_Tree.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/70-tree/Sheet_Tree.test.js
@@ -16,9 +16,9 @@
  */
 
 import {testFrameQuerySelectorFn} from "/script/tobago-test.js";
-import {TobagoTestTool} from "/tobago/test/tobago-test-tool.js";
+import {JasmineTestTool} from "/tobago/test/tobago-test-tool.js";
 
-QUnit.test("Collapse tree", function (assert) {
+it("Collapse tree", function (done) {
   let row0nameFn = testFrameQuerySelectorFn("#page\\:mainForm\\:sheet\\:0\\:nameOut");
   let row0centralBodyFn = testFrameQuerySelectorFn("#page\\:mainForm\\:sheet\\:0\\:centralBodyOut");
   let row0distanceFn = testFrameQuerySelectorFn("#page\\:mainForm\\:sheet\\:0\\:distanceOut");
@@ -33,40 +33,32 @@ QUnit.test("Collapse tree", function (assert) {
   let row1yearFn = testFrameQuerySelectorFn("#page\\:mainForm\\:sheet\\:1\\:yearOut");
   let rootTreeButtonFn = testFrameQuerySelectorFn("#page\\:mainForm\\:sheet\\:0\\:nameCol .tobago-treeNode-toggle");
 
-  let TTT = new TobagoTestTool(assert);
-  TTT.asserts(14, function () {
-    assert.equal(row0nameFn().textContent, "Sun");
-    assert.equal(row0centralBodyFn().textContent, "-");
-    assert.equal(row0distanceFn().textContent, "0");
-    assert.equal(row0periodFn().textContent, "0.0");
-    assert.equal(row0discovererFn().textContent, "-");
-    assert.equal(row0yearFn().textContent, "");
-    assert.equal(row1nameFn().textContent, "Mercury");
-    assert.equal(row1centralBodyFn().textContent, "Sun");
-    assert.equal(row1distanceFn().textContent, "57910");
-    assert.equal(row1periodFn().textContent, "87.97");
-    assert.equal(row1discovererFn().textContent, "-");
-    assert.equal(row1yearFn().textContent, "");
-
-    let sheetRow = row1yearFn().parentElement.parentElement;
-    assert.ok(sheetRow.classList.contains("tobago-sheet-row"));
-    assert.notEqual(getComputedStyle(sheetRow).display, "none");
-  });
-  TTT.action(function () {
-    rootTreeButtonFn().dispatchEvent(new Event("click", {bubbles: true}));
-  });
-  TTT.waitMs(1000);
-  TTT.asserts(8, function () {
-    assert.equal(row0nameFn().textContent, "Sun");
-    assert.equal(row0centralBodyFn().textContent, "-");
-    assert.equal(row0distanceFn().textContent, "0");
-    assert.equal(row0periodFn().textContent, "0.0");
-    assert.equal(row0discovererFn().textContent, "-");
-    assert.equal(row0yearFn().textContent, "");
-
-    let sheetRow = row1yearFn().parentElement.parentElement;
-    assert.ok(sheetRow.classList.contains("tobago-sheet-row"));
-    assert.equal(getComputedStyle(sheetRow).display, "none");
-  });
-  TTT.startTest();
+  let test = new JasmineTestTool(done);
+  test.do(() => expect(row0nameFn().textContent).toBe("Sun"));
+  test.do(() => expect(row0centralBodyFn().textContent).toBe("-"));
+  test.do(() => expect(row0distanceFn().textContent).toBe("0"));
+  test.do(() => expect(row0periodFn().textContent).toBe("0.0"));
+  test.do(() => expect(row0discovererFn().textContent).toBe("-"));
+  test.do(() => expect(row0yearFn().textContent).toBe(""));
+  test.do(() => expect(row1nameFn().textContent).toBe("Mercury"));
+  test.do(() => expect(row1centralBodyFn().textContent).toBe("Sun"));
+  test.do(() => expect(row1distanceFn().textContent).toBe("57910"));
+  test.do(() => expect(row1periodFn().textContent).toBe("87.97"));
+  test.do(() => expect(row1discovererFn().textContent).toBe("-"));
+  test.do(() => expect(row1yearFn().textContent).toBe(""));
+  let sheetRow = row1yearFn().parentElement.parentElement;
+  test.do(() => expect(sheetRow.classList.contains("tobago-sheet-row")).toBe(true));
+  test.do(() => expect(getComputedStyle(sheetRow).display).not.toBe("none"));
+  test.do(() => rootTreeButtonFn().dispatchEvent(new Event("click", {bubbles: true})));
+  test.wait(() => row0nameFn() && row0nameFn().textContent === "Sun");
+  test.do(() => expect(row0nameFn().textContent).toBe("Sun"));
+  test.do(() => expect(row0centralBodyFn().textContent).toBe("-"));
+  test.do(() => expect(row0distanceFn().textContent).toBe("0"));
+  test.do(() => expect(row0periodFn().textContent).toBe("0.0"));
+  test.do(() => expect(row0discovererFn().textContent).toBe("-"));
+  test.do(() => expect(row0yearFn().textContent).toBe(""));
+  sheetRow = row1yearFn().parentElement.parentElement;
+  test.do(() => expect(sheetRow.classList.contains("tobago-sheet-row")).toBe(true));
+  test.do(() => expect(getComputedStyle(sheetRow).display).toBe("none"));
+  test.start();
 });


Mime
View raw message