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/16 02:17:33 UTC

[35/50] git commit: Remove some test logic that expected Tapestry 5.3-style error popups

Remove some test logic that expected Tapestry 5.3-style error popups


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

Branch: refs/heads/master
Commit: 455bf0f80a29ccaba9f42005f226da93d35758a1
Parents: cf79e24
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Wed Dec 5 09:30:30 2012 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Wed Dec 5 09:30:30 2012 -0800

----------------------------------------------------------------------
 .../TapestryBeanValidationIntegrationTests.java    |   34 ++++++---------
 .../integration/TapestryCoreTestCase.java          |   10 ----
 .../tapestry5/integration/app1/AjaxTests.java      |    4 +-
 .../tapestry5/integration/app1/FormTests.java      |   29 ++++--------
 .../tapestry5/integration/app1/ZoneTests.java      |    2 -
 5 files changed, 25 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/455bf0f8/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 a986ba2..0eb48dd 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
@@ -113,7 +113,7 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
         //@NotNull
         click(SUBMIT);
 
-        assertBubbleMessage("notNullValue", "Not Null Value may not be null");
+        assertTextPresent("Not Null Value may not be null");
 
         type("notNullValue", "igor");
 
@@ -122,7 +122,7 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
 
         click(SUBMIT);
 
-        assertBubbleMessage("minValue", "Min Value must be greater than or equal to 6");
+        assertTextPresent("Min Value must be greater than or equal to 6");
 
         //@Max
         type("minValue", "6");
@@ -130,7 +130,7 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
 
         click(SUBMIT);
 
-        assertBubbleMessage("maxValue", "Max Value must be less than or equal to 100");
+        assertTextPresent("Max Value must be less than or equal to 100");
 
         //@Null
         type("maxValue", "100");
@@ -140,7 +140,7 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
 
         click(SUBMIT);
 
-        assertBubbleMessage("stringSizeValue", "String Size Value size must be between 3 and 6");
+        assertTextPresent("String Size Value size must be between 3 and 6");
 
         click(SUBMIT);
 
@@ -151,11 +151,11 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
 
         click(SUBMIT);
 
-        assertBubbleMessage("languages", "Languages size must be between 2 and 3");
+        assertTextPresent("Languages size must be between 2 and 3");
 
         click(SUBMIT);
 
-        assertBubbleMessage("nullValue", "Null Value must be null");
+        assertTextPresent("Null Value must be null");
     }
 
 
@@ -166,21 +166,21 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
 
         click(SUBMIT);
 
-        assertBubbleMessage("loginName", "Login Name may not be null");
-        assertBubbleMessage("secretPassword", "Secret Password may not be null");
-        assertBubbleMessage("programmingLanguages", "Programming Languages may not be null");
-        assertBubbleMessage("favoriteColors", "Favorite Colors may not be null");
-        assertBubbleMessage("birthDay", "Birth Day may not be null");
+        assertTextPresent("Login Name may not be null");
+        assertTextPresent("Secret Password may not be null");
+        assertTextPresent("Programming Languages may not be null");
+        assertTextPresent("Favorite Colors may not be null");
+        assertTextPresent("Birth Day may not be null");
 
         type("loginName", "123");
         click(SUBMIT);
 
-        assertBubbleMessage("loginName", "Login Name must match \"[a-zA-Z]+\"");
+        assertTextPresent("Login Name must match \"[a-zA-Z]+\"");
 
         type("loginName", "abc");
         click(SUBMIT);
 
