You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2013/08/27 09:20:57 UTC

[1/6] git commit: Correct typo

Updated Branches:
  refs/heads/master 1a1a9771a -> 52f2ff944


Correct typo


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/fe5befa2
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/fe5befa2
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/fe5befa2

Branch: refs/heads/master
Commit: fe5befa272e0499054b9911c40708d0a44195b6a
Parents: 1a1a977
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Aug 27 10:20:23 2013 +0530
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Aug 27 10:20:23 2013 +0530

----------------------------------------------------------------------
 .../main/coffeescript/META-INF/modules/t5/core/pageinit.coffee  | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe5befa2/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee
index 89d9fbf..bd7f9e6 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/pageinit.coffee
@@ -105,13 +105,12 @@ define ["underscore", "./console", "./dom", "./events"],
 
         fn.apply null, initArguments
 
-
         tracker()
 
-    # Loads all specified libraries in order (this includes other the core stack, other stacks, and
+    # Loads all specified libraries in order (this includes the core stack, other stacks, and
     # any free-standing libraries). It then executes the initializations. Once all initializations have
     # completed (which is usually an asynchronous operation, as initializations may require the loading
-    # of further modules), then the `data-page-initialized` attribute of the root HTML element is set to
+    # of further modules), then the `data-page-initialized` attribute of the `<body>` element is set to
     # 'true'.
     #
     # This is the main export of the module; other functions are attached as properties.


[5/6] git commit: Remove @ContentType annotation that prevented RequireJS from operating

Posted by hl...@apache.org.
Remove @ContentType annotation that prevented RequireJS from operating


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/1a14f838
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/1a14f838
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/1a14f838

Branch: refs/heads/master
Commit: 1a14f83817cbac0127daa05b81b9a3efe512c725
Parents: 526b647
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Aug 27 12:34:04 2013 +0530
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Aug 27 12:34:04 2013 +0530

----------------------------------------------------------------------
 .../org/apache/tapestry5/integration/app1/pages/DynamicDemo.java   | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1a14f838/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DynamicDemo.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DynamicDemo.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DynamicDemo.java
index 689ce5e..75e942b 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DynamicDemo.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DynamicDemo.java
@@ -15,13 +15,11 @@
 package org.apache.tapestry5.integration.app1.pages;
 
 import org.apache.tapestry5.Asset;
-import org.apache.tapestry5.annotations.ContentType;
 import org.apache.tapestry5.annotations.Path;
 import org.apache.tapestry5.annotations.Persist;
 import org.apache.tapestry5.annotations.Property;
 import org.apache.tapestry5.ioc.annotations.Inject;
 
