myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [myfaces-tobago] branch master updated: updated FAQ for new TobagoTestTools
Date Thu, 03 May 2018 14:44:32 GMT
This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch master
in repository

The following commit(s) were added to refs/heads/master by this push:
     new b289e1a  updated FAQ for new TobagoTestTools
b289e1a is described below

commit b289e1a0d41af341544ea251c14cce3b41ed6ad2
Author: Henning Noeth <>
AuthorDate: Thu May 3 16:44:20 2018 +0200

    updated FAQ for new TobagoTestTools
 .../main/webapp/content/10-intro/70-faq/faq.xhtml  | 41 ++++++++++++++++------
 1 file changed, 30 insertions(+), 11 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/70-faq/faq.xhtml
index c4eaf70..f1b0355 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/70-faq/faq.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/70-faq/faq.xhtml
@@ -50,7 +50,7 @@
     <p>Tobago runs with Sun RI and with MyFaces.
       Please take a look at the
       <tc:link image="fa-external-link" link=""
-    List.</p>
+      List.</p>
   <tc:section id="tobago-facelets" label="Does Tobago supports Facelets?">
@@ -368,7 +368,7 @@
-  <tc:section id="testQUnit" label="Howto create QUnit tests? (Tobago 3 or higher)">
+  <tc:section id="testQUnit" label="Howto create QUnit tests? (Tobago 4.2.1)">
     Howto create QUnit tests for Tobago Demo 3.0 or higher
@@ -381,25 +381,44 @@
         Add a
-        <tc:link label="QUnit Test" link="" image="fa-external-link"/>
+        <tc:link label="QUnit Test" link="" image="fa-external-link"/>
         to the <code>sample.test.js</code>.
-    <pre><code class="language-java">QUnit.test("Testtitle", function(assert)
+        <pre><code class="language-js">QUnit.test("Testtitle", function(assert)
           <li>The test will run in a different frame.
-            To get an element in the test frame use <code>jQueryFrame()</code>
instead of <code>jQuery()</code>.
+            To get an element in the test frame use <code>jQueryFrameFn()</code>
instead of <code>jQuery()</code>.
+            Please note that <code>jQueryFrameFn()</code> return a function,
so you have to write
+            <code>jQueryVar()</code> instead of <code>jQueryVar</code>
to get the element.<br/>
+            This is very usefull, because elements are outdated after an AJAX request or
a full page reload.
+          </li>
+          <li>Create a TobagoTestTools variable:
+            <pre><code class="language-js">var TTT = new TobagoTestTools(assert);</code></pre>
-          <li>To wait for a submit use <code>jQuery("#page\\:testframe").load()</code>.
+          <li>
+            User actions like a click on a button can be added to an action function:
+            <pre><code class="language-js">TTT.action(function () {
+  $button().click();
-          <li>To wait for an AJAX event use <code>waitForAjax(waitingDone, executeWhenDone)</code>.
-            The function <code>waitingDone</code> must return false if still
waiting and true if the waiting is done.
-            The function <code>executeWhenDone</code> is executed afterwards.
+          <li>If the test have to wait for a response or a specific time use the waitForResponse
+            or the waitMs function:
+            <pre><code class="language-js">TTT.waitForResponse();
+TTT.waitMs(2000); // wait 2000 milliseconds</code></pre>
-          <li>Add the test to QUnitTests.
+          <li>
+            <tc:link label="QUnit Assertions" link="" image="fa-external-link"/>
+            can be added to a asserts function. The first parameter is the number of assertions:
+            <pre><code class="language-js">TTT.asserts(2, function () {
+  assert.equal($input().val(), "Alice");
+  assert.equal($output().text(), "Bob");
+          <li>Start the test with:
+            <pre><code class="language-js">TTT.startTest();</code></pre></li>
         <pre><code class="language-java">@Test
@@ -439,7 +458,7 @@ public void testname() throws UnsupportedEncodingException, InterruptedException
         Adding your server home to a property in the settings.xml of Maven
-            class="language-markup">&lt;;/opt/wlp-developers-runtime-;/;</code></pre>
+                class="language-markup">&lt;;/opt/wlp-developers-runtime-;/;</code></pre>

To stop receiving notification emails like this one, please contact

View raw message