-        assertBubbleMessage("loginName", "You must provide at least 5 characters for Login Name.");
+        assertTextPresent("You must provide at least 5 characters for Login Name.");
     }
 
     /*
@@ -202,12 +202,4 @@ public class TapestryBeanValidationIntegrationTests extends SeleniumTestCase
         assertTextPresent("Login Name size must be between 7 and 10", "Login Name must match \"[0-9]+\"");
     }
 
-    protected final void assertBubbleMessage(String fieldId, String expected)
-    {
-        String popupId = fieldId + "_errorpopup";
-
-        waitForElementToAppear(popupId);
-
-        assertText(String.format("//div[@id='%s']/span", popupId), expected);
-    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/455bf0f8/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 1a57e37..5e08869 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
@@ -33,16 +33,6 @@ public abstract class TapestryCoreTestCase extends SeleniumTestCase
         }
     }
 
-    /** @deprecated Deprecated in 5.4, should not be used, as it expects 5.3 style error popups. */
-    protected final void assertBubbleMessage(String fieldId, String expected)
-    {
-        String popupId = fieldId + "_errorpopup";
-
-        waitForElementToAppear(popupId);
-
-        assertText(String.format("//div[@id='%s']/span", popupId), expected);
-    }
-
     protected final void assertFieldValueSeries(String idFormat, int startIndex, String... values)
     {
         for (int i = 0; i < values.length; i++)

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/455bf0f8/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 d9fbf17..33cd40a 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 The Apache Software Foundation
+// Copyright 2009, 2010, 2011, 2012 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.
@@ -157,7 +157,7 @@ public class AjaxTests extends TapestryCoreTestCase
         assertFieldValue("value1", "");
         //submitting should result in error in value1...
         click("saveform");
-        assertBubbleMessage("value1", "You must provide a value for Value1.");
+        assertTextPresent("You must provide a value for Value1.");
 
         //still wind up being able to submit here b/c there's no (good) way to highlight the error in the invisible tab.
         //but the form should return with errors.

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/455bf0f8/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 ca9b851..bc6014c 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
@@ -192,8 +192,6 @@ public class FormTests extends TapestryCoreTestCase
 
         click(update); // but don't wait
 
-        waitForCondition("selenium.browserbot.getCurrentWindow().document.getElementById('zipCode_errorpopup')", "5000");
-
         assertTextPresent("A zip code consists of five or nine digits, eg: 02134 or 90125-4472.");
 
         type("zipCode", "12345");
@@ -247,7 +245,7 @@ public class FormTests extends TapestryCoreTestCase
 
         click("id=asteroidImpact-trigger");
 
-        assertBubbleMessage("asteroidImpact", "Unparseable date: \"&lt;script&gt;alert('T5 is great'); &lt;/script&gt;\"");
+        assertTextPresent("Unparseable date: \"&lt;script&gt;alert('T5 is great'); &lt;/script&gt;\"");
     }
 
     // TAP5-1409
@@ -578,11 +576,8 @@ public class FormTests extends TapestryCoreTestCase
 
         click(SUBMIT);
 
-        waitForElementToAppear("amount_errorpopup");
-        waitForElementToAppear("quantity_errorpopup");
-
-        assertText("//div[@id='amount_errorpopup']/span", "You must provide a numeric value for Amount.");
-        assertText("//div[@id='quantity_errorpopup']/span", "Provide quantity as a number.");
+        assertTextPresent("You must provide a numeric value for Amount.",
+                "Provide quantity as a number.");
     }
 
     /**
@@ -738,13 +733,13 @@ public class FormTests extends TapestryCoreTestCase
         type("longValue", "4000.");
         click(SUBMIT);
 
-        assertBubbleMessage("longValue", "You must provide an integer value for Long Value.");
+        assertTextPresent("You must provide an integer value for Long Value.");
 
         type("doubleValue", "abc");
 
         click(SUBMIT);
 
-        assertBubbleMessage("doubleValue", "You must provide a numeric value for Double Value.");
+        assertTextPresent("You must provide a numeric value for Double Value.");
     }
 
     @Test
@@ -756,9 +751,7 @@ public class FormTests extends TapestryCoreTestCase
 
         click(SUBMIT);
 
-        waitForElementToAppear("longValue_errorpopup");
-
-        assertText("//div[@id='longValue_errorpopup']/span", "You must provide an integer value for Long Value.");
+        assertTextPresent("You must provide an integer value for Long Value.");
 
         type("longValue", "37");
 
@@ -786,19 +779,19 @@ public class FormTests extends TapestryCoreTestCase
 
         click(SUBMIT);
 
-        assertBubbleMessage("name", "You must provide a value for Name.");
-        assertBubbleMessage("age", "You must provide a value for Age.");
+        assertTextPresent("You must provide a value for Name.");
+        assertTextPresent("You must provide a value for Age.");
 
         type("name", "behemoth");
         type("age", "0");
         select("type", "label=Snake");
 
         click(SUBMIT);
-        assertBubbleMessage("age", "Age requires a value of at least 1.");
+        assertTextPresent("Age requires a value of at least 1.");
 
         type("age", "121");
         click(SUBMIT);
-        assertBubbleMessage("age", "Age requires a value no larger than 120.");
+        assertTextPresent("Age requires a value no larger than 120.");
 
         type("age", "5");
         clickAndWait(SUBMIT);
@@ -818,8 +811,6 @@ public class FormTests extends TapestryCoreTestCase
 
         click("//a[@id='fred']");
 
-        waitForElementToAppear("name_errorpopup");
-
         assertTextPresent("You must provide a value for Name.");
 
         type("name", "Wilma");

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/455bf0f8/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 deec281..afadbd4 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
@@ -190,8 +190,6 @@ public class ZoneTests extends TapestryCoreTestCase
 
         click("//a[@id='mySubmit']");
 
-        waitForElementToAppear("value_errorpopup");
-
         type("value", "robot chicken");
 
         click("//a[@id='mySubmit']");