Author: alevkovsky
Date: 2008-12-11 06:50:45 -0500 (Thu, 11 Dec 2008)
New Revision: 11716
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messagesBase.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/testMessagesWithForAttribute.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/testMoreThanOneMessage.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5128
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messagesBase.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messagesBase.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/testMessagesWithForAttribute.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/testMessagesWithForAttribute.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/testMoreThanOneMessage.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java 2008-12-11
08:40:55 UTC (rev 11715)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java 2008-12-11
11:50:45 UTC (rev 11716)
@@ -24,16 +24,16 @@
public void testComponentOutputAllMessagesByAjax(Template template) {
init(template, TEST_MORE_THAN_ONE_MESSAGE);
- Assert.assertFalse(selenium.isElementPresent(mainForm + ":fatalMarker"));
- Assert.assertFalse(selenium.isElementPresent(mainForm + ":errorMarker"));
+ AssertNotPresent(mainForm + ":fatalMarker");
+ AssertNotPresent(mainForm + ":errorMarker");
selenium.type(inputText, "fatal");
selenium.type(inputText + "2", "");
selenium.type(inputText + "3", "");
clickAjaxCommandAndWait(mainForm + ":submitWithoutReRender");
- Assert.assertTrue(selenium.isElementPresent(mainForm + ":fatalMarker"));
- Assert.assertTrue(selenium.isElementPresent(mainForm + ":errorMarker"));
+ AssertPresent(mainForm + ":fatalMarker");
+ AssertPresent(mainForm + ":errorMarker");
Assert.assertEquals("messageSummary",
selenium.getText("xpath=id('" + message +
"')/dt[1]/span[2]"));
Assert.assertEquals("Required message 1",
selenium.getText("xpath=id('" + message +
"')/dt[2]/span[2]"));
Assert.assertEquals("Required message 2",
selenium.getText("xpath=id('" + message +
"')/dt[3]/span[2]"));
@@ -43,7 +43,32 @@
selenium.type(inputText + "3", "passed");
clickAjaxCommandAndWait(mainForm + ":submitWithoutReRender");
- Assert.assertFalse(selenium.isElementPresent(mainForm + ":fatalMarker"));
- Assert.assertFalse(selenium.isElementPresent(mainForm + ":errorMarker"));
+ AssertNotPresent(mainForm + ":fatalMarker");
+ AssertNotPresent(mainForm + ":errorMarker");
}
+
+ @Test
+ public void testMessagesForAttribute(Template template) {
+ init(template, TEST_MESSAGES_WITH_FOR_ATTRIBUTE);
+
+ AssertNotPresent(mainForm + ":fatalMarker");
+ AssertNotPresent(mainForm + ":errorMarker");
+
+ selenium.type(inputText, "fatal");
+ selenium.type(inputText + "2", "");
+ selenium.type(inputText + "3", "");
+
+ clickAjaxCommandAndWait(mainForm + ":submitWithoutReRender");
+
+ //should present error message only for 2-nd input
+ AssertNotPresent(mainForm + ":fatalMarker");
+ AssertPresent(mainForm + ":errorMarker");
+ Assert.assertEquals("Required message 1",
selenium.getText("xpath=id('" + message +
"')/dt[1]/span[2]"));
+
+ selenium.type(inputText + "2", "passed");
+
+ clickAjaxCommandAndWait(mainForm + ":submitWithoutReRender");
+ AssertNotPresent(mainForm + ":fatalMarker");
+ AssertNotPresent(mainForm + ":errorMarker");
+ }
}