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/21 10:27:36 UTC
svn commit: r1787926 [1/2] - in
/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src:
main/java/org/apache/myfaces/tobago/example/demo/
main/resources/org/apache/myfaces/tobago/example/demo/ main/webapp/
main/webapp/content/20-component/030-sel...
Author: lofwyr
Date: Tue Mar 21 10:27:35 2017
New Revision: 1787926
URL: http://svn.apache.org/viewvc?rev=1787926&view=rev
Log:
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]
Added:
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/testAccessAllPages.xhtml
Modified:
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/Demo.xml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/10-selectBooleanCheckbox/selectBooleanCheckbox.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/20-selectOneChoice/selectOneChoice.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/30-selectOneRadio/selectOneRadio.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/40-selectOneListbox/selectOneListbox.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/50-selectManyCheckbox/selectManyCheckbox.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/popup.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-event.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/01-select/tree-select.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/06-validation/00/content-validation.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/06-validation/01/validation-jsr303.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/08-form/10-required/form-required.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/08-form/form.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/00-collapsible-box/collapsible-box.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/20-collapsible-panel/collapsible-panel.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/53-collapsible/30-collapsible-section/collapsible-section.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/4000-button+link/button+link.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java?rev=1787926&r1=1787925&r2=1787926&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TestController.java Tue Mar 21 10:27:35 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/trunk/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/Demo.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/Demo.xml?rev=1787926&r1=1787925&r2=1787926&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/Demo.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/resources/org/apache/myfaces/tobago/example/demo/Demo.xml Tue Mar 21 10:27:35 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>
Modified: myfaces/tobago/trunk/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/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/10-selectBooleanCheckbox/selectBooleanCheckbox.test.js?rev=1787926&r1=1787925&r2=1787926&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/10-selectBooleanCheckbox/selectBooleanCheckbox.test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/10-selectBooleanCheckbox/selectBooleanCheckbox.test.js Tue Mar 21 10:27:35 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/trunk/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/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/20-selectOneChoice/selectOneChoice.test.js?rev=1787926&r1=1787925&r2=1787926&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/20-selectOneChoice/selectOneChoice.test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/20-selectOneChoice/selectOneChoice.test.js Tue Mar 21 10:27:35 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/trunk/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/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/30-selectOneRadio/selectOneRadio.test.js?rev=1787926&r1=1787925&r2=1787926&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/30-selectOneRadio/selectOneRadio.test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/30-selectOneRadio/selectOneRadio.test.js Tue Mar 21 10:27:35 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/trunk/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/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/40-selectOneListbox/selectOneListbox.test.js?rev=1787926&r1=1787925&r2=1787926&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/40-selectOneListbox/selectOneListbox.test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/40-selectOneListbox/selectOneListbox.test.js Tue Mar 21 10:27:35 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/trunk/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/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/50-selectManyCheckbox/selectManyCheckbox.test.js?rev=1787926&r1=1787925&r2=1787926&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/50-selectManyCheckbox/selectManyCheckbox.test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/030-select/50-selectManyCheckbox/selectManyCheckbox.test.js Tue Mar 21 10:27:35 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/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/popup.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/popup.test.js?rev=1787926&r1=1787925&r2=1787926&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/popup.test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/060-popup/popup.test.js Tue Mar 21 10:27:35 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/trunk/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/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.test.js?rev=1787926&r1=1787925&r2=1787926&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/10-sort/sheet-sorting.test.js Tue Mar 21 10:27:35 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();
});
});
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-event.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-event.test.js?rev=1787926&r1=1787925&r2=1787926&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-event.test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/30-event/sheet-event.test.js Tue Mar 21 10:27:35 2017
@@ -15,24 +15,24 @@
* limitations under the License.
*/
-QUnit.test("On click with ajax", function(assert) {
+QUnit.test("On click with ajax", function (assert) {
assert.expect(6);
var done = assert.async(4);
- $oneClickAjax = jQueryFrame("#page\\:mainForm\\:changeExample\\:\\:0");
- $venus = jQueryFrame("#page\\:mainForm\\:s1\\:2\\:sample0");
- $jupiter = jQueryFrame("#page\\:mainForm\\:s1\\:5\\:sample0");
- $saturn = jQueryFrame("#page\\:mainForm\\:s1\\:6\\:sample0");
- $namefield = jQueryFrame("#page\\:mainForm\\:name\\:\\:field");
+ var $oneClickAjax = jQueryFrame("#page\\:mainForm\\:changeExample\\:\\:0");
+ var $venus = jQueryFrame("#page\\:mainForm\\:s1\\:2\\:sample0");
+ var $jupiter = jQueryFrame("#page\\:mainForm\\:s1\\:5\\:sample0");
+ var $saturn = jQueryFrame("#page\\:mainForm\\:s1\\:6\\:sample0");
+ var $namefield = jQueryFrame("#page\\:mainForm\\:name\\:\\:field");
$oneClickAjax.click();
- waitForAjax(function() {
+ waitForAjax(function () {
$venus = jQueryFrame($venus.selector);
$jupiter = jQueryFrame($jupiter.selector);
$saturn = jQueryFrame($saturn.selector);
return $venus.length == 1 && $jupiter.length == 1 && $saturn.length == 1;
- }, function() {
+ }, function () {
$venus = jQueryFrame($venus.selector);
$jupiter = jQueryFrame($jupiter.selector);
$saturn = jQueryFrame($saturn.selector);
@@ -43,30 +43,30 @@ QUnit.test("On click with ajax", functio
$venus.click();
- waitForAjax(function() {
+ waitForAjax(function () {
$namefield = jQueryFrame($namefield.selector);
return $namefield.val() == "Venus";
- }, function() {
+ }, function () {
$namefield = jQueryFrame($namefield.selector);
assert.equal($namefield.val(), "Venus");
done();
$jupiter.click();
- waitForAjax(function() {
+ waitForAjax(function () {
$namefield = jQueryFrame($namefield.selector);
return $namefield.val() == "Jupiter";
- }, function() {
+ }, function () {
$namefield = jQueryFrame($namefield.selector);
assert.equal($namefield.val(), "Jupiter");
done();
$saturn.click();
- waitForAjax(function() {
+ waitForAjax(function () {
$namefield = jQueryFrame($namefield.selector);
return $namefield.val() == "Saturn";
- }, function() {
+ }, function () {
$namefield = jQueryFrame($namefield.selector);
assert.equal($namefield.val(), "Saturn");
done();
@@ -76,25 +76,25 @@ QUnit.test("On click with ajax", functio
});
});
-QUnit.test("On click with full request", function(assert) {
+QUnit.test("On click with full request", function (assert) {
assert.expect(6);
var done = assert.async(4);
var step = 1;
- $oneClickFullRequest = jQueryFrame("#page\\:mainForm\\:changeExample\\:\\:1");
- $venus = jQueryFrame("#page\\:mainForm\\:s1\\:2\\:sample1");
- $jupiter = jQueryFrame("#page\\:mainForm\\:s1\\:5\\:sample1");
- $saturn = jQueryFrame("#page\\:mainForm\\:s1\\:6\\:sample1");
- $namefield = jQueryFrame("#page\\:mainForm\\:name\\:\\:field");
+ var $oneClickFullRequest = jQueryFrame("#page\\:mainForm\\:changeExample\\:\\:1");
+ var $venus = jQueryFrame("#page\\:mainForm\\:s1\\:2\\:sample1");
+ var $jupiter = jQueryFrame("#page\\:mainForm\\:s1\\:5\\:sample1");
+ var $saturn = jQueryFrame("#page\\:mainForm\\:s1\\:6\\:sample1");
+ var $namefield = jQueryFrame("#page\\:mainForm\\:name\\:\\:field");
$oneClickFullRequest.click();
- waitForAjax(function() {
+ waitForAjax(function () {
$venus = jQueryFrame($venus.selector);
$jupiter = jQueryFrame($jupiter.selector);
$saturn = jQueryFrame($saturn.selector);
return $venus.length == 1 && $jupiter.length == 1 && $saturn.length == 1;
- }, function() {
+ }, function () {
if (step == 1) {
$venus = jQueryFrame($venus.selector);
$jupiter = jQueryFrame($jupiter.selector);
@@ -110,48 +110,54 @@ QUnit.test("On click with full request",
step++;
});
- jQuery("#page\\:testframe").load(function() {
+ jQuery("#page\\:testframe").load(function () {
if (step == 2) {
$namefield = jQueryFrame($namefield.selector);
assert.equal($namefield.val(), "Venus");
$jupiter = jQueryFrame($jupiter.selector);
$jupiter.click();
+
+ step++;
+ done();
} else if (step == 3) {
$namefield = jQueryFrame($namefield.selector);
assert.equal($namefield.val(), "Jupiter");
$saturn = jQueryFrame($saturn.selector);
$saturn.click();
+
+ step++;
+ done();
} else if (step == 4) {
$namefield = jQueryFrame($namefield.selector);
assert.equal($namefield.val(), "Saturn");
- }
- step++;
- done();
+ step++;
+ done();
+ }
});
});
-QUnit.test("On double click with full request", function(assert) {
+QUnit.test("On double click with full request", function (assert) {
assert.expect(6);
var done = assert.async(4);
var step = 1;
- $doubleClickFullRequest = jQueryFrame("#page\\:mainForm\\:changeExample\\:\\:2");
- $venus = jQueryFrame("#page\\:mainForm\\:s1\\:2\\:sample2");
- $jupiter = jQueryFrame("#page\\:mainForm\\:s1\\:5\\:sample2");
- $saturn = jQueryFrame("#page\\:mainForm\\:s1\\:6\\:sample2");
- $namefield = jQueryFrame("#page\\:mainForm\\:name\\:\\:field");
+ var $doubleClickFullRequest = jQueryFrame("#page\\:mainForm\\:changeExample\\:\\:2");
+ var $venus = jQueryFrame("#page\\:mainForm\\:s1\\:2\\:sample2");
+ var $jupiter = jQueryFrame("#page\\:mainForm\\:s1\\:5\\:sample2");
+ var $saturn = jQueryFrame("#page\\:mainForm\\:s1\\:6\\:sample2");
+ var $namefield = jQueryFrame("#page\\:mainForm\\:name\\:\\:field");
$doubleClickFullRequest.click();
- waitForAjax(function() {
+ waitForAjax(function () {
$venus = jQueryFrame($venus.selector);
$jupiter = jQueryFrame($jupiter.selector);
$saturn = jQueryFrame($saturn.selector);
return $venus.length == 1 && $jupiter.length == 1 && $saturn.length == 1;
- }, function() {
+ }, function () {
if (step == 1) {
$venus = jQueryFrame($venus.selector);
$jupiter = jQueryFrame($jupiter.selector);
@@ -167,25 +173,31 @@ QUnit.test("On double click with full re
step++;
});
- jQuery("#page\\:testframe").load(function() {
+ jQuery("#page\\:testframe").load(function () {
if (step == 2) {
$namefield = jQueryFrame($namefield.selector);
assert.equal($namefield.val(), "Venus");
$jupiter = jQueryFrame($jupiter.selector);
$jupiter.dblclick();
+
+ step++;
+ done();
} else if (step == 3) {
$namefield = jQueryFrame($namefield.selector);
assert.equal($namefield.val(), "Jupiter");
$saturn = jQueryFrame($saturn.selector);
$saturn.dblclick();
+
+ step++;
+ done();
} else if (step == 4) {
$namefield = jQueryFrame($namefield.selector);
assert.equal($namefield.val(), "Saturn");
- }
- step++;
- done();
+ step++;
+ done();
+ }
});
});