You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2017/06/29 13:10:47 UTC

svn commit: r1800276 - in /myfaces/tobago/trunk/tobago-example/tobago-example-demo/src: main/webapp/content/20-component/030-select/50-selectManyCheckbox/ main/webapp/script/ test/java/org/apache/myfaces/tobago/example/demo/

Author: hnoeth
Date: Thu Jun 29 13:10:47 2017
New Revision: 1800276

URL: http://svn.apache.org/viewvc?rev=1800276&view=rev
Log:
improve demo: fix tests

Modified:
    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/script/tobago-test.js
    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/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=1800276&r1=1800275&r2=1800276&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 Thu Jun 29 13:10:47 2017
@@ -81,7 +81,7 @@ QUnit.test("ajax: click 'Two'", function
 
   waitForAjax(function () {
     $output = jQueryFrame($output.selector);
-    return $output.text() === newOutputValue;
+    return parseInt($output.text()) === newOutputValue;
   }, function () {
     $output = jQueryFrame($output.selector);
     assert.equal($output.text(), newOutputValue);
@@ -107,7 +107,7 @@ QUnit.test("ajax: click 'Three'", functi
 
   waitForAjax(function () {
     $output = jQueryFrame($output.selector);
-    return $output.text() === newOutputValue;
+    return parseInt($output.text()) === newOutputValue;
   }, function () {
     $output = jQueryFrame($output.selector);
     assert.equal($output.text(), newOutputValue);
@@ -133,7 +133,7 @@ QUnit.test("ajax: click 'Two'", function
 
   waitForAjax(function () {
     $output = jQueryFrame($output.selector);
-    return $output.text() === newOutputValue;
+    return parseInt($output.text()) === newOutputValue;
   }, function () {
     $output = jQueryFrame($output.selector);
     assert.equal($output.text(), newOutputValue);

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js?rev=1800276&r1=1800275&r2=1800276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js Thu Jun 29 13:10:47 2017
@@ -29,7 +29,7 @@ function waitForAjax(waitingDone, execut
   var startTime = new Date().getTime();
   maxWait = maxWait ? maxWait : 20000;
   var stillWaiting = true;
-  var interval = setInterval(function() {
+  var interval = setInterval(function () {
     if (new Date().getTime() - startTime < maxWait && stillWaiting) {
       stillWaiting = !waitingDone();
     } else {
@@ -39,6 +39,23 @@ function waitForAjax(waitingDone, execut
   }, 50);
 }
 
+QUnit.test("wait for test", function (assert) {
+  var done = assert.async();
+
+  var startTime = new Date().getTime();
+  var contentWindowName = "";
+  var waitingDone = false;
+  var interval = setInterval(function () {
+    contentWindowName = document.getElementById("page:testframe").contentWindow.name;
+    waitingDone = contentWindowName !== "page:testframe" && contentWindowName !== "ds-tempWindowId";
+    if (new Date().getTime() - startTime >= 20000 || waitingDone) {
+      clearInterval(interval);
+      assert.ok(waitingDone);
+      done();
+    }
+  }, 50);
+});
+
 function getDuplicatedIDs() {
   var duplicatedIDs = [];
   jQueryFrame('[id]').each(function () {

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java?rev=1800276&r1=1800275&r2=1800276&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/QUnitTests.java Thu Jun 29 13:10:47 2017
@@ -293,6 +293,8 @@ public class QUnitTests {
     List<String> ignore = new ArrayList<String>();
     //PhantomJs miscalculate the height of the dropdown box
     ignore.add("content/40-test/3000-sheet/10-sheet-types/sheet-types.xhtml");
+    // See https://issues.apache.org/jira/browse/TOBAGO-1752?focusedCommentId=16068289
+    ignore.add("content/40-test/4000-button+link/button+link.xhtml");
     //ajaxListener doesn't work for <tc:in> events: focus, blur, click, dblclick
     ignore.add("content/40-test/6000-event/event.xhtml");
     return ignore;