-@ContentType("text/xml")
 public class DynamicDemo
 {
     @Property


[5/6] git commit: Remove @ContentType annotation that prevented RequireJS from operating

Posted by hl...@apache.org.
Remove @ContentType annotation that prevented RequireJS from operating


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/1a14f838
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/1a14f838
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/1a14f838

Branch: refs/heads/master
Commit: 1a14f83817cbac0127daa05b81b9a3efe512c725
Parents: 526b647
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Aug 27 12:34:04 2013 +0530
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Aug 27 12:34:04 2013 +0530

----------------------------------------------------------------------
 .../org/apache/tapestry5/integration/app1/pages/DynamicDemo.java   | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1a14f838/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DynamicDemo.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DynamicDemo.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DynamicDemo.java
index 689ce5e..75e942b 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DynamicDemo.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DynamicDemo.java
@@ -15,13 +15,11 @@
 package org.apache.tapestry5.integration.app1.pages;
 
 import org.apache.tapestry5.Asset;
-import org.apache.tapestry5.annotations.ContentType;
 import org.apache.tapestry5.annotations.Path;
 import org.apache.tapestry5.annotations.Persist;
 import org.apache.tapestry5.annotations.Property;
 import org.apache.tapestry5.ioc.annotations.Inject;
 
-@ContentType("text/xml")
 public class DynamicDemo
 {
     @Property


[3/6] git commit: Simplify Checklist component and update for Bootstrap 3

Posted by hl...@apache.org.
Simplify Checklist component and update for Bootstrap 3


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/4a07baf3
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/4a07baf3
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/4a07baf3

Branch: refs/heads/master
Commit: 4a07baf321014c28d5b2bab6e04787d9acb197bc
Parents: 0c92881
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Aug 27 12:33:00 2013 +0530
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Aug 27 12:33:00 2013 +0530

----------------------------------------------------------------------
 .../tapestry5/corelib/components/Checklist.java |  2 +-
 .../tapestry5/corelib/components/Checklist.tml  |  6 ++++--
 tapestry-core/src/test/app1/ChecklistDemo.tml   | 21 +++++++-------------
 3 files changed, 12 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a07baf3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java
index 7e7131c..2f0616a 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java
@@ -210,7 +210,7 @@ public class Checklist extends AbstractField
     }
 
     void beginRender(MarkupWriter writer) {
-        writer.element("div", "class", "checkbox");
+        writer.element("div", "id", getClientId());
     }
 
     void afterRender(MarkupWriter writer) {

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a07baf3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml
index 0be8d97..9cb8a0c 100644
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml
@@ -1,5 +1,7 @@
 <t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
-    <div t:type="loop" source="availableOptions" value="var:currentOption" class="t-checklist-row">
-           <t:delegate to="var:currentOption"/>
+    <div t:type="loop" source="availableOptions" value="var:currentOption">
+        <div class="checkbox">
+            <t:delegate to="var:currentOption"/>
+        </div>
     </div>
 </t:container>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a07baf3/tapestry-core/src/test/app1/ChecklistDemo.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/app1/ChecklistDemo.tml b/tapestry-core/src/test/app1/ChecklistDemo.tml
index 77dfeac..8b142df 100644
--- a/tapestry-core/src/test/app1/ChecklistDemo.tml
+++ b/tapestry-core/src/test/app1/ChecklistDemo.tml
@@ -1,20 +1,13 @@
 <t:border xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
-	<t:form clientValidation="none">
-		<p>
-			<t:errors />
-		</p>
-		<p>
-			<t:label for="selected" />
-			:
-			<t:checklist t:id="selected" validate="required" model="literal:Red,Green,Blue" encoder="encoder" label="Color"/>
+    <t:form clientValidation="none">
+        <t:errors/>
 
-		</p>
+        <t:checklist t:id="selected" validate="required" model="literal:Red,Green,Blue"
+                     encoder="encoder" label="Color"/>
 
-		<p>
-			<t:submit value="literal:Submit" />
-		</p>
-	</t:form>
+        <t:submit class="btn btn-primary" value="literal:Submit"/>
+    </t:form>
 
-	<p>Selected colors: ${sorted}</p>
+    <p>Selected colors: ${sorted}</p>
 
 </t:border>
\ No newline at end of file


[6/6] git commit: Allow test to run outside of suite

Posted by hl...@apache.org.
Allow test to run outside of suite


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/52f2ff94
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/52f2ff94
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/52f2ff94

Branch: refs/heads/master
Commit: 52f2ff944d372eb1af9b2f0c6e7c8633b7908f89
Parents: 1a14f83
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Aug 27 12:49:28 2013 +0530
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Aug 27 12:49:28 2013 +0530

----------------------------------------------------------------------
 .../org/apache/tapestry5/integration/app3/PageCatalogTests.groovy  | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/52f2ff94/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
index 54782c2..a111c75 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
@@ -1,8 +1,10 @@
 package org.apache.tapestry5.integration.app3
 
 import org.apache.tapestry5.integration.TapestryCoreTestCase
+import org.apache.tapestry5.test.TapestryTestConfiguration
 import org.testng.annotations.Test
 
+@TapestryTestConfiguration(webAppFolder = "src/test/app1")
 class PageCatalogTests extends TapestryCoreTestCase
 {
     /** There's not a lot we can do, because some of the pages in the test application have deliberate errors. */


[2/6] git commit: Always render the data-page-initialized attribute

Posted by hl...@apache.org.
Always render the data-page-initialized attribute

Render as "true" when no initializations, or as "true" when initializations are present
Change the test suite to automatically wait for page initialization to complete when the attribute is present


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/0c928819
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/0c928819
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/0c928819

Branch: refs/heads/master
Commit: 0c9288195d4a64f8f65355ee371d5b446560452f
Parents: fe5befa
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Aug 27 11:11:51 2013 +0530
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Aug 27 11:11:51 2013 +0530

----------------------------------------------------------------------
 .../TapestryBeanValidationIntegrationTests.java |  8 ----
 .../internal/services/DocumentLinkerImpl.java   | 18 +++++--
 .../integration/app1/AlertsTests.groovy         |  4 +-
 .../integration/app1/CanceledEventTests.groovy  |  4 --
 .../integration/app1/FormFieldFocusTest.groovy  |  4 --
 .../app1/SubmitUnconditionalTests.groovy        |  4 --
 .../tapestry5/integration/app1/TreeTests.groovy | 26 +++++-----
 .../integration/app3/PageCatalogTests.groovy    |  2 -
 .../integration/appfolder/AppFolderTests.groovy |  2 -
 .../services/DocumentLinkerImplTest.groovy      | 22 ++++-----
 .../tapestry5/integration/app1/AjaxTests.java   | 14 +-----
 .../integration/app1/CoreBehaviorsTests.java    |  2 -
 .../tapestry5/integration/app1/FormTests.java   | 44 -----------------
 .../tapestry5/integration/app1/GridTests.java   |  2 -
 .../integration/app1/PaletteTests.java          |  8 ----
 .../integration/app1/ZoneRefreshTest.java       |  6 +--
 .../tapestry5/integration/app1/ZoneTests.java   | 22 ---------
 .../apache/tapestry5/test/SeleniumTestCase.java | 50 ++++++++++++--------
 18 files changed, 71 insertions(+), 171 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-beanvalidator/src/test/java/org/apache/tapestry5/beanvalidator/integration/TapestryBeanValidationIntegrationTests.java
----------------------------------------------------------------------
diff --git a/tapestry-beanvalidator/src/test/java/org/apache/tapestry5/beanvalidator/integration/TapestryBeanValidationIntegrationTests.java b/tapestry-beanvalidator/src/test/java/org/apache/tapestry5/beanvalidator/integration/TapestryBeanValidationIntegrationTests.java
index a81cc83..8af4f53 100644
--- a/tapestry-beanvalidator/src/test/java/org/apache/tapestry5/beanvalidator/integration/TapestryBeanValidationIntegrationTests.java
+++ b/tapestry-beanvalidator/src/test/java/org/apache/tapestry5/beanvalidator/integration/TapestryBeanValidationIntegrationTests.java
@@ -34,8 +34,6 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
 
         clickAndWait(SUBMIT);
 
-        // waitForPageInitialized();
-
         assertTextPresent("Login Name may not be null");
         assertTextPresent("Secret Password may not be null");
         assertTextPresent("Programming Languages size must be between 2 and 3");
@@ -116,8 +114,6 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
     {
         openLinks("Client Validation Demo");
 
-        waitForPageInitialized();
-
         //@NotNull
         click(SUBMIT);
 
@@ -165,8 +161,6 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
 
         assertTextPresent("Languages size must be between 2 and 3");
 
-        waitForPageInitialized();
-
         assertTextPresent("Null Value must be null");
     }
 
@@ -176,8 +170,6 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
     {
         openLinks("Form Client Validation Demo");
 
-        waitForPageInitialized();
-
         click(SUBMIT);
 
         assertTextPresent("Login Name may not be null");

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
index e53c30f..ae4c773 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008, 2009, 2010, 2011, 2012 The Apache Software Foundation
+// Copyright 2007-2013 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -130,6 +130,18 @@ public class DocumentLinkerImpl implements DocumentLinker
 
     private void addScriptElements(Element root)
     {
+        String rootElementName = root.getName();
+
+        Element body = rootElementName.equals("html") ? findOrCreateElement(root, "body", false) : null;
+
+        // Write the data-page-initialized attribute in for all pages; it will be "true" when the page has no
+        // initializations (which is somewhat rare in Tapestry). When the page has initializations, it will be set to
+        // "true" once those initializations all run.
+        if (body != null)
+        {
+            body.attribute("data-page-initialized", Boolean.toString(!hasScriptsOrInitializations));
+        }
+
         if (!hasScriptsOrInitializations)
         {
             return;
@@ -139,14 +151,12 @@ public class DocumentLinkerImpl implements DocumentLinker
         // future, perhaps configurable, to allow for html and xhtml and perhaps others. Does SVG
         // use stylesheets?
 
-        String rootElementName = root.getName();
-
         if (!rootElementName.equals("html"))
             throw new RuntimeException(String.format("The root element of the rendered document was <%s>, not <html>. A root element of <html> is needed when linking JavaScript and stylesheet resources.", rootElementName));
 
         // TAPESTRY-2364
 
-        addScriptsToEndOfBody(findOrCreateElement(root, "body", false));
+        addScriptsToEndOfBody(body);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
index c35055b..5355944 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
@@ -1,4 +1,4 @@
-// Copyright  2011 The Apache Software Foundation
+// Copyright 2011-2013 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -92,8 +92,6 @@ class AlertsTests extends TapestryCoreTestCase {
         select "css=#ajax select[name=\"duration\"]", "Until Dismissed"
         type "css=#ajax input[name=\"message\"]", "ajax error until"
 
-        waitForPageInitialized()
-
         click "//input[@value='Ajax Update']"
 
         waitForCSSSelectedElementToAppear "$CONTAINER .alert"

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/CanceledEventTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/CanceledEventTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/CanceledEventTests.groovy
index 0dcd844..01ad93a 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/CanceledEventTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/CanceledEventTests.groovy
@@ -10,8 +10,6 @@ class CanceledEventTests extends TapestryCoreTestCase
     {
         openLinks "Canceled Event Demo"
 
-        waitForPageInitialized()
-
         clickAndWait SUBMIT
 
         assertFirstAlert "Form was canceled."
@@ -22,8 +20,6 @@ class CanceledEventTests extends TapestryCoreTestCase
     {
         openLinks "Canceled Event Demo"
 
-        waitForPageInitialized()
-
         clickAndWait "link=Cancel Form"
 
         assertFirstAlert "Form was canceled."

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy
index d61df0f..023152d 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy
@@ -29,8 +29,6 @@ class FormFieldFocusTest extends TapestryCoreTestCase
     {
         openLinks "FormFieldFocus (DEPRECATED) Demo"
 
-        waitForPageInitialized()
-
         sleep 250
 
         assertEquals getEval("window.document.activeElement.value"), "But I got the focus!"
@@ -42,8 +40,6 @@ class FormFieldFocusTest extends TapestryCoreTestCase
     {
         openLinks "OverrideFieldFocus Demo"
 
-        waitForPageInitialized()
-
         sleep 250
 
         assertEquals getEval("window.document.activeElement.value"), "But I got the focus!"

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/SubmitUnconditionalTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/SubmitUnconditionalTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/SubmitUnconditionalTests.groovy
index 085fb7b..d9ac46b 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/SubmitUnconditionalTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/SubmitUnconditionalTests.groovy
@@ -10,8 +10,6 @@ class SubmitUnconditionalTests extends TapestryCoreTestCase {
     void submit_with_unconditional_mode() {
         openLinks "Cancel Demo"
 
-        waitForPageInitialized()
-
         clickAndWait "//input[@value='Abort']"
 
         assertText "message", "onSelectedFromAbort() invoked."
@@ -22,8 +20,6 @@ class SubmitUnconditionalTests extends TapestryCoreTestCase {
 
         openLinks "Cancel Demo"
 
-        waitForPageInitialized()
-
         clickAndWait "link=Abort"
 
         assertText "message", "onSelectedFromAbortLink() invoked."

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/TreeTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/TreeTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/TreeTests.groovy
index 3f16074..d6ae1f1 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/TreeTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/TreeTests.groovy
@@ -1,4 +1,4 @@
-// Copyright 2011, 2012 The Apache Software Foundation
+// Copyright 2011-2013 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -15,17 +15,16 @@
 package org.apache.tapestry5.integration.app1
 
 import org.apache.tapestry5.integration.TapestryCoreTestCase
+import org.apache.tapestry5.test.TapestryTestConfiguration
 import org.testng.annotations.Test
 
-class TreeTests extends TapestryCoreTestCase
-{
+@TapestryTestConfiguration(webAppFolder = "src/test/app1")
+class TreeTests extends TapestryCoreTestCase {
+
     @Test
-    void basics()
-    {
+    void basics() {
         openLinks "Tree Component Demo", "Clear Expansions"
 
-        waitForPageInitialized()
-
         //Click on Games
         click "//div[@class='tree-container test-hook']/ul/li[2]/span[@class='tree-icon']"
 
@@ -38,7 +37,7 @@ class TreeTests extends TapestryCoreTestCase
         //Click on Board Games
         click "//div[@class='tree-container test-hook']/ul/li[2]/ul/li/span[@class='tree-icon']"
 
-        //Assert the leafs are displayed
+        //Assert that the leafs are displayed
         waitForAjaxRequestsToComplete PAGE_LOAD_TIMEOUT
 
         clickAndWait "link=Redraw"
@@ -47,15 +46,16 @@ class TreeTests extends TapestryCoreTestCase
     }
 
     @Test
-    void select_node()
-    {
+    void select_node() {
         openLinks "Tree Component Selection Demo", "Clear All"
 
-        waitForPageInitialized()
+        click "css=.tree-container span.tree-icon"
 
-        click "//span[@class='tree-icon']"
+        // Need a short sleep
+        sleep 250
 
-        waitForCSSSelectedElementToAppear "li.leaf-node > span"
+        // Since there's no simple way to build the CSS select we need.
+        // waitForCSSSelectedElementToAppear "li.leaf-node > span"
 
         assertTextPresent "Oscar", "Gromit", "Max", "Roger", "Cooper"
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
index 7243357..54782c2 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
@@ -11,8 +11,6 @@ class PageCatalogTests extends TapestryCoreTestCase
     {
         open("${baseURL}t5dashboard/pages")
 
-        waitForPageInitialized()
-
         click "link=Clear the cache"
 
         sleep 1000

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/appfolder/AppFolderTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/appfolder/AppFolderTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/appfolder/AppFolderTests.groovy
index d183f03..3810816 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/appfolder/AppFolderTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/appfolder/AppFolderTests.groovy
@@ -33,8 +33,6 @@ class AppFolderTests extends GroovyTapestryCoreTestCase
     {
         openLinks "t5app/", "show index page alert"
 
-        waitForPageInitialized()
-
         assertTextPresent "index page alert"
     }
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy
index f359025..f5e1cca 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy
@@ -108,7 +108,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
 
         check document, '''
 <?xml version="1.0"?>
-<html><body><p>Ready to be updated with scripts.</p><!--MODULE-MANAGER-INITIALIZATION--></body></html>
+<html><body data-page-initialized="false"><p>Ready to be updated with scripts.</p><!--MODULE-MANAGER-INITIALIZATION--></body></html>
 '''
 
         verify()
@@ -129,7 +129,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
 
         check document, '''
 <?xml version="1.0"?>
-<html><head><meta content="Apache Tapestry Framework (version 1.2.3)" name="generator"/></head><body><p>Ready to be marked with generator meta.</p></body></html>
+<html><head><meta content="Apache Tapestry Framework (version 1.2.3)" name="generator"/></head><body data-page-initialized="true"><p>Ready to be marked with generator meta.</p></body></html>
 '''
     }
 
@@ -168,7 +168,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
 
         check document, '''
 <?xml version="1.0"?>
-<html><head><link type="text/css" rel="stylesheet" href="foo.css"/><link media="print" type="text/css" rel="stylesheet" href="bar/baz.css"/></head><body><p>Ready to be updated with styles.</p></body></html>
+<html><head><link type="text/css" rel="stylesheet" href="foo.css"/><link media="print" type="text/css" rel="stylesheet" href="bar/baz.css"/></head><body data-page-initialized="true"><p>Ready to be updated with styles.</p></body></html>
 '''
     }
 
@@ -187,7 +187,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
 
         check document, '''
 <?xml version="1.0"?>
-<html><head><!-- existing head --><link type="text/css" rel="stylesheet" href="foo.css"/></head><body>body content</body></html>
+<html><head><!-- existing head --><link type="text/css" rel="stylesheet" href="foo.css"/></head><body data-page-initialized="true">body content</body></html>
 '''
     }
 
@@ -208,7 +208,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
         linker.updateDocument(document)
 
         check document, '''
-<html><body><p>Ready to be updated with scripts.</p><!--MODULE-MANAGER-INITIALIZATION--></body></html>
+<html><body data-page-initialized="false"><p>Ready to be updated with scripts.</p><!--MODULE-MANAGER-INITIALIZATION--></body></html>
 '''
 
         verify()
@@ -235,7 +235,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
 
         check document, '''
 <?xml version="1.0"?>
-<html><notbody><p>Ready to be updated with scripts.</p></notbody><body><!--MODULE-MANAGER-INITIALIZATION--></body></html>
+<html><notbody><p>Ready to be updated with scripts.</p></notbody><body data-page-initialized="false"><!--MODULE-MANAGER-INITIALIZATION--></body></html>
 '''
 
         verify()
@@ -261,7 +261,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
         linker.updateDocument(document)
 
         check document, '''
-<html><head><meta/><script></script></head><body><!--MODULE-MANAGER-INITIALIZATION--></body></html>
+<html><head><meta/><script></script></head><body data-page-initialized="false"><!--MODULE-MANAGER-INITIALIZATION--></body></html>
 '''
 
         verify()
@@ -286,7 +286,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
 <!--[if IE]>
 <link type="text/css" rel="stylesheet" href="just_ie.css"/>
 <![endif]-->
-</head></html>
+</head><body data-page-initialized="true"></body></html>
 '''
     }
 
@@ -304,7 +304,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
         linker.updateDocument(document)
 
         check document, '''
-<html><head><link type="text/css" rel="stylesheet" href="whatever.css"/><link type="text/css" rel="stylesheet t-ajax-insertion-point" href="insertion-point.css"/></head></html>
+<html><head><link type="text/css" rel="stylesheet" href="whatever.css"/><link type="text/css" rel="stylesheet t-ajax-insertion-point" href="insertion-point.css"/></head><body data-page-initialized="true"></body></html>
 '''
     }
 
@@ -331,7 +331,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
         linker.updateDocument(document)
 
         check document, '''
-<html><head><meta/></head><body><!--MODULE-MANAGER-INITIALIZATION--></body></html>
+<html><head><meta/></head><body data-page-initialized="false"><!--MODULE-MANAGER-INITIALIZATION--></body></html>
 '''
 
         verify()
@@ -359,7 +359,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
         linker.updateDocument(document)
 
         check document, '''
-<html><head><meta/></head><body><!--MODULE-MANAGER-INITIALIZATION--></body></html>
+<html><head><meta/></head><body data-page-initialized="false"><!--MODULE-MANAGER-INITIALIZATION--></body></html>
 '''
 
         verify()

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
index f9b2347..2deafd6 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
@@ -1,4 +1,4 @@
-// Copyright 2009, 2010, 2011, 2012 The Apache Software Foundation
+// Copyright 2009-2013 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -36,8 +36,6 @@ public class AjaxTests extends TapestryCoreTestCase
     {
         openLinks("Form Fragment Demo", "Clear Errors");
 
-        waitForPageInitialized();
-
         type("name", "Fred");
 
         // Put a value into the sub field, then hide it ...
@@ -55,8 +53,6 @@ public class AjaxTests extends TapestryCoreTestCase
         clickAndWait("link=Back");
         clickAndWait("link=Clear Errors");
 
-        waitForPageInitialized();
-
         click("subscribeToEmail");
         click("on");
 
@@ -90,8 +86,6 @@ public class AjaxTests extends TapestryCoreTestCase
     {
         openLinks("Nested Form Fragment Demo");
 
-        waitForPageInitialized();
-
         assertTrue(isVisible("outertext1"));
         assertTrue(isVisible("innertext1"));
         assertTrue(isChecked("innertrigger1"));
@@ -193,8 +187,6 @@ public class AjaxTests extends TapestryCoreTestCase
     {
         openLinks("FormInjector Demo");
 
-        waitForPageInitialized();
-
         assertText("sum", "0.0");
 
         click("link=Add another value");
@@ -205,8 +197,6 @@ public class AjaxTests extends TapestryCoreTestCase
 
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         assertText("sum", "5.1");
 
         click("link=remove");
@@ -241,8 +231,6 @@ public class AjaxTests extends TapestryCoreTestCase
     {
         openLinks("ProgressiveDisplay Demo");
 
-        waitForPageInitialized();
-
         waitForElementToAppear("content1");
         assertText("content1", "Progressive Display content #1.");
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
index f738e90..a4e0404 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
@@ -141,8 +141,6 @@ public class CoreBehaviorsTests extends TapestryCoreTestCase
     {
         openLinks("Expressions in JS Functions Demo");
 
-        waitForPageInitialized();
-
         click("button1");
         waitForCondition("selenium.getValue('target') == 'test1'", PAGE_LOAD_TIMEOUT);
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
index 147b753..4c551b6 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
@@ -81,8 +81,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         assertTextPresent("You must provide a value for Email.");
         // is an overridden validation error message:
         assertTextPresent("Please provide a detailed description of the incident.");
@@ -93,8 +91,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         assertTextPresent("[false]");
         assertTextPresent("You must provide an integer value for Hours.");
 
@@ -104,8 +100,6 @@ public class FormTests extends TapestryCoreTestCase
         click("//input[@id='urgent']");
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         assertTextPresent("[foo@bar.baz]");
         assertTextPresent("[Show me the money!]");
         assertTextPresent("[true]");
@@ -119,8 +113,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait("link=Reset Page State");
 
-        waitForPageInitialized();
-
         // Notice: click, not click and wait.
 
         click(SUBMIT);
@@ -152,8 +144,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait("link=Clear Data");
 
-        waitForPageInitialized();
-
         clickAndWait("//input[@value='Cancel']");
 
         assertText("message", "Form was cancelled.");
@@ -175,8 +165,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Regexp Demo");
 
-        waitForPageInitialized();
-
         String update = SUBMIT;
 
         type("zipCode", "abc");
@@ -203,8 +191,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("DateField Demo", "Reset Page State", "english");
 
-        waitForPageInitialized();
-
         type("birthday", "24 dec 1966");
         type("asteroidImpact", "05/28/2046");
 
@@ -218,8 +204,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait("link=french");
 
-        waitForPageInitialized();
-
         click("css=.x-birthday .btn");
 
         sleep(AJAX_WAIT_TIME);
@@ -233,8 +217,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("DateField Demo", "Reset Page State", "english");
 
-        waitForPageInitialized();
-
         type("asteroidImpact", "<script>alert('T5 is great'); </script>");
 
         click("css=.x-impact .btn");
@@ -250,8 +232,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("DateField Demo", "Reset Page State", "english");
 
-        waitForPageInitialized();
-
         //start with a known date...
         type("asteroidImpact", "05/28/2035");
 
@@ -342,8 +322,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("DateField Demo", "Reset Page State", "english");
 
-        waitForPageInitialized();
-
         type("asteroidImpact", "05/28/2046");
 
         click("css=.x-impact .btn");
@@ -595,8 +573,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Client Format Validation");
 
-        waitForPageInitialized();
-
         type("amount", "abc");
         type("quantity", "abc");
 
@@ -703,8 +679,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("LinkSubmit Without Validator Demo");
 
-        waitForPageInitialized();
-
         type("searchField", "Anders Haraldsson");
 
         clickAndWait("//a[@id='searchLink']");
@@ -720,8 +694,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Client-Side Numeric Validation", "Reset Page State", "Setup Values");
 
-        waitForPageInitialized();
-
         assertText("outputLongValue", "1000");
         assertText("outputDoubleValue", "1234.67");
 
@@ -760,8 +732,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait("link=Setup Values");
 
-        waitForPageInitialized();
-
         type("longValue", "4000.");
         click(SUBMIT);
 
@@ -779,8 +749,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Form Zone Demo");
 
-        waitForPageInitialized();
-
         type("longValue", "alpha");
 
         click(SUBMIT);
@@ -811,8 +779,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Validation Constraints From Messages");
 
-        waitForPageInitialized();
-
         click(SUBMIT);
 
         assertTextPresent("You must provide a value for Name.");
@@ -841,8 +807,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("LinkSubmit Demo");
 
-        waitForPageInitialized();
-
         waitForElementToAppear("fred");
 
         click("//a[@id='fred']");
@@ -859,8 +823,6 @@ public class FormTests extends TapestryCoreTestCase
 
         type("name", "Betty");
 
-        waitForPageInitialized();
-
         clickAndWait("link=Barney");
 
         assertText("name-value", "Betty");
@@ -998,8 +960,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Cancel Demo");
 
-        waitForPageInitialized();
-
         clickAndWait("//input[@value='Cancel Form']");
 
         assertText("message", "Form was canceled.");
@@ -1010,8 +970,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Cancel Demo");
 
-        waitForPageInitialized();
-
         clickAndWait("link=Cancel Form");
 
         assertText("message", "Form was canceled.");
@@ -1024,8 +982,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         assertTextPresent("You must provide a value for Color.");
 
         select("color", "label=Green");

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
index e12b6d7..a4084b0 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
@@ -250,8 +250,6 @@ public class GridTests extends TapestryCoreTestCase
     {
         openLinks("In-Place Grid Demo");
 
-        waitForPageInitialized();
-
         String timestamp = getText("lastupdate");
 
         click("link=2");

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/PaletteTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/PaletteTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/PaletteTests.java
index 03d87fc..88af192 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/PaletteTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/PaletteTests.java
@@ -41,8 +41,6 @@ public class PaletteTests extends TapestryCoreTestCase
     {
         openLinks("Palette Demo", "Reset Page State");
 
-        waitForPageInitialized();
-
         assertText("css=.palette-available .palette-title",
                 "Languages Offered");
         assertText("css=.palette-selected .palette-title",
@@ -60,8 +58,6 @@ public class PaletteTests extends TapestryCoreTestCase
 
         assertText("id=selected-languages", "[HASKELL, JAVASCRIPT]");
 
-        waitForPageInitialized();
-
         addSelection(SELECTED_OPTIONS, "label=Javascript");
 
         click(DESELECT_BUTTON);
@@ -85,8 +81,6 @@ public class PaletteTests extends TapestryCoreTestCase
 
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         addSelection(SELECTED_OPTIONS, "label=Ruby");
 
         for (int i = 0; i < 6; i++)
@@ -130,8 +124,6 @@ public class PaletteTests extends TapestryCoreTestCase
     {
         openLinks("Palette Demo", "Reset Page State");
 
-        waitForPageInitialized();
-
         click(SUBMIT);
 
         assertTextPresent("You must provide a value for Languages.");

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java
index fa8e91b..d288112 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java
@@ -1,4 +1,4 @@
-// Copyright 2011, 2012 The Apache Software Foundation
+// Copyright 2011-2013 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -26,8 +26,6 @@ public class ZoneRefreshTest extends TapestryCoreTestCase
     {
         openBaseURL();
 
-        waitForPageInitialized();
-
         clickAndWait("link=Zone Refresh With Event Handler Returning Void");
 
         sleep(AJAX_WAIT_TIME);
@@ -40,8 +38,6 @@ public class ZoneRefreshTest extends TapestryCoreTestCase
     {
         openBaseURL();
 
-        waitForPageInitialized();
-
         clickAndWait("link=Zone Refresh With Event Handler Returning Zone");
 
         sleep(AJAX_WAIT_TIME);

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
index 3b2fcf5..b31cd23 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
@@ -34,8 +34,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Select Zone Demo");
 
-        waitForPageInitialized();
-
         select("carMaker", "Bmw");
 
         sleep(AJAX_WAIT_TIME);
@@ -50,8 +48,6 @@ public class ZoneTests extends TapestryCoreTestCase
 
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         assertTextPresent("Car Maker: BMW");
 
         assertTextPresent("Car Model: 7 Series");
@@ -74,8 +70,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Zone Demo");
 
-        waitForPageInitialized();
-
         assertTextPresent("No name has been selected.");
 
         click("link=Select \"Mr. <Roboto>\"");
@@ -108,8 +102,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Multiple Zone Update Demo");
 
-        waitForPageInitialized();
-
         String now = getText("now");
 
         assertText("wilma", "Wilma Flintstone");
@@ -167,8 +159,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Zone Demo");
 
-        waitForPageInitialized();
-
         assertText("zone-update-message", "");
 
         click("link=Direct JSON response");
@@ -188,8 +178,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("LinkSubmit inside Zone");
 
-        waitForPageInitialized();
-
         String now = getText("now");
 
         waitForElementToAppear("mySubmit");
@@ -227,8 +215,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Zone/Form Update Demo");
 
-        waitForPageInitialized();
-
         click("link=Update the form");
 
         waitForElementToAppear("updated");
@@ -248,8 +234,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("MultiZone Update inside a Form");
 
-        waitForPageInitialized();
-
         select("selectValue1", "3 pre ajax");
 
         waitForElementToAppear("select2ValueZone");
@@ -310,12 +294,8 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Zone Demo");
 
-        waitForPageInitialized();
-
         click("link=Select \"CSS Injection\"");
 
-        waitForPageInitialized();
-
         // First check that the update arrived
 
         waitForElementToAppear("demo-aip");
@@ -337,8 +317,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Zone Demo");
 
-        waitForPageInitialized();
-
         assertText("zone-update-message", "");
 
         click("link=Update zone with empty body");

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
----------------------------------------------------------------------
diff --git a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
index bdc88d4..fa748cb 100644
--- a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
+++ b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
@@ -1137,9 +1137,39 @@ public abstract class SeleniumTestCase extends Assert implements Selenium
         selenium.waitForFrameToLoad(frameAddress, timeout);
     }
 
+    /**
+     * Waits for page  to load, then waits for initialization to finish, which is recognized by the {@code data-page-initialized} attribute
+     * being set to true on the body element. Polls at increasing intervals.
+     */
     public void waitForPageToLoad(String timeout)
     {
         selenium.waitForPageToLoad(timeout);
+
+        // In a limited number of cases, a "page" is an container error page or raw HTML content
+        // that does not include the body element and data-page-initialized element. In those cases,
+        // there will never be page initialization in the Tapestry sense and we return immediately.
+
+        if (!isElementPresent("css=body[data-page-initialized]")) { return; }
+
+        int totalTime = 0;
+        int sleepTime = 20;
+
+        while (true) {
+            if (isElementPresent("css=body[data-page-initialized='true']"))
+            {
+                return;
+            }
+
+            if (totalTime > 10000) {
+                reportAndThrowAssertionError("Page did not finish initializing.");
+            }
+
+            sleep(sleepTime);
+
+            totalTime += sleepTime;
+
+            sleepTime *= 2;
+        }
     }
 
     public void waitForPopUp(String windowID, String timeout)
@@ -1501,24 +1531,4 @@ public abstract class SeleniumTestCase extends Assert implements Selenium
         return selenium.getCssCount(str);
     }
 
-    /**
-     * Waits for page initialization to finish, which is recognized by the {@code data-page-initialized} attribute
-     * being added to the HTML element. Polls at 20ms intervals for 200ms.
-     *
-     * @since 5.4
-     */
-    protected final void waitForPageInitialized()
-    {
-        for (int i = 0; i < 10; i++)
-        {
-            if (isElementPresent("css=body[data-page-initialized]"))
-            {
-                return;
-            }
-
-            sleep(20);
-        }
-
-        reportAndThrowAssertionError("Page did not finish initializing.");
-    }
 }


[6/6] git commit: Allow test to run outside of suite

Posted by hl...@apache.org.
Allow test to run outside of suite


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/52f2ff94
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/52f2ff94
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/52f2ff94

Branch: refs/heads/master
Commit: 52f2ff944d372eb1af9b2f0c6e7c8633b7908f89
Parents: 1a14f83
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Aug 27 12:49:28 2013 +0530
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Aug 27 12:49:28 2013 +0530

----------------------------------------------------------------------
 .../org/apache/tapestry5/integration/app3/PageCatalogTests.groovy  | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/52f2ff94/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
index 54782c2..a111c75 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
@@ -1,8 +1,10 @@
 package org.apache.tapestry5.integration.app3
 
 import org.apache.tapestry5.integration.TapestryCoreTestCase
+import org.apache.tapestry5.test.TapestryTestConfiguration
 import org.testng.annotations.Test
 
+@TapestryTestConfiguration(webAppFolder = "src/test/app1")
 class PageCatalogTests extends TapestryCoreTestCase
 {
     /** There's not a lot we can do, because some of the pages in the test application have deliberate errors. */


[4/6] git commit: Allow DynamicTest to launch independently

Posted by hl...@apache.org.
Allow DynamicTest to launch independently


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/526b647a
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/526b647a
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/526b647a

Branch: refs/heads/master
Commit: 526b647a2b20f9c2ff6b0579bc12eb1b88f7176c
Parents: 4a07baf
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Aug 27 12:33:28 2013 +0530
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Aug 27 12:33:28 2013 +0530

----------------------------------------------------------------------
 .../org/apache/tapestry5/integration/app1/DynamicTest.groovy       | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/526b647a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/DynamicTest.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/DynamicTest.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/DynamicTest.groovy
index f18d20a..e4d11d8 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/DynamicTest.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/DynamicTest.groovy
@@ -15,8 +15,10 @@
 package org.apache.tapestry5.integration.app1
 
 import org.apache.tapestry5.integration.TapestryCoreTestCase
+import org.apache.tapestry5.test.TapestryTestConfiguration
 import org.testng.annotations.Test
 
+@TapestryTestConfiguration(webAppFolder = "src/test/app1")
 class DynamicTest extends TapestryCoreTestCase
 {
     void clickThru(link) {


[4/6] git commit: Allow DynamicTest to launch independently

Posted by hl...@apache.org.
Allow DynamicTest to launch independently


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/526b647a
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/526b647a
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/526b647a

Branch: refs/heads/master
Commit: 526b647a2b20f9c2ff6b0579bc12eb1b88f7176c
Parents: 4a07baf
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Aug 27 12:33:28 2013 +0530
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Aug 27 12:33:28 2013 +0530

----------------------------------------------------------------------
 .../org/apache/tapestry5/integration/app1/DynamicTest.groovy       | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/526b647a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/DynamicTest.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/DynamicTest.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/DynamicTest.groovy
index f18d20a..e4d11d8 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/DynamicTest.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/DynamicTest.groovy
@@ -15,8 +15,10 @@
 package org.apache.tapestry5.integration.app1
 
 import org.apache.tapestry5.integration.TapestryCoreTestCase
+import org.apache.tapestry5.test.TapestryTestConfiguration
 import org.testng.annotations.Test
 
+@TapestryTestConfiguration(webAppFolder = "src/test/app1")
 class DynamicTest extends TapestryCoreTestCase
 {
     void clickThru(link) {


[2/6] git commit: Always render the data-page-initialized attribute

Posted by hl...@apache.org.
Always render the data-page-initialized attribute

Render as "true" when no initializations, or as "true" when initializations are present
Change the test suite to automatically wait for page initialization to complete when the attribute is present


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/0c928819
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/0c928819
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/0c928819

Branch: refs/heads/master
Commit: 0c9288195d4a64f8f65355ee371d5b446560452f
Parents: fe5befa
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Aug 27 11:11:51 2013 +0530
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Aug 27 11:11:51 2013 +0530

----------------------------------------------------------------------
 .../TapestryBeanValidationIntegrationTests.java |  8 ----
 .../internal/services/DocumentLinkerImpl.java   | 18 +++++--
 .../integration/app1/AlertsTests.groovy         |  4 +-
 .../integration/app1/CanceledEventTests.groovy  |  4 --
 .../integration/app1/FormFieldFocusTest.groovy  |  4 --
 .../app1/SubmitUnconditionalTests.groovy        |  4 --
 .../tapestry5/integration/app1/TreeTests.groovy | 26 +++++-----
 .../integration/app3/PageCatalogTests.groovy    |  2 -
 .../integration/appfolder/AppFolderTests.groovy |  2 -
 .../services/DocumentLinkerImplTest.groovy      | 22 ++++-----
 .../tapestry5/integration/app1/AjaxTests.java   | 14 +-----
 .../integration/app1/CoreBehaviorsTests.java    |  2 -
 .../tapestry5/integration/app1/FormTests.java   | 44 -----------------
 .../tapestry5/integration/app1/GridTests.java   |  2 -
 .../integration/app1/PaletteTests.java          |  8 ----
 .../integration/app1/ZoneRefreshTest.java       |  6 +--
 .../tapestry5/integration/app1/ZoneTests.java   | 22 ---------
 .../apache/tapestry5/test/SeleniumTestCase.java | 50 ++++++++++++--------
 18 files changed, 71 insertions(+), 171 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-beanvalidator/src/test/java/org/apache/tapestry5/beanvalidator/integration/TapestryBeanValidationIntegrationTests.java
----------------------------------------------------------------------
diff --git a/tapestry-beanvalidator/src/test/java/org/apache/tapestry5/beanvalidator/integration/TapestryBeanValidationIntegrationTests.java b/tapestry-beanvalidator/src/test/java/org/apache/tapestry5/beanvalidator/integration/TapestryBeanValidationIntegrationTests.java
index a81cc83..8af4f53 100644
--- a/tapestry-beanvalidator/src/test/java/org/apache/tapestry5/beanvalidator/integration/TapestryBeanValidationIntegrationTests.java
+++ b/tapestry-beanvalidator/src/test/java/org/apache/tapestry5/beanvalidator/integration/TapestryBeanValidationIntegrationTests.java
@@ -34,8 +34,6 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
 
         clickAndWait(SUBMIT);
 
-        // waitForPageInitialized();
-
         assertTextPresent("Login Name may not be null");
         assertTextPresent("Secret Password may not be null");
         assertTextPresent("Programming Languages size must be between 2 and 3");
@@ -116,8 +114,6 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
     {
         openLinks("Client Validation Demo");
 
-        waitForPageInitialized();
-
         //@NotNull
         click(SUBMIT);
 
@@ -165,8 +161,6 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
 
         assertTextPresent("Languages size must be between 2 and 3");
 
-        waitForPageInitialized();
-
         assertTextPresent("Null Value must be null");
     }
 
@@ -176,8 +170,6 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
     {
         openLinks("Form Client Validation Demo");
 
-        waitForPageInitialized();
-
         click(SUBMIT);
 
         assertTextPresent("Login Name may not be null");

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
index e53c30f..ae4c773 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DocumentLinkerImpl.java
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008, 2009, 2010, 2011, 2012 The Apache Software Foundation
+// Copyright 2007-2013 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -130,6 +130,18 @@ public class DocumentLinkerImpl implements DocumentLinker
 
     private void addScriptElements(Element root)
     {
+        String rootElementName = root.getName();
+
+        Element body = rootElementName.equals("html") ? findOrCreateElement(root, "body", false) : null;
+
+        // Write the data-page-initialized attribute in for all pages; it will be "true" when the page has no
+        // initializations (which is somewhat rare in Tapestry). When the page has initializations, it will be set to
+        // "true" once those initializations all run.
+        if (body != null)
+        {
+            body.attribute("data-page-initialized", Boolean.toString(!hasScriptsOrInitializations));
+        }
+
         if (!hasScriptsOrInitializations)
         {
             return;
@@ -139,14 +151,12 @@ public class DocumentLinkerImpl implements DocumentLinker
         // future, perhaps configurable, to allow for html and xhtml and perhaps others. Does SVG
         // use stylesheets?
 
-        String rootElementName = root.getName();
-
         if (!rootElementName.equals("html"))
             throw new RuntimeException(String.format("The root element of the rendered document was <%s>, not <html>. A root element of <html> is needed when linking JavaScript and stylesheet resources.", rootElementName));
 
         // TAPESTRY-2364
 
-        addScriptsToEndOfBody(findOrCreateElement(root, "body", false));
+        addScriptsToEndOfBody(body);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
index c35055b..5355944 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
@@ -1,4 +1,4 @@
-// Copyright  2011 The Apache Software Foundation
+// Copyright 2011-2013 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -92,8 +92,6 @@ class AlertsTests extends TapestryCoreTestCase {
         select "css=#ajax select[name=\"duration\"]", "Until Dismissed"
         type "css=#ajax input[name=\"message\"]", "ajax error until"
 
-        waitForPageInitialized()
-
         click "//input[@value='Ajax Update']"
 
         waitForCSSSelectedElementToAppear "$CONTAINER .alert"

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/CanceledEventTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/CanceledEventTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/CanceledEventTests.groovy
index 0dcd844..01ad93a 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/CanceledEventTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/CanceledEventTests.groovy
@@ -10,8 +10,6 @@ class CanceledEventTests extends TapestryCoreTestCase
     {
         openLinks "Canceled Event Demo"
 
-        waitForPageInitialized()
-
         clickAndWait SUBMIT
 
         assertFirstAlert "Form was canceled."
@@ -22,8 +20,6 @@ class CanceledEventTests extends TapestryCoreTestCase
     {
         openLinks "Canceled Event Demo"
 
-        waitForPageInitialized()
-
         clickAndWait "link=Cancel Form"
 
         assertFirstAlert "Form was canceled."

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy
index d61df0f..023152d 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/FormFieldFocusTest.groovy
@@ -29,8 +29,6 @@ class FormFieldFocusTest extends TapestryCoreTestCase
     {
         openLinks "FormFieldFocus (DEPRECATED) Demo"
 
-        waitForPageInitialized()
-
         sleep 250
 
         assertEquals getEval("window.document.activeElement.value"), "But I got the focus!"
@@ -42,8 +40,6 @@ class FormFieldFocusTest extends TapestryCoreTestCase
     {
         openLinks "OverrideFieldFocus Demo"
 
-        waitForPageInitialized()
-
         sleep 250
 
         assertEquals getEval("window.document.activeElement.value"), "But I got the focus!"

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/SubmitUnconditionalTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/SubmitUnconditionalTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/SubmitUnconditionalTests.groovy
index 085fb7b..d9ac46b 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/SubmitUnconditionalTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/SubmitUnconditionalTests.groovy
@@ -10,8 +10,6 @@ class SubmitUnconditionalTests extends TapestryCoreTestCase {
     void submit_with_unconditional_mode() {
         openLinks "Cancel Demo"
 
-        waitForPageInitialized()
-
         clickAndWait "//input[@value='Abort']"
 
         assertText "message", "onSelectedFromAbort() invoked."
@@ -22,8 +20,6 @@ class SubmitUnconditionalTests extends TapestryCoreTestCase {
 
         openLinks "Cancel Demo"
 
-        waitForPageInitialized()
-
         clickAndWait "link=Abort"
 
         assertText "message", "onSelectedFromAbortLink() invoked."

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/TreeTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/TreeTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/TreeTests.groovy
index 3f16074..d6ae1f1 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/TreeTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/TreeTests.groovy
@@ -1,4 +1,4 @@
-// Copyright 2011, 2012 The Apache Software Foundation
+// Copyright 2011-2013 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -15,17 +15,16 @@
 package org.apache.tapestry5.integration.app1
 
 import org.apache.tapestry5.integration.TapestryCoreTestCase
+import org.apache.tapestry5.test.TapestryTestConfiguration
 import org.testng.annotations.Test
 
-class TreeTests extends TapestryCoreTestCase
-{
+@TapestryTestConfiguration(webAppFolder = "src/test/app1")
+class TreeTests extends TapestryCoreTestCase {
+
     @Test
-    void basics()
-    {
+    void basics() {
         openLinks "Tree Component Demo", "Clear Expansions"
 
-        waitForPageInitialized()
-
         //Click on Games
         click "//div[@class='tree-container test-hook']/ul/li[2]/span[@class='tree-icon']"
 
@@ -38,7 +37,7 @@ class TreeTests extends TapestryCoreTestCase
         //Click on Board Games
         click "//div[@class='tree-container test-hook']/ul/li[2]/ul/li/span[@class='tree-icon']"
 
-        //Assert the leafs are displayed
+        //Assert that the leafs are displayed
         waitForAjaxRequestsToComplete PAGE_LOAD_TIMEOUT
 
         clickAndWait "link=Redraw"
@@ -47,15 +46,16 @@ class TreeTests extends TapestryCoreTestCase
     }
 
     @Test
-    void select_node()
-    {
+    void select_node() {
         openLinks "Tree Component Selection Demo", "Clear All"
 
-        waitForPageInitialized()
+        click "css=.tree-container span.tree-icon"
 
-        click "//span[@class='tree-icon']"
+        // Need a short sleep
+        sleep 250
 
-        waitForCSSSelectedElementToAppear "li.leaf-node > span"
+        // Since there's no simple way to build the CSS select we need.
+        // waitForCSSSelectedElementToAppear "li.leaf-node > span"
 
         assertTextPresent "Oscar", "Gromit", "Max", "Roger", "Cooper"
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
index 7243357..54782c2 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
@@ -11,8 +11,6 @@ class PageCatalogTests extends TapestryCoreTestCase
     {
         open("${baseURL}t5dashboard/pages")
 
-        waitForPageInitialized()
-
         click "link=Clear the cache"
 
         sleep 1000

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/appfolder/AppFolderTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/appfolder/AppFolderTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/appfolder/AppFolderTests.groovy
index d183f03..3810816 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/appfolder/AppFolderTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/appfolder/AppFolderTests.groovy
@@ -33,8 +33,6 @@ class AppFolderTests extends GroovyTapestryCoreTestCase
     {
         openLinks "t5app/", "show index page alert"
 
-        waitForPageInitialized()
-
         assertTextPresent "index page alert"
     }
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy
index f359025..f5e1cca 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/internal/services/DocumentLinkerImplTest.groovy
@@ -108,7 +108,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
 
         check document, '''
 <?xml version="1.0"?>
-<html><body><p>Ready to be updated with scripts.</p><!--MODULE-MANAGER-INITIALIZATION--></body></html>
+<html><body data-page-initialized="false"><p>Ready to be updated with scripts.</p><!--MODULE-MANAGER-INITIALIZATION--></body></html>
 '''
 
         verify()
@@ -129,7 +129,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
 
         check document, '''
 <?xml version="1.0"?>
-<html><head><meta content="Apache Tapestry Framework (version 1.2.3)" name="generator"/></head><body><p>Ready to be marked with generator meta.</p></body></html>
+<html><head><meta content="Apache Tapestry Framework (version 1.2.3)" name="generator"/></head><body data-page-initialized="true"><p>Ready to be marked with generator meta.</p></body></html>
 '''
     }
 
@@ -168,7 +168,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
 
         check document, '''
 <?xml version="1.0"?>
-<html><head><link type="text/css" rel="stylesheet" href="foo.css"/><link media="print" type="text/css" rel="stylesheet" href="bar/baz.css"/></head><body><p>Ready to be updated with styles.</p></body></html>
+<html><head><link type="text/css" rel="stylesheet" href="foo.css"/><link media="print" type="text/css" rel="stylesheet" href="bar/baz.css"/></head><body data-page-initialized="true"><p>Ready to be updated with styles.</p></body></html>
 '''
     }
 
@@ -187,7 +187,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
 
         check document, '''
 <?xml version="1.0"?>
-<html><head><!-- existing head --><link type="text/css" rel="stylesheet" href="foo.css"/></head><body>body content</body></html>
+<html><head><!-- existing head --><link type="text/css" rel="stylesheet" href="foo.css"/></head><body data-page-initialized="true">body content</body></html>
 '''
     }
 
@@ -208,7 +208,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
         linker.updateDocument(document)
 
         check document, '''
-<html><body><p>Ready to be updated with scripts.</p><!--MODULE-MANAGER-INITIALIZATION--></body></html>
+<html><body data-page-initialized="false"><p>Ready to be updated with scripts.</p><!--MODULE-MANAGER-INITIALIZATION--></body></html>
 '''
 
         verify()
@@ -235,7 +235,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
 
         check document, '''
 <?xml version="1.0"?>
-<html><notbody><p>Ready to be updated with scripts.</p></notbody><body><!--MODULE-MANAGER-INITIALIZATION--></body></html>
+<html><notbody><p>Ready to be updated with scripts.</p></notbody><body data-page-initialized="false"><!--MODULE-MANAGER-INITIALIZATION--></body></html>
 '''
 
         verify()
@@ -261,7 +261,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
         linker.updateDocument(document)
 
         check document, '''
-<html><head><meta/><script></script></head><body><!--MODULE-MANAGER-INITIALIZATION--></body></html>
+<html><head><meta/><script></script></head><body data-page-initialized="false"><!--MODULE-MANAGER-INITIALIZATION--></body></html>
 '''
 
         verify()
@@ -286,7 +286,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
 <!--[if IE]>
 <link type="text/css" rel="stylesheet" href="just_ie.css"/>
 <![endif]-->
-</head></html>
+</head><body data-page-initialized="true"></body></html>
 '''
     }
 
@@ -304,7 +304,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
         linker.updateDocument(document)
 
         check document, '''
-<html><head><link type="text/css" rel="stylesheet" href="whatever.css"/><link type="text/css" rel="stylesheet t-ajax-insertion-point" href="insertion-point.css"/></head></html>
+<html><head><link type="text/css" rel="stylesheet" href="whatever.css"/><link type="text/css" rel="stylesheet t-ajax-insertion-point" href="insertion-point.css"/></head><body data-page-initialized="true"></body></html>
 '''
     }
 
@@ -331,7 +331,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
         linker.updateDocument(document)
 
         check document, '''
-<html><head><meta/></head><body><!--MODULE-MANAGER-INITIALIZATION--></body></html>
+<html><head><meta/></head><body data-page-initialized="false"><!--MODULE-MANAGER-INITIALIZATION--></body></html>
 '''
 
         verify()
@@ -359,7 +359,7 @@ class DocumentLinkerImplTest extends InternalBaseTestCase {
         linker.updateDocument(document)
 
         check document, '''
-<html><head><meta/></head><body><!--MODULE-MANAGER-INITIALIZATION--></body></html>
+<html><head><meta/></head><body data-page-initialized="false"><!--MODULE-MANAGER-INITIALIZATION--></body></html>
 '''
 
         verify()

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
index f9b2347..2deafd6 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
@@ -1,4 +1,4 @@
-// Copyright 2009, 2010, 2011, 2012 The Apache Software Foundation
+// Copyright 2009-2013 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -36,8 +36,6 @@ public class AjaxTests extends TapestryCoreTestCase
     {
         openLinks("Form Fragment Demo", "Clear Errors");
 
-        waitForPageInitialized();
-
         type("name", "Fred");
 
         // Put a value into the sub field, then hide it ...
@@ -55,8 +53,6 @@ public class AjaxTests extends TapestryCoreTestCase
         clickAndWait("link=Back");
         clickAndWait("link=Clear Errors");
 
-        waitForPageInitialized();
-
         click("subscribeToEmail");
         click("on");
 
@@ -90,8 +86,6 @@ public class AjaxTests extends TapestryCoreTestCase
     {
         openLinks("Nested Form Fragment Demo");
 
-        waitForPageInitialized();
-
         assertTrue(isVisible("outertext1"));
         assertTrue(isVisible("innertext1"));
         assertTrue(isChecked("innertrigger1"));
@@ -193,8 +187,6 @@ public class AjaxTests extends TapestryCoreTestCase
     {
         openLinks("FormInjector Demo");
 
-        waitForPageInitialized();
-
         assertText("sum", "0.0");
 
         click("link=Add another value");
@@ -205,8 +197,6 @@ public class AjaxTests extends TapestryCoreTestCase
 
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         assertText("sum", "5.1");
 
         click("link=remove");
@@ -241,8 +231,6 @@ public class AjaxTests extends TapestryCoreTestCase
     {
         openLinks("ProgressiveDisplay Demo");
 
-        waitForPageInitialized();
-
         waitForElementToAppear("content1");
         assertText("content1", "Progressive Display content #1.");
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
index f738e90..a4e0404 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
@@ -141,8 +141,6 @@ public class CoreBehaviorsTests extends TapestryCoreTestCase
     {
         openLinks("Expressions in JS Functions Demo");
 
-        waitForPageInitialized();
-
         click("button1");
         waitForCondition("selenium.getValue('target') == 'test1'", PAGE_LOAD_TIMEOUT);
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
index 147b753..4c551b6 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
@@ -81,8 +81,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         assertTextPresent("You must provide a value for Email.");
         // is an overridden validation error message:
         assertTextPresent("Please provide a detailed description of the incident.");
@@ -93,8 +91,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         assertTextPresent("[false]");
         assertTextPresent("You must provide an integer value for Hours.");
 
@@ -104,8 +100,6 @@ public class FormTests extends TapestryCoreTestCase
         click("//input[@id='urgent']");
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         assertTextPresent("[foo@bar.baz]");
         assertTextPresent("[Show me the money!]");
         assertTextPresent("[true]");
@@ -119,8 +113,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait("link=Reset Page State");
 
-        waitForPageInitialized();
-
         // Notice: click, not click and wait.
 
         click(SUBMIT);
@@ -152,8 +144,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait("link=Clear Data");
 
-        waitForPageInitialized();
-
         clickAndWait("//input[@value='Cancel']");
 
         assertText("message", "Form was cancelled.");
@@ -175,8 +165,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Regexp Demo");
 
-        waitForPageInitialized();
-
         String update = SUBMIT;
 
         type("zipCode", "abc");
@@ -203,8 +191,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("DateField Demo", "Reset Page State", "english");
 
-        waitForPageInitialized();
-
         type("birthday", "24 dec 1966");
         type("asteroidImpact", "05/28/2046");
 
@@ -218,8 +204,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait("link=french");
 
-        waitForPageInitialized();
-
         click("css=.x-birthday .btn");
 
         sleep(AJAX_WAIT_TIME);
@@ -233,8 +217,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("DateField Demo", "Reset Page State", "english");
 
-        waitForPageInitialized();
-
         type("asteroidImpact", "<script>alert('T5 is great'); </script>");
 
         click("css=.x-impact .btn");
@@ -250,8 +232,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("DateField Demo", "Reset Page State", "english");
 
-        waitForPageInitialized();
-
         //start with a known date...
         type("asteroidImpact", "05/28/2035");
 
@@ -342,8 +322,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("DateField Demo", "Reset Page State", "english");
 
-        waitForPageInitialized();
-
         type("asteroidImpact", "05/28/2046");
 
         click("css=.x-impact .btn");
@@ -595,8 +573,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Client Format Validation");
 
-        waitForPageInitialized();
-
         type("amount", "abc");
         type("quantity", "abc");
 
@@ -703,8 +679,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("LinkSubmit Without Validator Demo");
 
-        waitForPageInitialized();
-
         type("searchField", "Anders Haraldsson");
 
         clickAndWait("//a[@id='searchLink']");
@@ -720,8 +694,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Client-Side Numeric Validation", "Reset Page State", "Setup Values");
 
-        waitForPageInitialized();
-
         assertText("outputLongValue", "1000");
         assertText("outputDoubleValue", "1234.67");
 
@@ -760,8 +732,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait("link=Setup Values");
 
-        waitForPageInitialized();
-
         type("longValue", "4000.");
         click(SUBMIT);
 
@@ -779,8 +749,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Form Zone Demo");
 
-        waitForPageInitialized();
-
         type("longValue", "alpha");
 
         click(SUBMIT);
@@ -811,8 +779,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Validation Constraints From Messages");
 
-        waitForPageInitialized();
-
         click(SUBMIT);
 
         assertTextPresent("You must provide a value for Name.");
@@ -841,8 +807,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("LinkSubmit Demo");
 
-        waitForPageInitialized();
-
         waitForElementToAppear("fred");
 
         click("//a[@id='fred']");
@@ -859,8 +823,6 @@ public class FormTests extends TapestryCoreTestCase
 
         type("name", "Betty");
 
-        waitForPageInitialized();
-
         clickAndWait("link=Barney");
 
         assertText("name-value", "Betty");
@@ -998,8 +960,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Cancel Demo");
 
-        waitForPageInitialized();
-
         clickAndWait("//input[@value='Cancel Form']");
 
         assertText("message", "Form was canceled.");
@@ -1010,8 +970,6 @@ public class FormTests extends TapestryCoreTestCase
     {
         openLinks("Cancel Demo");
 
-        waitForPageInitialized();
-
         clickAndWait("link=Cancel Form");
 
         assertText("message", "Form was canceled.");
@@ -1024,8 +982,6 @@ public class FormTests extends TapestryCoreTestCase
 
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         assertTextPresent("You must provide a value for Color.");
 
         select("color", "label=Green");

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
index e12b6d7..a4084b0 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
@@ -250,8 +250,6 @@ public class GridTests extends TapestryCoreTestCase
     {
         openLinks("In-Place Grid Demo");
 
-        waitForPageInitialized();
-
         String timestamp = getText("lastupdate");
 
         click("link=2");

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/PaletteTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/PaletteTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/PaletteTests.java
index 03d87fc..88af192 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/PaletteTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/PaletteTests.java
@@ -41,8 +41,6 @@ public class PaletteTests extends TapestryCoreTestCase
     {
         openLinks("Palette Demo", "Reset Page State");
 
-        waitForPageInitialized();
-
         assertText("css=.palette-available .palette-title",
                 "Languages Offered");
         assertText("css=.palette-selected .palette-title",
@@ -60,8 +58,6 @@ public class PaletteTests extends TapestryCoreTestCase
 
         assertText("id=selected-languages", "[HASKELL, JAVASCRIPT]");
 
-        waitForPageInitialized();
-
         addSelection(SELECTED_OPTIONS, "label=Javascript");
 
         click(DESELECT_BUTTON);
@@ -85,8 +81,6 @@ public class PaletteTests extends TapestryCoreTestCase
 
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         addSelection(SELECTED_OPTIONS, "label=Ruby");
 
         for (int i = 0; i < 6; i++)
@@ -130,8 +124,6 @@ public class PaletteTests extends TapestryCoreTestCase
     {
         openLinks("Palette Demo", "Reset Page State");
 
-        waitForPageInitialized();
-
         click(SUBMIT);
 
         assertTextPresent("You must provide a value for Languages.");

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java
index fa8e91b..d288112 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java
@@ -1,4 +1,4 @@
-// Copyright 2011, 2012 The Apache Software Foundation
+// Copyright 2011-2013 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -26,8 +26,6 @@ public class ZoneRefreshTest extends TapestryCoreTestCase
     {
         openBaseURL();
 
-        waitForPageInitialized();
-
         clickAndWait("link=Zone Refresh With Event Handler Returning Void");
 
         sleep(AJAX_WAIT_TIME);
@@ -40,8 +38,6 @@ public class ZoneRefreshTest extends TapestryCoreTestCase
     {
         openBaseURL();
 
-        waitForPageInitialized();
-
         clickAndWait("link=Zone Refresh With Event Handler Returning Zone");
 
         sleep(AJAX_WAIT_TIME);

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
index 3b2fcf5..b31cd23 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
@@ -34,8 +34,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Select Zone Demo");
 
-        waitForPageInitialized();
-
         select("carMaker", "Bmw");
 
         sleep(AJAX_WAIT_TIME);
@@ -50,8 +48,6 @@ public class ZoneTests extends TapestryCoreTestCase
 
         clickAndWait(SUBMIT);
 
-        waitForPageInitialized();
-
         assertTextPresent("Car Maker: BMW");
 
         assertTextPresent("Car Model: 7 Series");
@@ -74,8 +70,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Zone Demo");
 
-        waitForPageInitialized();
-
         assertTextPresent("No name has been selected.");
 
         click("link=Select \"Mr. <Roboto>\"");
@@ -108,8 +102,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Multiple Zone Update Demo");
 
-        waitForPageInitialized();
-
         String now = getText("now");
 
         assertText("wilma", "Wilma Flintstone");
@@ -167,8 +159,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Zone Demo");
 
-        waitForPageInitialized();
-
         assertText("zone-update-message", "");
 
         click("link=Direct JSON response");
@@ -188,8 +178,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("LinkSubmit inside Zone");
 
-        waitForPageInitialized();
-
         String now = getText("now");
 
         waitForElementToAppear("mySubmit");
@@ -227,8 +215,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Zone/Form Update Demo");
 
-        waitForPageInitialized();
-
         click("link=Update the form");
 
         waitForElementToAppear("updated");
@@ -248,8 +234,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("MultiZone Update inside a Form");
 
-        waitForPageInitialized();
-
         select("selectValue1", "3 pre ajax");
 
         waitForElementToAppear("select2ValueZone");
@@ -310,12 +294,8 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Zone Demo");
 
-        waitForPageInitialized();
-
         click("link=Select \"CSS Injection\"");
 
-        waitForPageInitialized();
-
         // First check that the update arrived
 
         waitForElementToAppear("demo-aip");
@@ -337,8 +317,6 @@ public class ZoneTests extends TapestryCoreTestCase
     {
         openLinks("Zone Demo");
 
-        waitForPageInitialized();
-
         assertText("zone-update-message", "");
 
         click("link=Update zone with empty body");

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0c928819/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
----------------------------------------------------------------------
diff --git a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
index bdc88d4..fa748cb 100644
--- a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
+++ b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
@@ -1137,9 +1137,39 @@ public abstract class SeleniumTestCase extends Assert implements Selenium
         selenium.waitForFrameToLoad(frameAddress, timeout);
     }
 
+    /**
+     * Waits for page  to load, then waits for initialization to finish, which is recognized by the {@code data-page-initialized} attribute
+     * being set to true on the body element. Polls at increasing intervals.
+     */
     public void waitForPageToLoad(String timeout)
     {
         selenium.waitForPageToLoad(timeout);
+
+        // In a limited number of cases, a "page" is an container error page or raw HTML content
+        // that does not include the body element and data-page-initialized element. In those cases,
+        // there will never be page initialization in the Tapestry sense and we return immediately.
+
+        if (!isElementPresent("css=body[data-page-initialized]")) { return; }
+
+        int totalTime = 0;
+        int sleepTime = 20;
+
+        while (true) {
+            if (isElementPresent("css=body[data-page-initialized='true']"))
+            {
+                return;
+            }
+
+            if (totalTime > 10000) {
+                reportAndThrowAssertionError("Page did not finish initializing.");
+            }
+
+            sleep(sleepTime);
+
+            totalTime += sleepTime;
+
+            sleepTime *= 2;
+        }
     }
 
     public void waitForPopUp(String windowID, String timeout)
@@ -1501,24 +1531,4 @@ public abstract class SeleniumTestCase extends Assert implements Selenium
         return selenium.getCssCount(str);
     }
 
-    /**
-     * Waits for page initialization to finish, which is recognized by the {@code data-page-initialized} attribute
-     * being added to the HTML element. Polls at 20ms intervals for 200ms.
-     *
-     * @since 5.4
-     */
-    protected final void waitForPageInitialized()
-    {
-        for (int i = 0; i < 10; i++)
-        {
-            if (isElementPresent("css=body[data-page-initialized]"))
-            {
-                return;
-            }
-
-            sleep(20);
-        }
-
-        reportAndThrowAssertionError("Page did not finish initializing.");
-    }
 }


[3/6] git commit: Simplify Checklist component and update for Bootstrap 3

Posted by hl...@apache.org.
Simplify Checklist component and update for Bootstrap 3


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/4a07baf3
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/4a07baf3
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/4a07baf3

Branch: refs/heads/master
Commit: 4a07baf321014c28d5b2bab6e04787d9acb197bc
Parents: 0c92881
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Aug 27 12:33:00 2013 +0530
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Aug 27 12:33:00 2013 +0530

----------------------------------------------------------------------
 .../tapestry5/corelib/components/Checklist.java |  2 +-
 .../tapestry5/corelib/components/Checklist.tml  |  6 ++++--
 tapestry-core/src/test/app1/ChecklistDemo.tml   | 21 +++++++-------------
 3 files changed, 12 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a07baf3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java
index 7e7131c..2f0616a 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java
@@ -210,7 +210,7 @@ public class Checklist extends AbstractField
     }
 
     void beginRender(MarkupWriter writer) {
-        writer.element("div", "class", "checkbox");
+        writer.element("div", "id", getClientId());
     }
 
     void afterRender(MarkupWriter writer) {

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a07baf3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml
index 0be8d97..9cb8a0c 100644
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Checklist.tml
@@ -1,5 +1,7 @@
 <t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
-    <div t:type="loop" source="availableOptions" value="var:currentOption" class="t-checklist-row">
-           <t:delegate to="var:currentOption"/>
+    <div t:type="loop" source="availableOptions" value="var:currentOption">
+        <div class="checkbox">
+            <t:delegate to="var:currentOption"/>
+        </div>
     </div>
 </t:container>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4a07baf3/tapestry-core/src/test/app1/ChecklistDemo.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/app1/ChecklistDemo.tml b/tapestry-core/src/test/app1/ChecklistDemo.tml
index 77dfeac..8b142df 100644
--- a/tapestry-core/src/test/app1/ChecklistDemo.tml
+++ b/tapestry-core/src/test/app1/ChecklistDemo.tml
@@ -1,20 +1,13 @@
 <t:border xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
-	<t:form clientValidation="none">
-		<p>
-			<t:errors />
-		</p>
-		<p>
-			<t:label for="selected" />
-			:
-			<t:checklist t:id="selected" validate="required" model="literal:Red,Green,Blue" encoder="encoder" label="Color"/>
+    <t:form clientValidation="none">
+        <t:errors/>
 
-		</p>
+        <t:checklist t:id="selected" validate="required" model="literal:Red,Green,Blue"
+                     encoder="encoder" label="Color"/>
 
-		<p>
-			<t:submit value="literal:Submit" />
-		</p>
-	</t:form>
+        <t:submit class="btn btn-primary" value="literal:Submit"/>
+    </t:form>
 
-	<p>Selected colors: ${sorted}</p>
+    <p>Selected colors: ${sorted}</p>
 
 </t:border>
\ No newline at end of file