You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2017/03/22 10:11:53 UTC

svn commit: r1788079 [1/2] - in /myfaces/tobago/branches/TOBAGO-1719: ./ tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/de...

Author: lofwyr
Date: Wed Mar 22 10:11:52 2017
New Revision: 1788079

URL: http://svn.apache.org/viewvc?rev=1788079&view=rev
Log:
Merged from trunk
improve tests:
* add a menu entry to access all pages at once
* 'too many async calls' are now logged by integration-tests
* fix 'too many async calls' in tests
[developed by hnoeth] [from revision 1787926]

Added:
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/testAccessAllPages.xhtml
      - copied unchanged from r1787926, myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/testAccessAllPages.xhtml
Modified:
    myfaces/tobago/branches/TOBAGO-1719/   (props changed)
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/Demo.xml   (contents, props changed)
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/10-selectBooleanCheckbox/selectBooleanCheckbox.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/20-selectOneChoice/selectOneChoice.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/30-selectOneRadio/selectOneRadio.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/40-selectOneListbox/selectOneListbox.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/50-selectManyCheckbox/selectManyCheckbox.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/popup.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-event.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/01-select/tree-select.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/06-validation/00/content-validation.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/06-validation/01/validation-jsr303.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/08-form/10-required/form-required.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/08-form/form.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/00-collapsible-box/collapsible-box.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/20-collapsible-panel/collapsible-panel.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/30-collapsible-section/collapsible-section.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4000-button+link/button+link.test.js
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml
    myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java

Propchange: myfaces/tobago/branches/TOBAGO-1719/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar 22 10:11:52 2017
@@ -1,4 +1,4 @@
 /myfaces/tobago/branches/tobago-1.5.x:1356585,1357124
 /myfaces/tobago/branches/tobago-3.0.x:1781306,1781310,1781380
 /myfaces/tobago/branches/tobago-tree-table:1226794-1341423
-/myfaces/tobago/trunk:1571193,1571804,1571816,1571941,1571945,1571962,1571966,1576730,1589960,1591854,1600239,1600818,1601860,1602151,1602154,1602343,1604224,1606201,1607642,1609696-1609697,1609718,1610942,1610948,1610970,1610989,1611011,1611259,1611264,1611276,1611329,1611338-1611339,1611571,1613015,1613032,1614827,1614853,1615053,1615114,1615121,1617310,1619789,1621101,1621107,1621134,1621156,1621264,1621282,1621332,1622222,1622243,1622508,1623934,1624033,1625968,1625972,1626270,1628899,1628953,1636842,1636911,1640117,1640147,1640541,1640548,1640638,1640761,1640917,1641575,1641635,1641772,1641775,1641777,1656502,1656507,1657180,1657269,1657276,1657279,1658343,1658909,1658912,1659026,1659031,1660696,1660699,1660708,1660714,1665486,1665521,1665549,1665569-1665570,1666464,1667304,1667306-1667307,1667309,1668147,1668153,1668249,1675330,1675565,1675584,1675588-1675589,1675636,1676030,1676035,1676038,1679031,1680197,1681981,1682187,1682448,1682545,1682548,1683231,1683306,1683373,1683664
 ,1686204,1687354,1693426,1696720,1698292,1698297,1700742,1700795,1701249,1701251,1701256,1701980,1709006,1725894,1726691,1726986,1727161,1731050-1731051,1731054,1731057,1731218-1731219,1787403,1787422,1787443,1787651,1787780
+/myfaces/tobago/trunk:1571193,1571804,1571816,1571941,1571945,1571962,1571966,1576730,1589960,1591854,1600239,1600818,1601860,1602151,1602154,1602343,1604224,1606201,1607642,1609696-1609697,1609718,1610942,1610948,1610970,1610989,1611011,1611259,1611264,1611276,1611329,1611338-1611339,1611571,1613015,1613032,1614827,1614853,1615053,1615114,1615121,1617310,1619789,1621101,1621107,1621134,1621156,1621264,1621282,1621332,1622222,1622243,1622508,1623934,1624033,1625968,1625972,1626270,1628899,1628953,1636842,1636911,1640117,1640147,1640541,1640548,1640638,1640761,1640917,1641575,1641635,1641772,1641775,1641777,1656502,1656507,1657180,1657269,1657276,1657279,1658343,1658909,1658912,1659026,1659031,1660696,1660699,1660708,1660714,1665486,1665521,1665549,1665569-1665570,1666464,1667304,1667306-1667307,1667309,1668147,1668153,1668249,1675330,1675565,1675584,1675588-1675589,1675636,1676030,1676035,1676038,1679031,1680197,1681981,1682187,1682448,1682545,1682548,1683231,1683306,1683373,1683664
 ,1686204,1687354,1693426,1696720,1698292,1698297,1700742,1700795,1701249,1701251,1701256,1701980,1709006,1725894,1726691,1726986,1727161,1731050-1731051,1731054,1731057,1731218-1731219,1787403,1787422,1787443,1787651,1787780,1787926

Modified: myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java?rev=1788079&r1=1788078&r2=1788079&view=diff
==============================================================================
--- myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java (original)
+++ myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java Wed Mar 22 10:11:52 2017
@@ -55,6 +55,30 @@ public class TestController implements S
     return viewId.substring(1, viewId.length() - 6); //remove leading '/' and trailing '.xhtml'
   }
 
