You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2012/12/14 19:13:52 UTC

[2/2] git commit: Pull waitForPageInitialized() up to SeleniumTestCase

Pull waitForPageInitialized() up to SeleniumTestCase


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

Branch: refs/heads/5.4-js-rewrite
Commit: c40c71d04f8364faf734bda885aa18b14e1b68d6
Parents: 40f3fef
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Fri Dec 14 09:46:46 2012 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Fri Dec 14 09:46:46 2012 -0800

----------------------------------------------------------------------
 .../integration/TapestryCoreTestCase.java          |   20 --------------
 .../apache/tapestry5/test/SeleniumTestCase.java    |   21 +++++++++++++++
 2 files changed, 21 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c40c71d0/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java
index 18df891..b2c070c 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java
@@ -58,24 +58,4 @@ public abstract class TapestryCoreTestCase extends SeleniumTestCase
         assertText("css=[data-container-type=alerts] .alert", "\u00d7" + text);
     }
 
-    /**
-     * 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=html[data-page-initialized]"))
-            {
-                return;
-            }
-
-            sleep(20);
-        }
-
-        reportAndThrowAssertionError("Page did not finish initializing.");
-    }
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c40c71d0/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 850b46d..adfdf2f 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
@@ -1500,4 +1500,25 @@ 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=html[data-page-initialized]"))
+            {
+                return;
+            }
+
+            sleep(20);
+        }
+
+        reportAndThrowAssertionError("Page did not finish initializing.");
+    }
 }