Author: alevkovsky
Date: 2009-01-15 12:40:42 -0500 (Thu, 15 Jan 2009)
New Revision: 12296
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java
Log:
Fix messages tests
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java 2009-01-15
17:10:52 UTC (rev 12295)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java 2009-01-15
17:40:42 UTC (rev 12296)
@@ -78,13 +78,10 @@
assertStyleAttributes(message, styleAttributes);
}
- /**
- * showDetail and showSummary attributes work
- */
- @Test
- public void testShowDetailAndShowSummary(Template template) {
- init(template);
- Assert.assertTrue(selenium.getText(label).length() == 0);
+ public void assertShowDetailAndShowSummary(boolean shouldPresemtIfEmpty) {
+ if(shouldPresemtIfEmpty){
+ Assert.assertTrue(selenium.getText(label).length() == 0);
+ }
selenium.type(inputText, "fatal");
clickAjaxCommandAndWait(submit);
Assert.assertTrue("messageDetail".equals(selenium.getText(label)));
@@ -108,13 +105,12 @@
Assert.fail("This test should be completed after resolving bug
RF-5107.");
}
- /**
- * check markers rendering
- */
- @Test
- public void testMarkers(Template template) {
- init(template);
- Assert.assertTrue(selenium.isElementPresent(mainForm + ":passedMarker"));
+
+
+ public void assertMarkers(boolean isPassedMarkerShouldPresent) {
+ if(isPassedMarkerShouldPresent){
+ Assert.assertTrue(selenium.isElementPresent(mainForm +
":passedMarker"));
+ }
selenium.type(inputText, "fatal");
clickAjaxCommandAndWait(submit);
Assert.assertTrue(selenium.isElementPresent(mainForm + ":fatalMarker"));
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java 2009-01-15
17:10:52 UTC (rev 12295)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java 2009-01-15
17:40:42 UTC (rev 12296)
@@ -39,6 +39,8 @@
@Test
public void testAjaxRendered(Template template) {
init(template);
+
+ //FIXME
https://jira.jboss.org/jira/browse/RF-5145
Assert.assertTrue(selenium.isElementPresent(mainForm + ":passedMarker"));
selenium.type(inputText, "fatal");
clickAjaxCommandAndWait(mainForm + ":submitWithoutReRender");
@@ -48,6 +50,24 @@
Assert.assertTrue(selenium.isElementPresent(mainForm + ":fatalMarker"));
}
+ /**
+ * check markers rendering
+ */
+ @Test
+ public void testMarkers(Template template) {
+ init(template);
+ assertMarkers(true);
+ }
+
+ /**
+ * showDetail and showSummary attributes work
+ */
+ @Test
+ public void testShowDetailAndShowSummary(Template template) {
+ init(template);
+ assertShowDetailAndShowSummary(true);
+ }
+
@Override
public String getTestUrl() {
return "pages/message/message.xhtml";
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 2009-01-15
17:10:52 UTC (rev 12295)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java 2009-01-15
17:40:42 UTC (rev 12296)
@@ -121,4 +121,22 @@
AssertNotPresent(mainForm + ":warnMarker");
AssertNotPresent(mainForm + ":infoMarker");
}
+
+ /**
+ * check markers rendering
+ */
+ @Test
+ public void testMarkers(Template template) {
+ init(template);
+ assertMarkers(false);
+ }
+
+ /**
+ * showDetail and showSummary attributes work
+ */
+ @Test
+ public void testShowDetailAndShowSummary(Template template) {
+ init(template);
+ assertShowDetailAndShowSummary(false);
+ }
}