+  public List<String> getAllPages() {
+    List<String> pages = new ArrayList<String>();
+
+    final File rootDir = new File("src/main/webapp/content");
+    if (rootDir.exists()) {
+      for (String page : getXHTMLs(rootDir)) {
+        pages.add(page.substring(16));
+      }
+    }
+    return pages;
+  }
+
+  private List<String> getXHTMLs(File dir) {
+    List<String> xhtmls = new ArrayList<String>();
+    for (File file : dir.listFiles()) {
+      if (file.isDirectory()) {
+        xhtmls.addAll(getXHTMLs(file));
+      } else if (!file.getName().startsWith("x-") && file.getName().endsWith(".xhtml")) {
+        xhtmls.add(file.getPath());
+      }
+    }
+    return xhtmls;
+  }
+
   public List<TestPage> getTestPages() {
     List<TestPage> testPages = new ArrayList<TestPage>();
 
@@ -70,15 +94,15 @@ public class TestController implements S
   }
 
   private List<String> getTestJs(File dir) {
-    List<String> xhtmls = new ArrayList<String>();
+    List<String> testJsFiles = new ArrayList<String>();
     for (File file : dir.listFiles()) {
       if (file.isDirectory()) {
-        xhtmls.addAll(getTestJs(file));
+        testJsFiles.addAll(getTestJs(file));
       } else if (!file.getName().startsWith("x-") && file.getName().endsWith(".test.js")) {
-        xhtmls.add(file.getPath());
+        testJsFiles.add(file.getPath());
       }
     }
-    return xhtmls;
+    return testJsFiles;
   }
 
   public class TestPage {

Modified: myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/Demo.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/Demo.xml?rev=1788079&r1=1788078&r2=1788079&view=diff
==============================================================================
--- myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/Demo.xml (original)
+++ myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/Demo.xml Wed Mar 22 10:11:52 2017
@@ -36,6 +36,7 @@
   <entry key="menu_runTest">Run Test</entry>
   <entry key="menu_closeTest">Close Test</entry>
   <entry key="menu_runTestAll">Run all tests</entry>
+  <entry key="menu_accessAllPages">Access all pages</entry>
 
   <!-- navigate -->
   <entry key="intro">Intro</entry>

Propchange: myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/Demo.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar 22 10:11:52 2017
@@ -1,3 +1,4 @@
 /myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml:1356585,1357124
 /myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml:1226794-1341423
+/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/Demo.xml:1787926
 /myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml:1571193,1571804,1571816,1571941,1571945,1571962,1571966,1576730,1589960,1590288,1666464,1675588-1675589

Modified: myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/10-selectBooleanCheckbox/selectBooleanCheckbox.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/10-selectBooleanCheckbox/selectBooleanCheckbox.test.js?rev=1788079&r1=1788078&r2=1788079&view=diff
==============================================================================
--- myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/10-selectBooleanCheckbox/selectBooleanCheckbox.test.js (original)
+++ myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/10-selectBooleanCheckbox/selectBooleanCheckbox.test.js Wed Mar 22 10:11:52 2017
@@ -18,6 +18,7 @@
 QUnit.test("submit: select A", function (assert) {
   assert.expect(1);
   var done = assert.async();
+  var step = 1;
   var $selectA = jQueryFrame("#page\\:mainForm\\:selectA input");
   var $selectB = jQueryFrame("#page\\:mainForm\\:selectB input");
   var $selectC = jQueryFrame("#page\\:mainForm\\:selectC input");
@@ -29,15 +30,20 @@ QUnit.test("submit: select A", function
   $submit.click();
 
   jQuery("#page\\:testframe").load(function () {
-    var $output = jQueryFrame("#page\\:mainForm\\:submitOutput span");
-    assert.equal($output.text(), "A ");
-    done();
+    if (step == 1) {
+      var $output = jQueryFrame("#page\\:mainForm\\:submitOutput span");
+      assert.equal($output.text(), "A ");
+
+      step++;
+      done();
+    }
   });
 });
 
 QUnit.test("submit: select B and C", function (assert) {
   assert.expect(1);
   var done = assert.async();
+  var step = 1;
   var $selectA = jQueryFrame("#page\\:mainForm\\:selectA input");
   var $selectB = jQueryFrame("#page\\:mainForm\\:selectB input");
   var $selectC = jQueryFrame("#page\\:mainForm\\:selectC input");
@@ -49,9 +55,13 @@ QUnit.test("submit: select B and C", fun
   $submit.click();
 
   jQuery("#page\\:testframe").load(function () {
-    var $output = jQueryFrame("#page\\:mainForm\\:submitOutput span");
-    assert.equal($output.text(), "B C ");
-    done();
+    if (step == 1) {
+      var $output = jQueryFrame("#page\\:mainForm\\:submitOutput span");
+      assert.equal($output.text(), "B C ");
+
+      step++;
+      done();
+    }
   });
 });
 

Modified: myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/20-selectOneChoice/selectOneChoice.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/20-selectOneChoice/selectOneChoice.test.js?rev=1788079&r1=1788078&r2=1788079&view=diff
==============================================================================
--- myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/20-selectOneChoice/selectOneChoice.test.js (original)
+++ myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/20-selectOneChoice/selectOneChoice.test.js Wed Mar 22 10:11:52 2017
@@ -18,6 +18,7 @@
 QUnit.test("submit: Alice", function (assert) {
   assert.expect(1);
   var done = assert.async();
+  var step = 1;
   var $alice = jQueryFrame("#page\\:mainForm\\:selectPerson\\:\\:field option:contains('Alice')");
   var $bob = jQueryFrame("#page\\:mainForm\\:selectPerson\\:\\:field option:contains('Bob')");
   var $submit = jQueryFrame("#page\\:mainForm\\:submit");
@@ -27,15 +28,20 @@ QUnit.test("submit: Alice", function (as
   $submit.click();
 
   jQuery("#page\\:testframe").load(function () {
-    var $output = jQueryFrame("#page\\:mainForm\\:outputPerson span");
-    assert.equal($output.text(), "Alice Anderson");
-    done();
+    if (step == 1) {
+      var $output = jQueryFrame("#page\\:mainForm\\:outputPerson span");
+      assert.equal($output.text(), "Alice Anderson");
+
+      step++;
+      done();
+    }
   });
 });
 
 QUnit.test("submit: Bob", function (assert) {
   assert.expect(1);
   var done = assert.async();
+  var step = 1;
   var $alice = jQueryFrame("#page\\:mainForm\\:selectPerson\\:\\:field option:contains('Alice')");
   var $bob = jQueryFrame("#page\\:mainForm\\:selectPerson\\:\\:field option:contains('Bob')");
   var $submit = jQueryFrame("#page\\:mainForm\\:submit");
@@ -45,9 +51,13 @@ QUnit.test("submit: Bob", function (asse
   $submit.click();
 
   jQuery("#page\\:testframe").load(function () {
-    var $output = jQueryFrame("#page\\:mainForm\\:outputPerson span");
-    assert.equal($output.text(), "Bob Brunch");
-    done();
+    if (step == 1) {
+      var $output = jQueryFrame("#page\\:mainForm\\:outputPerson span");
+      assert.equal($output.text(), "Bob Brunch");
+
+      step++;
+      done();
+    }
   });
 });
 

Modified: myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/30-selectOneRadio/selectOneRadio.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/30-selectOneRadio/selectOneRadio.test.js?rev=1788079&r1=1788078&r2=1788079&view=diff
==============================================================================
--- myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/30-selectOneRadio/selectOneRadio.test.js (original)
+++ myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/30-selectOneRadio/selectOneRadio.test.js Wed Mar 22 10:11:52 2017
@@ -18,6 +18,7 @@
 QUnit.test("submit: Addition (2 + 4)", function (assert) {
   assert.expect(1);
   var done = assert.async();
+  var step = 1;
   var $number1 = jQueryFrame("#page\\:mainForm\\:selectNum1 input");
   var $number2 = jQueryFrame("#page\\:mainForm\\:selectNum2 input");
   var $submitAdd = jQueryFrame("#page\\:mainForm\\:submitAdd");
@@ -31,15 +32,20 @@ QUnit.test("submit: Addition (2 + 4)", f
   $submitAdd.click();
 
   jQuery("#page\\:testframe").load(function () {
-    var $output = jQueryFrame("#page\\:mainForm\\:resultOutput span");
-    assert.equal($output.text(), "6");
-    done();
+    if (step == 1) {
+      var $output = jQueryFrame("#page\\:mainForm\\:resultOutput span");
+      assert.equal($output.text(), "6");
+
+      step++;
+      done();
+    }
   });
 });
 
 QUnit.test("submit: Subtraction (4 - 1)", function (assert) {
   assert.expect(1);
   var done = assert.async();
+  var step = 1;
   var $number1 = jQueryFrame("#page\\:mainForm\\:selectNum1 input");
   var $number2 = jQueryFrame("#page\\:mainForm\\:selectNum2 input");
   var $submitSub = jQueryFrame("#page\\:mainForm\\:submitSub");
@@ -53,9 +59,13 @@ QUnit.test("submit: Subtraction (4 - 1)"
   $submitSub.click();
 
   jQuery("#page\\:testframe").load(function () {
-    var $output = jQueryFrame("#page\\:mainForm\\:resultOutput span");
-    assert.equal($output.text(), "3");
-    done();
+    if (step == 1) {
+      var $output = jQueryFrame("#page\\:mainForm\\:resultOutput span");
+      assert.equal($output.text(), "3");
+
+      step++;
+      done();
+    }
   });
 });
 

Modified: myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/40-selectOneListbox/selectOneListbox.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/40-selectOneListbox/selectOneListbox.test.js?rev=1788079&r1=1788078&r2=1788079&view=diff
==============================================================================
--- myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/40-selectOneListbox/selectOneListbox.test.js (original)
+++ myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/40-selectOneListbox/selectOneListbox.test.js Wed Mar 22 10:11:52 2017
@@ -18,6 +18,7 @@
 QUnit.test("submit: select 'Nile'", function (assert) {
   assert.expect(1);
   var done = assert.async();
+  var step = 1;
   var $rivers = jQueryFrame("#page\\:mainForm\\:riverList option");
   var $submit = jQueryFrame("#page\\:mainForm\\:riverSubmit");
 
@@ -29,15 +30,20 @@ QUnit.test("submit: select 'Nile'", func
   $submit.click();
 
   jQuery("#page\\:testframe").load(function () {
-    var $output = jQueryFrame("#page\\:mainForm\\:riverOutput span");
-    assert.equal($output.text(), "6853 km");
-    done();
+    if (step == 1) {
+      var $output = jQueryFrame("#page\\:mainForm\\:riverOutput span");
+      assert.equal($output.text(), "6853 km");
+
+      step++;
+      done();
+    }
   });
 });
 
 QUnit.test("submit: select 'Yangtze'", function (assert) {
   assert.expect(1);
   var done = assert.async();
+  var step = 1;
   var $rivers = jQueryFrame("#page\\:mainForm\\:riverList option");
   var $submit = jQueryFrame("#page\\:mainForm\\:riverSubmit");
 
@@ -49,9 +55,13 @@ QUnit.test("submit: select 'Yangtze'", f
   $submit.click();
 
   jQuery("#page\\:testframe").load(function () {
-    var $output = jQueryFrame("#page\\:mainForm\\:riverOutput span");
-    assert.equal($output.text(), "6300 km");
-    done();
+    if (step == 1) {
+      var $output = jQueryFrame("#page\\:mainForm\\:riverOutput span");
+      assert.equal($output.text(), "6300 km");
+
+      step++;
+      done();
+    }
   });
 });
 

Modified: myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/50-selectManyCheckbox/selectManyCheckbox.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/50-selectManyCheckbox/selectManyCheckbox.test.js?rev=1788079&r1=1788078&r2=1788079&view=diff
==============================================================================
--- myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/50-selectManyCheckbox/selectManyCheckbox.test.js (original)
+++ myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/50-selectManyCheckbox/selectManyCheckbox.test.js Wed Mar 22 10:11:52 2017
@@ -18,6 +18,7 @@
 QUnit.test("submit: select cat", function (assert) {
   assert.expect(1);
   var done = assert.async();
+  var step = 1;
   var $animals = jQueryFrame("#page\\:mainForm\\:animals input");
   var $submit = jQueryFrame("#page\\:mainForm\\:submit");
 
@@ -28,15 +29,20 @@ QUnit.test("submit: select cat", functio
   $submit.click();
 
   jQuery("#page\\:testframe").load(function () {
-    var $output = jQueryFrame("#page\\:mainForm\\:animalsOutput span");
-    assert.equal($output.text(), "Cat ");
-    done();
+    if (step == 1) {
+      var $output = jQueryFrame("#page\\:mainForm\\:animalsOutput span");
+      assert.equal($output.text(), "Cat ");
+
+      step++;
+      done();
+    }
   });
 });
 
 QUnit.test("submit: select fox and rabbit", function (assert) {
   assert.expect(1);
   var done = assert.async();
+  var step = 1;
   var $animals = jQueryFrame("#page\\:mainForm\\:animals input");
   var $submit = jQueryFrame("#page\\:mainForm\\:submit");
 
@@ -47,9 +53,13 @@ QUnit.test("submit: select fox and rabbi
   $submit.click();
 
   jQuery("#page\\:testframe").load(function () {
-    var $output = jQueryFrame("#page\\:mainForm\\:animalsOutput span");
-    assert.equal($output.text(), "Fox Rabbit ");
-    done();
+    if (step == 1) {
+      var $output = jQueryFrame("#page\\:mainForm\\:animalsOutput span");
+      assert.equal($output.text(), "Fox Rabbit ");
+
+      step++;
+      done();
+    }
   });
 });
 

Modified: myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/popup.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/popup.test.js?rev=1788079&r1=1788078&r2=1788079&view=diff
==============================================================================
--- myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/popup.test.js (original)
+++ myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/popup.test.js Wed Mar 22 10:11:52 2017
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-QUnit.test("Open 'Client Popup' and press 'Cancel'.", function(assert) {
+QUnit.test("Open 'Client Popup' and press 'Cancel'.", function (assert) {
   assert.expect(3);
   var step = 1;
 
@@ -30,7 +30,7 @@ QUnit.test("Open 'Client Popup' and pres
   assert.equal($popup.attr("value"), "true");
 });
 
-QUnit.test("Open 'Client Popup', press 'Submit' while field is empty. Press 'Cancel'.", function(assert) {
+QUnit.test("Open 'Client Popup', press 'Submit' while field is empty. Press 'Cancel'.", function (assert) {
   assert.expect(5);
   var done = assert.async(1);
 
@@ -49,10 +49,10 @@ QUnit.test("Open 'Client Popup', press '
   $inputField.val("");
   $submitButton.click();
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $messages = jQueryFrame($messages.selector);
     return $messages.length == 1;
-  }, function() {
+  }, function () {
     $output = jQueryFrame($output.selector);
     $messages = jQueryFrame($messages.selector);
     $cancelButton = jQueryFrame($cancelButton.selector);
@@ -66,7 +66,7 @@ QUnit.test("Open 'Client Popup', press '
   });
 });
 
-QUnit.test("Open 'Client Popup', press 'Submit' while field has content. Press 'Cancel'.", function(assert) {
+QUnit.test("Open 'Client Popup', press 'Submit' while field has content. Press 'Cancel'.", function (assert) {
   assert.expect(5);
   var done = assert.async(1);
 
@@ -84,10 +84,10 @@ QUnit.test("Open 'Client Popup', press '
   $inputField.val("test client popup - submit button");
   $submitButton.click();
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $messages = jQueryFrame($messages.selector);
     return $messages.length == 0;
-  }, function() {
+  }, function () {
     $output = jQueryFrame($output.selector);
     $messages = jQueryFrame($messages.selector);
     $cancelButton = jQueryFrame($cancelButton.selector);
@@ -101,9 +101,10 @@ QUnit.test("Open 'Client Popup', press '
   });
 });
 
-QUnit.test("Open 'Client Popup', press 'Submit & Close' while field is empty.", function(assert) {
+QUnit.test("Open 'Client Popup', press 'Submit & Close' while field is empty.", function (assert) {
   assert.expect(4);
   var done = assert.async(1);
+  var step = 1;
 
   var $popup = jQueryFrame("#page\\:mainForm\\:form2\\:clientPopup input");
   var $openButton = jQueryFrame("#page\\:mainForm\\:form2\\:open");
@@ -118,18 +119,21 @@ QUnit.test("Open 'Client Popup', press '
   $inputField.val("");
   $submitCloseButton.click();
 
-  jQuery("#page\\:testframe").load(function() {
-    $popup = jQueryFrame($popup.selector);
-    $output = jQueryFrame($output.selector);
-
-    assert.equal($popup.attr("value"), "true");
-    assert.equal($output.text(), outputValue);
-
-    done();
+  jQuery("#page\\:testframe").load(function () {
+    if (step == 1) {
+      $popup = jQueryFrame($popup.selector);
+      $output = jQueryFrame($output.selector);
+
+      assert.equal($popup.attr("value"), "true");
+      assert.equal($output.text(), outputValue);
+
+      step++;
+      done();
+    }
   });
 });
 
-QUnit.test("Open 'Client Popup', press 'Submit & Close' while field has content.", function(assert) {
+QUnit.test("Open 'Client Popup', press 'Submit & Close' while field has content.", function (assert) {
   assert.expect(4);
   var done = assert.async(1);
 
@@ -145,7 +149,7 @@ QUnit.test("Open 'Client Popup', press '
   $inputField.val("test client popup - submit and close button");
   $submitCloseButton.click();
 
-  jQuery("#page\\:testframe").load(function() {
+  jQuery("#page\\:testframe").load(function () {
     $popup = jQueryFrame($popup.selector);
     $output = jQueryFrame($output.selector);
 

Modified: myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.test.js?rev=1788079&r1=1788078&r2=1788079&view=diff
==============================================================================
--- myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.test.js (original)
+++ myfaces/tobago/branches/TOBAGO-1719/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.test.js Wed Mar 22 10:11:52 2017
@@ -15,9 +15,10 @@
  * limitations under the License.
  */
 
-QUnit.test("Basics: Name", function(assert) {
+QUnit.test("Basics: Name", function (assert) {
   assert.expect(37);
   var done = assert.async(4);
+  var step = 1;
 
   var $colName = jQueryFrame("#page\\:mainForm\\:s1\\:columnName_sorter");
   var $rows = jQueryFrame("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
@@ -27,77 +28,82 @@ QUnit.test("Basics: Name", function(asse
     $colName.click();
   }
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $colName = jQueryFrame($colName.selector);
-    return $colName.find(".fa-angle-up").length == 1;
-  }, function() {
+    return step == 1 && $colName.find(".fa-angle-up").length == 1;
+  }, function () {
     $colName = jQueryFrame($colName.selector);
     assert.equal($colName.find(".fa-angle-up").length, 1);
-    done();
 
     $leftPaging = jQueryFrame($leftPaging.selector);
     $leftPaging.val("22").trigger("blur");
 
-    waitForAjax(function() {
+    waitForAjax(function () {
       $rows = jQueryFrame($rows.selector);
-      return ajaxWaitingBodyTableCheck($rows,
-          "Earth", "365.26", "",
-          "Elara", "259.65", "1905",
-          "Enceladus", "1.37", "1789",
-          "Epimetheus", "0.69", "1980");
-    }, function() {
+      return step == 2 && ajaxWaitingBodyTableCheck($rows,
+              "Earth", "365.26", "",
+              "Elara", "259.65", "1905",
+              "Enceladus", "1.37", "1789",
+              "Epimetheus", "0.69", "1980");
+    }, function () {
       $rows = jQueryFrame($rows.selector);
       ajaxExecuteBodyTableCheck(assert, $rows,
           "Earth", "365.26", "",
           "Elara", "259.65", "1905",
           "Enceladus", "1.37", "1789",
           "Epimetheus", "0.69", "1980");
-      done();
 
       $colName.click();
 
-      waitForAjax(function() {
+      waitForAjax(function () {
         $rows = jQueryFrame($rows.selector);
-        return ajaxWaitingBodyTableCheck($rows,
-            "Proteus", "1.12", "1989",
-            "Prospero", "-1962.95", "1999",
-            "Prometheus", "0.61", "1980",
-            "Praxidike", "625.3", "2000");
-      }, function() {
+        return step == 3 && ajaxWaitingBodyTableCheck($rows,
+                "Proteus", "1.12", "1989",
+                "Prospero", "-1962.95", "1999",
+                "Prometheus", "0.61", "1980",
+                "Praxidike", "625.3", "2000");
+      }, function () {
         $rows = jQueryFrame($rows.selector);
         ajaxExecuteBodyTableCheck(assert, $rows,
             "Proteus", "1.12", "1989",
             "Prospero", "-1962.95", "1999",
             "Prometheus", "0.61", "1980",
             "Praxidike", "625.3", "2000");
-        done();
 
         $colName.click();
 
-        waitForAjax(function() {
+        waitForAjax(function () {
           $rows = jQueryFrame($rows.selector);
-          return ajaxWaitingBodyTableCheck($rows,
-              "Earth", "365.26", "",
-              "Elara", "259.65", "1905",
-              "Enceladus", "1.37", "1789",
-              "Epimetheus", "0.69", "1980");
-        }, function() {
+          return step == 4 && ajaxWaitingBodyTableCheck($rows,
+                  "Earth", "365.26", "",
+                  "Elara", "259.65", "1905",
+                  "Enceladus", "1.37", "1789",
+                  "Epimetheus", "0.69", "1980");
+        }, function () {
           $rows = jQueryFrame($rows.selector);
           ajaxExecuteBodyTableCheck(assert, $rows,
               "Earth", "365.26", "",
               "Elara", "259.65", "1905",
               "Enceladus", "1.37", "1789",
               "Epimetheus", "0.69", "1980");
+          step++;
           done();
         });
+        step++;
+        done();
       });
+      step++;
+      done();
     });
+    step++;
+    done();
   });
 });
 
-QUnit.test("Basics: Period", function(assert) {
+QUnit.test("Basics: Period", function (assert) {
   assert.expect(37);
   var done = assert.async(4);
+  var step = 1;
 
   var $colPeriod = jQueryFrame("#page\\:mainForm\\:s1\\:columnPeriod_sorter");
   var $rows = jQueryFrame("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
@@ -107,77 +113,82 @@ QUnit.test("Basics: Period", function(as
     $colPeriod.click();
   }
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $colPeriod = jQueryFrame($colPeriod.selector);
-    return $colPeriod.find(".fa-angle-up").length == 1;
-  }, function() {
+    return step == 1 && $colPeriod.find(".fa-angle-up").length == 1;
+  }, function () {
     $colPeriod = jQueryFrame($colPeriod.selector);
     assert.equal($colPeriod.find(".fa-angle-up").length, 1);
-    done();
 
     $leftPaging = jQueryFrame($leftPaging.selector);
     $leftPaging.val("22").trigger("blur");
 
-    waitForAjax(function() {
+    waitForAjax(function () {
       $rows = jQueryFrame($rows.selector);
-      return ajaxWaitingBodyTableCheck($rows,
-          "Galatea", "0.43", "1989",
-          "Cressida", "0.46", "1986",
-          "Desdemona", "0.47", "1986",
-          "Juliet", "0.49", "1986");
-    }, function() {
+      return step == 2 && ajaxWaitingBodyTableCheck($rows,
+              "Galatea", "0.43", "1989",
+              "Cressida", "0.46", "1986",
+              "Desdemona", "0.47", "1986",
+              "Juliet", "0.49", "1986");
+    }, function () {
       $rows = jQueryFrame($rows.selector);
       ajaxExecuteBodyTableCheck(assert, $rows,
           "Galatea", "0.43", "1989",
           "Cressida", "0.46", "1986",
           "Desdemona", "0.47", "1986",
           "Juliet", "0.49", "1986");
-      done();
 
       $colPeriod.click();
 
-      waitForAjax(function() {
+      waitForAjax(function () {
         $rows = jQueryFrame($rows.selector);
-        return ajaxWaitingBodyTableCheck($rows,
-            "Leda", "238.72", "1974",
-            "Venus", "224.7", "",
-            "Themisto", "130.02", "2000",
-            "Mercury", "87.97", "");
-      }, function() {
+        return step == 3 && ajaxWaitingBodyTableCheck($rows,
+                "Leda", "238.72", "1974",
+                "Venus", "224.7", "",
+                "Themisto", "130.02", "2000",
+                "Mercury", "87.97", "");
+      }, function () {
         $rows = jQueryFrame($rows.selector);
         ajaxExecuteBodyTableCheck(assert, $rows,
             "Leda", "238.72", "1974",
             "Venus", "224.7", "",
             "Themisto", "130.02", "2000",
             "Mercury", "87.97", "");
-        done();
 
         $colPeriod.click();
 
-        waitForAjax(function() {
+        waitForAjax(function () {
           $rows = jQueryFrame($rows.selector);
-          return ajaxWaitingBodyTableCheck($rows,
-              "Galatea", "0.43", "1989",
-              "Cressida", "0.46", "1986",
-              "Desdemona", "0.47", "1986",
-              "Juliet", "0.49", "1986");
-        }, function() {
+          return step == 4 && ajaxWaitingBodyTableCheck($rows,
+                  "Galatea", "0.43", "1989",
+                  "Cressida", "0.46", "1986",
+                  "Desdemona", "0.47", "1986",
+                  "Juliet", "0.49", "1986");
+        }, function () {
           $rows = jQueryFrame($rows.selector);
           ajaxExecuteBodyTableCheck(assert, $rows,
               "Galatea", "0.43", "1989",
               "Cressida", "0.46", "1986",
               "Desdemona", "0.47", "1986",
               "Juliet", "0.49", "1986");
+          step++;
           done();
         });
+        step++;
+        done();
       });
+      step++;
+      done();
     });
+    step++;
+    done();
   });
 });
 
-QUnit.test("Basics: Year", function(assert) {
+QUnit.test("Basics: Year", function (assert) {
   assert.expect(13);
   var done = assert.async(4);
+  var step = 1;
 
   var $colYear = jQueryFrame("#page\\:mainForm\\:s1\\:columnDiscoverYear_sorter");
   var $rows = jQueryFrame("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
@@ -187,65 +198,69 @@ QUnit.test("Basics: Year", function(asse
     $colYear.click();
   }
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $colYear = jQueryFrame($colYear.selector);
     return $colYear.find(".fa-angle-up").length == 1;
-  }, function() {
+  }, function () {
     $colYear = jQueryFrame($colYear.selector);
     assert.equal($colYear.find(".fa-angle-up").length, 1);
-    done();
 
     $leftPaging = jQueryFrame($leftPaging.selector);
     $leftPaging.val("22").trigger("blur");
 
-    waitForAjax(function() {
+    waitForAjax(function () {
       $rows = jQueryFrame($rows.selector);
       return $rows.eq(0).find(".tobago-sheet-cell span").eq(2).text() == "1789"
           && $rows.eq(1).find(".tobago-sheet-cell span").eq(2).text() == "1846"
           && $rows.eq(2).find(".tobago-sheet-cell span").eq(2).text() == "1846"
           && $rows.eq(3).find(".tobago-sheet-cell span").eq(2).text() == "1848";
-    }, function() {
+    }, function () {
       $rows = jQueryFrame($rows.selector);
       assert.equal($rows.eq(0).find(".tobago-sheet-cell span").eq(2).text(), "1789", "row0col2");
       assert.equal($rows.eq(1).find(".tobago-sheet-cell span").eq(2).text(), "1846", "row1col2");
       assert.equal($rows.eq(2).find(".tobago-sheet-cell span").eq(2).text(), "1846", "row2col2");
       assert.equal($rows.eq(3).find(".tobago-sheet-cell span").eq(2).text(), "1848", "row3col2");
-      done();
 
       $colYear.click();
 
-      waitForAjax(function() {
+      waitForAjax(function () {
         $rows = jQueryFrame($rows.selector);
         return $rows.eq(0).find(".tobago-sheet-cell span").eq(2).text() == "1989"
             && $rows.eq(1).find(".tobago-sheet-cell span").eq(2).text() == "1989"
             && $rows.eq(2).find(".tobago-sheet-cell span").eq(2).text() == "1989"
             && $rows.eq(3).find(".tobago-sheet-cell span").eq(2).text() == "1986";
-      }, function() {
+      }, function () {
         $rows = jQueryFrame($rows.selector);
         assert.equal($rows.eq(0).find(".tobago-sheet-cell span").eq(2).text(), "1989", "row0col2");
         assert.equal($rows.eq(1).find(".tobago-sheet-cell span").eq(2).text(), "1989", "row1col2");
         assert.equal($rows.eq(2).find(".tobago-sheet-cell span").eq(2).text(), "1989", "row2col2");
         assert.equal($rows.eq(3).find(".tobago-sheet-cell span").eq(2).text(), "1986", "row3col2");
-        done();
 
         $colYear.click();
 
-        waitForAjax(function() {
+        waitForAjax(function () {
           $rows = jQueryFrame($rows.selector);
           return $rows.eq(0).find(".tobago-sheet-cell span").eq(2).text() == "1789"
               && $rows.eq(1).find(".tobago-sheet-cell span").eq(2).text() == "1846"
               && $rows.eq(2).find(".tobago-sheet-cell span").eq(2).text() == "1846"
               && $rows.eq(3).find(".tobago-sheet-cell span").eq(2).text() == "1848";
-        }, function() {
+        }, function () {
           $rows = jQueryFrame($rows.selector);
           assert.equal($rows.eq(0).find(".tobago-sheet-cell span").eq(2).text(), "1789", "row0col2");
           assert.equal($rows.eq(1).find(".tobago-sheet-cell span").eq(2).text(), "1846", "row1col2");
           assert.equal($rows.eq(2).find(".tobago-sheet-cell span").eq(2).text(), "1846", "row2col2");
           assert.equal($rows.eq(3).find(".tobago-sheet-cell span").eq(2).text(), "1848", "row3col2");
+          step++;
           done();
         });
+        step++;
+        done();
       });
+      step++;
+      done();
     });
+    step++;
+    done();
   });
 });
 
@@ -253,9 +268,10 @@ QUnit.test("Basics: Year", function(asse
  * 1. goto line 8
  * 2. goto line 9
  */
-QUnit.test("Basics: left paging", function(assert) {
+QUnit.test("Basics: left paging", function (assert) {
   assert.expect(25);
   var done = assert.async(3);
+  var step = 1;
 
   var $colName = jQueryFrame("#page\\:mainForm\\:s1\\:columnName_sorter");
   var $rows = jQueryFrame("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
@@ -265,53 +281,56 @@ QUnit.test("Basics: left paging", functi
     $colName.click();
   }
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $colName = jQueryFrame($colName.selector);
-    return $colName.find(".fa-angle-up").length == 1;
-  }, function() {
+    return step == 1 && $colName.find(".fa-angle-up").length == 1;
+  }, function () {
     $colName = jQueryFrame($colName.selector);
     assert.equal($colName.find(".fa-angle-up").length, 1);
-    done();
 
     $leftPaging = jQueryFrame($leftPaging.selector);
     $leftPaging.val("8").trigger("blur");
 
-    waitForAjax(function() {
+    waitForAjax(function () {
       $rows = jQueryFrame($rows.selector);
-      return ajaxWaitingBodyTableCheck($rows,
-          "Bianca", "0.43", "1986",
-          "Caliban", "-579.39", "1997",
-          "Callirrhoe", "758.8", "2000",
-          "Callisto", "16.69", "1610");
-    }, function() {
+      return step == 2 && ajaxWaitingBodyTableCheck($rows,
+              "Bianca", "0.43", "1986",
+              "Caliban", "-579.39", "1997",
+              "Callirrhoe", "758.8", "2000",
+              "Callisto", "16.69", "1610");
+    }, function () {
       $rows = jQueryFrame($rows.selector);
       ajaxExecuteBodyTableCheck(assert, $rows,
           "Bianca", "0.43", "1986",
           "Caliban", "-579.39", "1997",
           "Callirrhoe", "758.8", "2000",
           "Callisto", "16.69", "1610");
-      done();
 
       $leftPaging = jQueryFrame($leftPaging.selector);
       $leftPaging.val("9").trigger("blur");
 
-      waitForAjax(function() {
+      waitForAjax(function () {
         $rows = jQueryFrame($rows.selector);
-        return ajaxWaitingBodyTableCheck($rows,
-            "Caliban", "-579.39", "1997",
-            "Callirrhoe", "758.8", "2000",
-            "Callisto", "16.69", "1610",
-            "Calypso", "1.89", "1980");
-      }, function() {
+        return step == 3 && ajaxWaitingBodyTableCheck($rows,
+                "Caliban", "-579.39", "1997",
+                "Callirrhoe", "758.8", "2000",
+                "Callisto", "16.69", "1610",
+                "Calypso", "1.89", "1980");
+      }, function () {
         $rows = jQueryFrame($rows.selector);
         ajaxExecuteBodyTableCheck(assert, $rows,
             "Caliban", "-579.39", "1997",
             "Callirrhoe", "758.8", "2000",
             "Callisto", "16.69", "1610",
             "Calypso", "1.89", "1980");
+        step++;
         done();
       });
+      step++;
+      done();
     });
+    step++;
+    done();
   });
 });
 
@@ -320,9 +339,10 @@ QUnit.test("Basics: left paging", functi
  * 2. goto page 16
  * 3. goto page 13
  */
-QUnit.test("Basics: center paging", function(assert) {
+QUnit.test("Basics: center paging", function (assert) {
   assert.expect(49);
   var done = assert.async(5);
+  var step = 1;
 
   var $colName = jQueryFrame("#page\\:mainForm\\:s1\\:columnName_sorter");
   var $rows = jQueryFrame("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
@@ -333,93 +353,98 @@ QUnit.test("Basics: center paging", func
     $colName.click();
   }
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $colName = jQueryFrame($colName.selector);
-    return $colName.find(".fa-angle-up").length == 1;
-  }, function() {
+    return step == 1 && $colName.find(".fa-angle-up").length == 1;
+  }, function () {
     $colName = jQueryFrame($colName.selector);
     assert.equal($colName.find(".fa-angle-up").length, 1);
-    done();
 
     $leftPaging = jQueryFrame($leftPaging.selector);
     $leftPaging.val("1").trigger("blur");
 
-    waitForAjax(function() {
+    waitForAjax(function () {
       $rows = jQueryFrame($rows.selector);
-      return ajaxWaitingBodyTableCheck($rows,
-          "1986U10", "0.64", "1999",
-          "Adrastea", "0.3", "1979",
-          "Amalthea", "0.5", "1892",
-          "Ananke", "-629.77", "1951");
-    }, function() {
+      return step == 2 && ajaxWaitingBodyTableCheck($rows,
+              "1986U10", "0.64", "1999",
+              "Adrastea", "0.3", "1979",
+              "Amalthea", "0.5", "1892",
+              "Ananke", "-629.77", "1951");
+    }, function () {
       $rows = jQueryFrame($rows.selector);
       ajaxExecuteBodyTableCheck(assert, $rows,
           "1986U10", "0.64", "1999",
           "Adrastea", "0.3", "1979",
           "Amalthea", "0.5", "1892",
           "Ananke", "-629.77", "1951");
-      done();
 
       $centerPaging = jQueryFrame($centerPaging.selector);
       $centerPaging.eq(6).click();
 
-      waitForAjax(function() {
+      waitForAjax(function () {
         $rows = jQueryFrame($rows.selector);
-        return ajaxWaitingBodyTableCheck($rows,
-            "Epimetheus", "0.69", "1980",
-            "Erinome", "728.3", "2000",
-            "Europa", "3.55", "1610",
-            "Galatea", "0.43", "1989");
-      }, function() {
+        return step == 3 && ajaxWaitingBodyTableCheck($rows,
+                "Epimetheus", "0.69", "1980",
+                "Erinome", "728.3", "2000",
+                "Europa", "3.55", "1610",
+                "Galatea", "0.43", "1989");
+      }, function () {
         $rows = jQueryFrame($rows.selector);
         ajaxExecuteBodyTableCheck(assert, $rows,
             "Epimetheus", "0.69", "1980",
             "Erinome", "728.3", "2000",
             "Europa", "3.55", "1610",
             "Galatea", "0.43", "1989");
-        done();
 
         $centerPaging = jQueryFrame($centerPaging.selector);
         $centerPaging.eq(10).click();
 
-        waitForAjax(function() {
+        waitForAjax(function () {
           $rows = jQueryFrame($rows.selector);
-          return ajaxWaitingBodyTableCheck($rows,
-              "Phoebe", "-550.48", "1898",
-              "Pluto", "90800.0", "1930",
-              "Portia", "0.51", "1986",
-              "Praxidike", "625.3", "2000");
-        }, function() {
+          return step == 4 && ajaxWaitingBodyTableCheck($rows,
+                  "Phoebe", "-550.48", "1898",
+                  "Pluto", "90800.0", "1930",
+                  "Portia", "0.51", "1986",
+                  "Praxidike", "625.3", "2000");
+        }, function () {
           $rows = jQueryFrame($rows.selector);
           ajaxExecuteBodyTableCheck(assert, $rows,
               "Phoebe", "-550.48", "1898",
               "Pluto", "90800.0", "1930",
               "Portia", "0.51", "1986",
               "Praxidike", "625.3", "2000");
-          done();
 
           $centerPaging = jQueryFrame($centerPaging.selector);
           $centerPaging.eq(3).click();
 
-          waitForAjax(function() {
+          waitForAjax(function () {
             $rows = jQueryFrame($rows.selector);
-            return ajaxWaitingBodyTableCheck($rows,
-                "Neptune", "60190.0", "1846",
-                "Nereid", "360.13", "1949",
-                "Oberon", "13.46", "1787",
-                "Ophelia", "0.38", "1986");
-          }, function() {
+            return step == 5 && ajaxWaitingBodyTableCheck($rows,
+                    "Neptune", "60190.0", "1846",
+                    "Nereid", "360.13", "1949",
+                    "Oberon", "13.46", "1787",
+                    "Ophelia", "0.38", "1986");
+          }, function () {
             $rows = jQueryFrame($rows.selector);
             ajaxExecuteBodyTableCheck(assert, $rows,
                 "Neptune", "60190.0", "1846",
                 "Nereid", "360.13", "1949",
                 "Oberon", "13.46", "1787",
                 "Ophelia", "0.38", "1986");
+            step++;
             done();
           });
+          step++;
+          done();
         });
+        step++;
+        done();
       });
+      step++;
+      done();
     });
+    step++;
+    done();
   });
 });
 
@@ -430,9 +455,10 @@ QUnit.test("Basics: center paging", func
  * 4. goto page 21 by pressing arrow-left
  * 5. goto page 14
  */
-QUnit.test("Basics: right paging", function(assert) {
-  assert.expect(61);
-  var done = assert.async(6);
+QUnit.test("Basics: right paging", function (assert) {
+  assert.expect(73);
+  var done = assert.async(7);
+  var step = 1;
 
   var $colName = jQueryFrame("#page\\:mainForm\\:s1\\:columnName_sorter");
   var $rows = jQueryFrame("#page\\:mainForm\\:s1 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
@@ -443,139 +469,147 @@ QUnit.test("Basics: right paging", funct
     $colName.click();
   }
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $colName = jQueryFrame($colName.selector);
-    return $colName.find(".fa-angle-up").length == 1;
-  }, function() {
+    return step == 1 && $colName.find(".fa-angle-up").length == 1;
+  }, function () {
     $colName = jQueryFrame($colName.selector);
     assert.equal($colName.find(".fa-angle-up").length, 1);
-    done();
 
     $leftPaging = jQueryFrame($leftPaging.selector);
     $leftPaging.val("22").trigger("blur");
 
-    waitForAjax(function() {
+    waitForAjax(function () {
       $rows = jQueryFrame($rows.selector);
-      return ajaxWaitingBodyTableCheck($rows,
-          "Earth", "365.26", "",
-          "Elara", "259.65", "1905",
-          "Enceladus", "1.37", "1789",
-          "Epimetheus", "0.69", "1980");
-    }, function() {
+      return step == 2 && ajaxWaitingBodyTableCheck($rows,
+              "Earth", "365.26", "",
+              "Elara", "259.65", "1905",
+              "Enceladus", "1.37", "1789",
+              "Epimetheus", "0.69", "1980");
+    }, function () {
       $rows = jQueryFrame($rows.selector);
       ajaxExecuteBodyTableCheck(assert, $rows,
           "Earth", "365.26", "",
           "Elara", "259.65", "1905",
           "Enceladus", "1.37", "1789",
           "Epimetheus", "0.69", "1980");
-      done();
 
       var $rightPagingFirstPage = jQueryFrame($rightPaging.selector).eq(0);
       $rightPagingFirstPage.click();
 
-      waitForAjax(function() {
+      waitForAjax(function () {
         $rows = jQueryFrame($rows.selector);
-        return ajaxWaitingBodyTableCheck($rows,
-            "1986U10", "0.64", "1999",
-            "Adrastea", "0.3", "1979",
-            "Amalthea", "0.5", "1892",
-            "Ananke", "-629.77", "1951");
-      }, function() {
+        return step == 3 && ajaxWaitingBodyTableCheck($rows,
+                "1986U10", "0.64", "1999",
+                "Adrastea", "0.3", "1979",
+                "Amalthea", "0.5", "1892",
+                "Ananke", "-629.77", "1951");
+      }, function () {
         $rows = jQueryFrame($rows.selector);
         ajaxExecuteBodyTableCheck(assert, $rows,
             "1986U10", "0.64", "1999",
             "Adrastea", "0.3", "1979",
             "Amalthea", "0.5", "1892",
             "Ananke", "-629.77", "1951");
-        done();
 
         var $rightPagingRight = jQueryFrame($rightPaging.selector).eq(3);
         $rightPagingRight.click();
 
-        waitForAjax(function() {
+        waitForAjax(function () {
           $rows = jQueryFrame($rows.selector);
-          return ajaxWaitingBodyTableCheck($rows,
-              "Ariel", "2.52", "1851",
-              "Atlas", "0.6", "1980",
-              "Belinda", "0.62", "1986",
-              "Bianca", "0.43", "1986");
-        }, function() {
+          return step == 4 && ajaxWaitingBodyTableCheck($rows,
+                  "Ariel", "2.52", "1851",
+                  "Atlas", "0.6", "1980",
+                  "Belinda", "0.62", "1986",
+                  "Bianca", "0.43", "1986");
+        }, function () {
           $rows = jQueryFrame($rows.selector);
           ajaxExecuteBodyTableCheck(assert, $rows,
               "Ariel", "2.52", "1851",
               "Atlas", "0.6", "1980",
               "Belinda", "0.62", "1986",
               "Bianca", "0.43", "1986");
-          done();
 
           var $rightPagingLastPage = jQueryFrame($rightPaging.selector).eq(4);
           $rightPagingLastPage.click();
 
-          waitForAjax(function() {
+          waitForAjax(function () {
             $rows = jQueryFrame($rows.selector);
-            return ajaxWaitingBodyTableCheck($rows,
-                "Triton", "-5.88", "1846",
-                "Umbriel", "4.14", "1851",
-                "Uranus", "30685.0", "1781",
-                "Venus", "224.7", "");
-          }, function() {
+            return step == 5 && ajaxWaitingBodyTableCheck($rows,
+                    "Triton", "-5.88", "1846",
+                    "Umbriel", "4.14", "1851",
+                    "Uranus", "30685.0", "1781",
+                    "Venus", "224.7", "");
+          }, function () {
             $rows = jQueryFrame($rows.selector);
             ajaxExecuteBodyTableCheck(assert, $rows,
                 "Triton", "-5.88", "1846",
                 "Umbriel", "4.14", "1851",
                 "Uranus", "30685.0", "1781",
                 "Venus", "224.7", "");
-            done();
 
             var $rightPagingLeft = jQueryFrame($rightPaging.selector).eq(1);
             $rightPagingLeft.click();
 
-            waitForAjax(function() {
+            waitForAjax(function () {
               $rows = jQueryFrame($rows.selector);
-              return ajaxWaitingBodyTableCheck($rows,
-                  "Thebe", "0.67", "1979",
-                  "Themisto", "130.02", "2000",
-                  "Titan", "15.95", "1655",
-                  "Titania", "8.71", "1787");
-            }, function() {
+              return step == 6 && ajaxWaitingBodyTableCheck($rows,
+                      "Thebe", "0.67", "1979",
+                      "Themisto", "130.02", "2000",
+                      "Titan", "15.95", "1655",
+                      "Titania", "8.71", "1787");
+            }, function () {
               $rows = jQueryFrame($rows.selector);
               ajaxExecuteBodyTableCheck(assert, $rows,
                   "Thebe", "0.67", "1979",
                   "Themisto", "130.02", "2000",
                   "Titan", "15.95", "1655",
                   "Titania", "8.71", "1787");
-              done();
 
               var $rightPagingJumpToPage = jQueryFrame($rightPaging.selector).find("input");
               $rightPagingJumpToPage.val("14").trigger("blur");
 
-              waitForAjax(function() {
+              waitForAjax(function () {
                 $rows = jQueryFrame($rows.selector);
-                return ajaxWaitingBodyTableCheck($rows,
-                    "Neptune", "60190.0", "1846",
-                    "Nereid", "360.13", "1949",
-                    "Oberon", "13.46", "1787",
-                    "Ophelia", "0.38", "1986");
-              }, function() {
+                return step == 7 && ajaxWaitingBodyTableCheck($rows,
+                        "Neptune", "60190.0", "1846",
+                        "Nereid", "360.13", "1949",
+                        "Oberon", "13.46", "1787",
+                        "Ophelia", "0.38", "1986");
+              }, function () {
                 $rows = jQueryFrame($rows.selector);
                 ajaxExecuteBodyTableCheck(assert, $rows,
                     "Neptune", "60190.0", "1846",
                     "Nereid", "360.13", "1949",
                     "Oberon", "13.46", "1787",
                     "Ophelia", "0.38", "1986");
+                step++;
                 done();
               });
+              step++;
+              done();
             });
+            step++;
+            done();
           });
+          step++;
+          done();
         });
+        step++;
+        done();
       });
+      step++;
+      done();
     });
+    step++;
+    done();
   });
 });
 
-QUnit.test("Custom Sorting: Name", function(assert) {
+QUnit.test("Custom Sorting: Name", function (assert) {
   assert.expect(37);
   var done = assert.async(4);
+  var step = 1;
 
   var $colName = jQueryFrame("#page\\:mainForm\\:s2\\:customColumnName_sorter");
   var $rows = jQueryFrame("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
@@ -585,77 +619,82 @@ QUnit.test("Custom Sorting: Name", funct
     $colName.click();
   }
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $colName = jQueryFrame($colName.selector);
-    return $colName.find(".fa-angle-up").length == 1;
-  }, function() {
+    return step == 1 && $colName.find(".fa-angle-up").length == 1;
+  }, function () {
     $colName = jQueryFrame($colName.selector);
     assert.equal($colName.find(".fa-angle-up").length, 1);
-    done();
 
     $leftPaging = jQueryFrame($leftPaging.selector);
     $leftPaging.val("22").trigger("blur");
 
-    waitForAjax(function() {
+    waitForAjax(function () {
       $rows = jQueryFrame($rows.selector);
-      return ajaxWaitingBodyTableCheck($rows,
-          "Earth", "365.26", "",
-          "Elara", "259.65", "1905",
-          "Enceladus", "1.37", "1789",
-          "Epimetheus", "0.69", "1980");
-    }, function() {
+      return step == 2 && ajaxWaitingBodyTableCheck($rows,
+              "Earth", "365.26", "",
+              "Elara", "259.65", "1905",
+              "Enceladus", "1.37", "1789",
+              "Epimetheus", "0.69", "1980");
+    }, function () {
       $rows = jQueryFrame($rows.selector);
       ajaxExecuteBodyTableCheck(assert, $rows,
           "Earth", "365.26", "",
           "Elara", "259.65", "1905",
           "Enceladus", "1.37", "1789",
           "Epimetheus", "0.69", "1980");
-      done();
 
       $colName.click();
 
-      waitForAjax(function() {
+      waitForAjax(function () {
         $rows = jQueryFrame($rows.selector);
-        return ajaxWaitingBodyTableCheck($rows,
-            "Proteus", "1.12", "1989",
-            "Prospero", "-1962.95", "1999",
-            "Prometheus", "0.61", "1980",
-            "Praxidike", "625.3", "2000");
-      }, function() {
+        return step == 3 && ajaxWaitingBodyTableCheck($rows,
+                "Proteus", "1.12", "1989",
+                "Prospero", "-1962.95", "1999",
+                "Prometheus", "0.61", "1980",
+                "Praxidike", "625.3", "2000");
+      }, function () {
         $rows = jQueryFrame($rows.selector);
         ajaxExecuteBodyTableCheck(assert, $rows,
             "Proteus", "1.12", "1989",
             "Prospero", "-1962.95", "1999",
             "Prometheus", "0.61", "1980",
             "Praxidike", "625.3", "2000");
-        done();
 
         $colName.click();
 
-        waitForAjax(function() {
+        waitForAjax(function () {
           $rows = jQueryFrame($rows.selector);
-          return ajaxWaitingBodyTableCheck($rows,
-              "Earth", "365.26", "",
-              "Elara", "259.65", "1905",
-              "Enceladus", "1.37", "1789",
-              "Epimetheus", "0.69", "1980");
-        }, function() {
+          return step == 4 && ajaxWaitingBodyTableCheck($rows,
+                  "Earth", "365.26", "",
+                  "Elara", "259.65", "1905",
+                  "Enceladus", "1.37", "1789",
+                  "Epimetheus", "0.69", "1980");
+        }, function () {
           $rows = jQueryFrame($rows.selector);
           ajaxExecuteBodyTableCheck(assert, $rows,
               "Earth", "365.26", "",
               "Elara", "259.65", "1905",
               "Enceladus", "1.37", "1789",
               "Epimetheus", "0.69", "1980");
+          step++;
           done();
         });
+        step++;
+        done();
       });
+      step++;
+      done();
     });
+    step++;
+    done();
   });
 });
 
-QUnit.test("Custom Sorting: Period", function(assert) {
+QUnit.test("Custom Sorting: Period", function (assert) {
   assert.expect(37);
   var done = assert.async(4);
+  var step = 1;
 
   var $colPeriod = jQueryFrame("#page\\:mainForm\\:s2\\:customColumnPeriod_sorter");
   var $rows = jQueryFrame("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
@@ -665,77 +704,82 @@ QUnit.test("Custom Sorting: Period", fun
     $colPeriod.click();
   }
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $colPeriod = jQueryFrame($colPeriod.selector);
-    return $colPeriod.find(".fa-angle-up").length == 1;
-  }, function() {
+    return step == 1 && $colPeriod.find(".fa-angle-up").length == 1;
+  }, function () {
     $colPeriod = jQueryFrame($colPeriod.selector);
     assert.equal($colPeriod.find(".fa-angle-up").length, 1);
-    done();
 
     $leftPaging = jQueryFrame($leftPaging.selector);
     $leftPaging.val("22").trigger("blur");
 
-    waitForAjax(function() {
+    waitForAjax(function () {
       $rows = jQueryFrame($rows.selector);
-      return ajaxWaitingBodyTableCheck($rows,
-          "Belinda", "0.62", "1986",
-          "Pandora", "0.63", "1980",
-          "1986U10", "0.64", "1999",
-          "Thebe", "0.67", "1979");
-    }, function() {
+      return step == 2 && ajaxWaitingBodyTableCheck($rows,
+              "Belinda", "0.62", "1986",
+              "Pandora", "0.63", "1980",
+              "1986U10", "0.64", "1999",
+              "Thebe", "0.67", "1979");
+    }, function () {
       $rows = jQueryFrame($rows.selector);
       ajaxExecuteBodyTableCheck(assert, $rows,
           "Belinda", "0.62", "1986",
           "Pandora", "0.63", "1980",
           "1986U10", "0.64", "1999",
           "Thebe", "0.67", "1979");
-      done();
 
       $colPeriod.click();
 
-      waitForAjax(function() {
+      waitForAjax(function () {
         $rows = jQueryFrame($rows.selector);
-        return ajaxWaitingBodyTableCheck($rows,
-            "Ananke", "-629.77", "1951",
-            "Praxidike", "625.3", "2000",
-            "Harpalyke", "623.3", "2000",
-            "Caliban", "-579.39", "1997");
-      }, function() {
+        return step == 3 && ajaxWaitingBodyTableCheck($rows,
+                "Ananke", "-629.77", "1951",
+                "Praxidike", "625.3", "2000",
+                "Harpalyke", "623.3", "2000",
+                "Caliban", "-579.39", "1997");
+      }, function () {
         $rows = jQueryFrame($rows.selector);
         ajaxExecuteBodyTableCheck(assert, $rows,
             "Ananke", "-629.77", "1951",
             "Praxidike", "625.3", "2000",
             "Harpalyke", "623.3", "2000",
             "Caliban", "-579.39", "1997");
-        done();
 
         $colPeriod.click();
 
-        waitForAjax(function() {
+        waitForAjax(function () {
           $rows = jQueryFrame($rows.selector);
-          return ajaxWaitingBodyTableCheck($rows,
-              "Belinda", "0.62", "1986",
-              "Pandora", "0.63", "1980",
-              "1986U10", "0.64", "1999",
-              "Thebe", "0.67", "1979");
-        }, function() {
+          return step == 4 && ajaxWaitingBodyTableCheck($rows,
+                  "Belinda", "0.62", "1986",
+                  "Pandora", "0.63", "1980",
+                  "1986U10", "0.64", "1999",
+                  "Thebe", "0.67", "1979");
+        }, function () {
           $rows = jQueryFrame($rows.selector);
           ajaxExecuteBodyTableCheck(assert, $rows,
               "Belinda", "0.62", "1986",
               "Pandora", "0.63", "1980",
               "1986U10", "0.64", "1999",
               "Thebe", "0.67", "1979");
+          step++;
           done();
         });
+        step++;
+        done();
       });
+      step++;
+      done();
     });
+    step++;
+    done();
   });
 });
 
-QUnit.test("Custom Sorting: Year", function(assert) {
+QUnit.test("Custom Sorting: Year", function (assert) {
   assert.expect(13);
   var done = assert.async(4);
+  var step = 1;
 
   var $colYear = jQueryFrame("#page\\:mainForm\\:s2\\:customColumnYear_sorter");
   var $rows = jQueryFrame("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
@@ -745,65 +789,72 @@ QUnit.test("Custom Sorting: Year", funct
     $colYear.click();
   }
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $colYear = jQueryFrame($colYear.selector);
-    return $colYear.find(".fa-angle-up").length == 1;
-  }, function() {
+    return step == 1 && $colYear.find(".fa-angle-up").length == 1;
+  }, function () {
     $colYear = jQueryFrame($colYear.selector);
     assert.equal($colYear.find(".fa-angle-up").length, 1);
-    done();
 
     $leftPaging = jQueryFrame($leftPaging.selector);
     $leftPaging.val("22").trigger("blur");
 
-    waitForAjax(function() {
+    waitForAjax(function () {
       $rows = jQueryFrame($rows.selector);
-      return $rows.eq(0).find(".tobago-sheet-cell span").eq(2).text() == "1789"
+      return step == 2
+          && $rows.eq(0).find(".tobago-sheet-cell span").eq(2).text() == "1789"
           && $rows.eq(1).find(".tobago-sheet-cell span").eq(2).text() == "1846"
           && $rows.eq(2).find(".tobago-sheet-cell span").eq(2).text() == "1846"
           && $rows.eq(3).find(".tobago-sheet-cell span").eq(2).text() == "1848";
-    }, function() {
+    }, function () {
       $rows = jQueryFrame($rows.selector);
       assert.equal($rows.eq(0).find(".tobago-sheet-cell span").eq(2).text(), "1789", "row0col2");
       assert.equal($rows.eq(1).find(".tobago-sheet-cell span").eq(2).text(), "1846", "row1col2");
       assert.equal($rows.eq(2).find(".tobago-sheet-cell span").eq(2).text(), "1846", "row2col2");
       assert.equal($rows.eq(3).find(".tobago-sheet-cell span").eq(2).text(), "1848", "row3col2");
-      done();
 
       $colYear.click();
 
-      waitForAjax(function() {
+      waitForAjax(function () {
         $rows = jQueryFrame($rows.selector);
-        return $rows.eq(0).find(".tobago-sheet-cell span").eq(2).text() == "1989"
+        return step == 3
+            && $rows.eq(0).find(".tobago-sheet-cell span").eq(2).text() == "1989"
             && $rows.eq(1).find(".tobago-sheet-cell span").eq(2).text() == "1989"
             && $rows.eq(2).find(".tobago-sheet-cell span").eq(2).text() == "1989"
             && $rows.eq(3).find(".tobago-sheet-cell span").eq(2).text() == "1986";
-      }, function() {
+      }, function () {
         $rows = jQueryFrame($rows.selector);
         assert.equal($rows.eq(0).find(".tobago-sheet-cell span").eq(2).text(), "1989", "row0col2");
         assert.equal($rows.eq(1).find(".tobago-sheet-cell span").eq(2).text(), "1989", "row1col2");
         assert.equal($rows.eq(2).find(".tobago-sheet-cell span").eq(2).text(), "1989", "row2col2");
         assert.equal($rows.eq(3).find(".tobago-sheet-cell span").eq(2).text(), "1986", "row3col2");
-        done();
 
         $colYear.click();
 
-        waitForAjax(function() {
+        waitForAjax(function () {
           $rows = jQueryFrame($rows.selector);
-          return $rows.eq(0).find(".tobago-sheet-cell span").eq(2).text() == "1789"
+          return step == 4
+              && $rows.eq(0).find(".tobago-sheet-cell span").eq(2).text() == "1789"
               && $rows.eq(1).find(".tobago-sheet-cell span").eq(2).text() == "1846"
               && $rows.eq(2).find(".tobago-sheet-cell span").eq(2).text() == "1846"
               && $rows.eq(3).find(".tobago-sheet-cell span").eq(2).text() == "1848";
-        }, function() {
+        }, function () {
           $rows = jQueryFrame($rows.selector);
           assert.equal($rows.eq(0).find(".tobago-sheet-cell span").eq(2).text(), "1789", "row0col2");
           assert.equal($rows.eq(1).find(".tobago-sheet-cell span").eq(2).text(), "1846", "row1col2");
           assert.equal($rows.eq(2).find(".tobago-sheet-cell span").eq(2).text(), "1846", "row2col2");
           assert.equal($rows.eq(3).find(".tobago-sheet-cell span").eq(2).text(), "1848", "row3col2");
+          step++;
           done();
         });
+        step++;
+        done();
       });
+      step++;
+      done();
     });
+    step++;
+    done();
   });
 });
 
@@ -811,9 +862,10 @@ QUnit.test("Custom Sorting: Year", funct
  * 1. goto line 8
  * 2. goto line 9
  */
-QUnit.test("Custom Sorting: left paging", function(assert) {
+QUnit.test("Custom Sorting: left paging", function (assert) {
   assert.expect(25);
   var done = assert.async(3);
+  var step = 1;
 
   var $colName = jQueryFrame("#page\\:mainForm\\:s2\\:customColumnName_sorter");
   var $rows = jQueryFrame("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
@@ -823,53 +875,56 @@ QUnit.test("Custom Sorting: left paging"
     $colName.click();
   }
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $colName = jQueryFrame($colName.selector);
-    return $colName.find(".fa-angle-up").length == 1;
-  }, function() {
+    return step == 1 && $colName.find(".fa-angle-up").length == 1;
+  }, function () {
     $colName = jQueryFrame($colName.selector);
     assert.equal($colName.find(".fa-angle-up").length, 1);
-    done();
 
     $leftPaging = jQueryFrame($leftPaging.selector);
     $leftPaging.val("8").trigger("blur");
 
-    waitForAjax(function() {
+    waitForAjax(function () {
       $rows = jQueryFrame($rows.selector);
-      return ajaxWaitingBodyTableCheck($rows,
-          "Bianca", "0.43", "1986",
-          "Caliban", "-579.39", "1997",
-          "Callirrhoe", "758.8", "2000",
-          "Callisto", "16.69", "1610");
-    }, function() {
+      return step == 2 && ajaxWaitingBodyTableCheck($rows,
+              "Bianca", "0.43", "1986",
+              "Caliban", "-579.39", "1997",
+              "Callirrhoe", "758.8", "2000",
+              "Callisto", "16.69", "1610");
+    }, function () {
       $rows = jQueryFrame($rows.selector);
       ajaxExecuteBodyTableCheck(assert, $rows,
           "Bianca", "0.43", "1986",
           "Caliban", "-579.39", "1997",
           "Callirrhoe", "758.8", "2000",
           "Callisto", "16.69", "1610");
-      done();
 
       $leftPaging = jQueryFrame($leftPaging.selector);
       $leftPaging.val("9").trigger("blur");
 
-      waitForAjax(function() {
+      waitForAjax(function () {
         $rows = jQueryFrame($rows.selector);
-        return ajaxWaitingBodyTableCheck($rows,
-            "Caliban", "-579.39", "1997",
-            "Callirrhoe", "758.8", "2000",
-            "Callisto", "16.69", "1610",
-            "Calypso", "1.89", "1980");
-      }, function() {
+        return step == 3 && ajaxWaitingBodyTableCheck($rows,
+                "Caliban", "-579.39", "1997",
+                "Callirrhoe", "758.8", "2000",
+                "Callisto", "16.69", "1610",
+                "Calypso", "1.89", "1980");
+      }, function () {
         $rows = jQueryFrame($rows.selector);
         ajaxExecuteBodyTableCheck(assert, $rows,
             "Caliban", "-579.39", "1997",
             "Callirrhoe", "758.8", "2000",
             "Callisto", "16.69", "1610",
             "Calypso", "1.89", "1980");
+        step++;
         done();
       });
+      step++;
+      done();
     });
+    step++;
+    done();
   });
 });
 
@@ -878,9 +933,10 @@ QUnit.test("Custom Sorting: left paging"
  * 2. goto page 16
  * 3. goto page 13
  */
-QUnit.test("Custom Sorting: center paging", function(assert) {
+QUnit.test("Custom Sorting: center paging", function (assert) {
   assert.expect(49);
   var done = assert.async(5);
+  var step = 1;
 
   var $colName = jQueryFrame("#page\\:mainForm\\:s2\\:customColumnName_sorter");
   var $rows = jQueryFrame("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
@@ -891,93 +947,98 @@ QUnit.test("Custom Sorting: center pagin
     $colName.click();
   }
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $colName = jQueryFrame($colName.selector);
-    return $colName.find(".fa-angle-up").length == 1;
-  }, function() {
+    return step == 1 && $colName.find(".fa-angle-up").length == 1;
+  }, function () {
     $colName = jQueryFrame($colName.selector);
     assert.equal($colName.find(".fa-angle-up").length, 1);
-    done();
 
     $leftPaging = jQueryFrame($leftPaging.selector);
     $leftPaging.val("1").trigger("blur");
 
-    waitForAjax(function() {
+    waitForAjax(function () {
       $rows = jQueryFrame($rows.selector);
-      return ajaxWaitingBodyTableCheck($rows,
-          "1986U10", "0.64", "1999",
-          "Adrastea", "0.3", "1979",
-          "Amalthea", "0.5", "1892",
-          "Ananke", "-629.77", "1951");
-    }, function() {
+      return step == 2 && ajaxWaitingBodyTableCheck($rows,
+              "1986U10", "0.64", "1999",
+              "Adrastea", "0.3", "1979",
+              "Amalthea", "0.5", "1892",
+              "Ananke", "-629.77", "1951");
+    }, function () {
       $rows = jQueryFrame($rows.selector);
       ajaxExecuteBodyTableCheck(assert, $rows,
           "1986U10", "0.64", "1999",
           "Adrastea", "0.3", "1979",
           "Amalthea", "0.5", "1892",
           "Ananke", "-629.77", "1951");
-      done();
 
       $centerPaging = jQueryFrame($centerPaging.selector);
       $centerPaging.eq(6).click();
 
-      waitForAjax(function() {
+      waitForAjax(function () {
         $rows = jQueryFrame($rows.selector);
-        return ajaxWaitingBodyTableCheck($rows,
-            "Epimetheus", "0.69", "1980",
-            "Erinome", "728.3", "2000",
-            "Europa", "3.55", "1610",
-            "Galatea", "0.43", "1989");
-      }, function() {
+        return step == 3 && ajaxWaitingBodyTableCheck($rows,
+                "Epimetheus", "0.69", "1980",
+                "Erinome", "728.3", "2000",
+                "Europa", "3.55", "1610",
+                "Galatea", "0.43", "1989");
+      }, function () {
         $rows = jQueryFrame($rows.selector);
         ajaxExecuteBodyTableCheck(assert, $rows,
             "Epimetheus", "0.69", "1980",
             "Erinome", "728.3", "2000",
             "Europa", "3.55", "1610",
             "Galatea", "0.43", "1989");
-        done();
 
         $centerPaging = jQueryFrame($centerPaging.selector);
         $centerPaging.eq(10).click();
 
-        waitForAjax(function() {
+        waitForAjax(function () {
           $rows = jQueryFrame($rows.selector);
-          return ajaxWaitingBodyTableCheck($rows,
-              "Phoebe", "-550.48", "1898",
-              "Pluto", "90800.0", "1930",
-              "Portia", "0.51", "1986",
-              "Praxidike", "625.3", "2000");
-        }, function() {
+          return step == 4 && ajaxWaitingBodyTableCheck($rows,
+                  "Phoebe", "-550.48", "1898",
+                  "Pluto", "90800.0", "1930",
+                  "Portia", "0.51", "1986",
+                  "Praxidike", "625.3", "2000");
+        }, function () {
           $rows = jQueryFrame($rows.selector);
           ajaxExecuteBodyTableCheck(assert, $rows,
               "Phoebe", "-550.48", "1898",
               "Pluto", "90800.0", "1930",
               "Portia", "0.51", "1986",
               "Praxidike", "625.3", "2000");
-          done();
 
           $centerPaging = jQueryFrame($centerPaging.selector);
           $centerPaging.eq(3).click();
 
-          waitForAjax(function() {
+          waitForAjax(function () {
             $rows = jQueryFrame($rows.selector);
-            return ajaxWaitingBodyTableCheck($rows,
-                "Neptune", "60190.0", "1846",
-                "Nereid", "360.13", "1949",
-                "Oberon", "13.46", "1787",
-                "Ophelia", "0.38", "1986");
-          }, function() {
+            return step == 5 && ajaxWaitingBodyTableCheck($rows,
+                    "Neptune", "60190.0", "1846",
+                    "Nereid", "360.13", "1949",
+                    "Oberon", "13.46", "1787",
+                    "Ophelia", "0.38", "1986");
+          }, function () {
             $rows = jQueryFrame($rows.selector);
             ajaxExecuteBodyTableCheck(assert, $rows,
                 "Neptune", "60190.0", "1846",
                 "Nereid", "360.13", "1949",
                 "Oberon", "13.46", "1787",
                 "Ophelia", "0.38", "1986");
+            step++;
             done();
           });
+          step++;
+          done();
         });
+        step++;
+        done();
       });
+      step++;
+      done();
     });
+    step++;
+    done();
   });
 });
 
@@ -988,9 +1049,10 @@ QUnit.test("Custom Sorting: center pagin
  * 4. goto page 21 by pressing arrow-left
  * 5. goto page 14
  */
-QUnit.test("Custom Sorting: right paging", function(assert) {
-  assert.expect(61);
-  var done = assert.async(6);
+QUnit.test("Custom Sorting: right paging", function (assert) {
+  assert.expect(73);
+  var done = assert.async(7);
+  var step = 1;
 
   var $colName = jQueryFrame("#page\\:mainForm\\:s2\\:customColumnName_sorter");
   var $rows = jQueryFrame("#page\\:mainForm\\:s2 .tobago-sheet-bodyTable tbody .tobago-sheet-row");
@@ -1001,133 +1063,140 @@ QUnit.test("Custom Sorting: right paging
     $colName.click();
   }
 
-  waitForAjax(function() {
+  waitForAjax(function () {
     $colName = jQueryFrame($colName.selector);
-    return $colName.find(".fa-angle-up").length == 1;
-  }, function() {
+    return step == 1 && $colName.find(".fa-angle-up").length == 1;
+  }, function () {
     $colName = jQueryFrame($colName.selector);
     assert.equal($colName.find(".fa-angle-up").length, 1);
-    done();
 
     $leftPaging = jQueryFrame($leftPaging.selector);
     $leftPaging.val("22").trigger("blur");
 
-    waitForAjax(function() {
+    waitForAjax(function () {
       $rows = jQueryFrame($rows.selector);
-      return ajaxWaitingBodyTableCheck($rows,
-          "Earth", "365.26", "",
-          "Elara", "259.65", "1905",
-          "Enceladus", "1.37", "1789",
-          "Epimetheus", "0.69", "1980");
-    }, function() {
+      return step == 2 && ajaxWaitingBodyTableCheck($rows,
+              "Earth", "365.26", "",
+              "Elara", "259.65", "1905",
+              "Enceladus", "1.37", "1789",
+              "Epimetheus", "0.69", "1980");
+    }, function () {
       $rows = jQueryFrame($rows.selector);
       ajaxExecuteBodyTableCheck(assert, $rows,
           "Earth", "365.26", "",
           "Elara", "259.65", "1905",
           "Enceladus", "1.37", "1789",
           "Epimetheus", "0.69", "1980");
-      done();
 
       var $rightPagingFirstPage = jQueryFrame($rightPaging.selector).eq(0);
       $rightPagingFirstPage.click();
 
-      waitForAjax(function() {
+      waitForAjax(function () {
         $rows = jQueryFrame($rows.selector);
-        return ajaxWaitingBodyTableCheck($rows,
-            "1986U10", "0.64", "1999",
-            "Adrastea", "0.3", "1979",
-            "Amalthea", "0.5", "1892",
-            "Ananke", "-629.77", "1951");
-      }, function() {
+        return step == 3 && ajaxWaitingBodyTableCheck($rows,
+                "1986U10", "0.64", "1999",
+                "Adrastea", "0.3", "1979",
+                "Amalthea", "0.5", "1892",
+                "Ananke", "-629.77", "1951");
+      }, function () {
         $rows = jQueryFrame($rows.selector);
         ajaxExecuteBodyTableCheck(assert, $rows,
             "1986U10", "0.64", "1999",
             "Adrastea", "0.3", "1979",
             "Amalthea", "0.5", "1892",
             "Ananke", "-629.77", "1951");
-        done();
 
         var $rightPagingRight = jQueryFrame($rightPaging.selector).eq(3);
         $rightPagingRight.click();
 
-        waitForAjax(function() {
+        waitForAjax(function () {
           $rows = jQueryFrame($rows.selector);
-          return ajaxWaitingBodyTableCheck($rows,
-              "Ariel", "2.52", "1851",
-              "Atlas", "0.6", "1980",
-              "Belinda", "0.62", "1986",
-              "Bianca", "0.43", "1986");
-        }, function() {
+          return step == 4 && ajaxWaitingBodyTableCheck($rows,
+                  "Ariel", "2.52", "1851",
+                  "Atlas", "0.6", "1980",
+                  "Belinda", "0.62", "1986",
+                  "Bianca", "0.43", "1986");
+        }, function () {
           $rows = jQueryFrame($rows.selector);
           ajaxExecuteBodyTableCheck(assert, $rows,
               "Ariel", "2.52", "1851",
               "Atlas", "0.6", "1980",
               "Belinda", "0.62", "1986",
               "Bianca", "0.43", "1986");
-          done();
 
           var $rightPagingLastPage = jQueryFrame($rightPaging.selector).eq(4);
           $rightPagingLastPage.click();
 
-          waitForAjax(function() {
+          waitForAjax(function () {
             $rows = jQueryFrame($rows.selector);
-            return ajaxWaitingBodyTableCheck($rows,
-                "Triton", "-5.88", "1846",
-                "Umbriel", "4.14", "1851",
-                "Uranus", "30685.0", "1781",
-                "Venus", "224.7", "");
-          }, function() {
+            return step == 5 && ajaxWaitingBodyTableCheck($rows,
+                    "Triton", "-5.88", "1846",
+                    "Umbriel", "4.14", "1851",
+                    "Uranus", "30685.0", "1781",
+                    "Venus", "224.7", "");
+          }, function () {
             $rows = jQueryFrame($rows.selector);
             ajaxExecuteBodyTableCheck(assert, $rows,
                 "Triton", "-5.88", "1846",
                 "Umbriel", "4.14", "1851",
                 "Uranus", "30685.0", "1781",
                 "Venus", "224.7", "");
-            done();
 
             var $rightPagingLeft = jQueryFrame($rightPaging.selector).eq(1);
             $rightPagingLeft.click();
 
-            waitForAjax(function() {
+            waitForAjax(function () {
               $rows = jQueryFrame($rows.selector);
-              return ajaxWaitingBodyTableCheck($rows,
-                  "Thebe", "0.67", "1979",
-                  "Themisto", "130.02", "2000",
-                  "Titan", "15.95", "1655",
-                  "Titania", "8.71", "1787");
-            }, function() {
+              return step == 6 && ajaxWaitingBodyTableCheck($rows,
+                      "Thebe", "0.67", "1979",
+                      "Themisto", "130.02", "2000",
+                      "Titan", "15.95", "1655",
+                      "Titania", "8.71", "1787");
+            }, function () {
               $rows = jQueryFrame($rows.selector);
               ajaxExecuteBodyTableCheck(assert, $rows,
                   "Thebe", "0.67", "1979",
                   "Themisto", "130.02", "2000",
                   "Titan", "15.95", "1655",
                   "Titania", "8.71", "1787");
-              done();
 
               var $rightPagingJumpToPage = jQueryFrame($rightPaging.selector).find("input");
               $rightPagingJumpToPage.val("14").trigger("blur");
 
-              waitForAjax(function() {
+              waitForAjax(function () {
                 $rows = jQueryFrame($rows.selector);
-                return ajaxWaitingBodyTableCheck($rows,
-                    "Neptune", "60190.0", "1846",
-                    "Nereid", "360.13", "1949",
-                    "Oberon", "13.46", "1787",
-                    "Ophelia", "0.38", "1986");
-              }, function() {
+                return step == 7 && ajaxWaitingBodyTableCheck($rows,
+                        "Neptune", "60190.0", "1846",
+                        "Nereid", "360.13", "1949",
+                        "Oberon", "13.46", "1787",
+                        "Ophelia", "0.38", "1986");
+              }, function () {
                 $rows = jQueryFrame($rows.selector);
                 ajaxExecuteBodyTableCheck(assert, $rows,
                     "Neptune", "60190.0", "1846",
                     "Nereid", "360.13", "1949",
                     "Oberon", "13.46", "1787",
                     "Ophelia", "0.38", "1986");
+                step++;
                 done();
               });
+              step++;
+              done();
             });
+            step++;
+            done();
           });
+          step++;
+          done();
         });
+        step++;
+        done();
       });
+      step++;
+      done();
     });
+    step++;
+    done();
   });
 });