Author: dsvyatobatsko
Date: 2008-06-26 10:35:08 -0400 (Thu, 26 Jun 2008)
New Revision: 9244
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxLog/
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxLog/ajaxLogTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLogTest.java
Log:
http://jira.jboss.com/jira/browse/RF-3775
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxLog/ajaxLogTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxLog/ajaxLogTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLogTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLogTest.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLogTest.java 2008-06-26
14:35:08 UTC (rev 9244)
@@ -0,0 +1,66 @@
+package org.richfaces.testng;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class AjaxLogTest extends SeleniumTestBase {
+
+ @Test(dataProvider = "templates")
+ public void testAjaxLogLayout(Template template) {
+ renderPage(template);
+
+ String parentId = getParentId() + "_form:";
+
+ String inputElemId = parentId + "input";
+ String logElemId = "logConsole";
+
+ writeStatus("Type smth. All typing is being logged");
+
+ type(inputElemId, "typing");
+ waitForAjaxCompletion();
+
+ writeStatus("test that log element is present");
+ AssertRendered(logElemId);
+
+ writeStatus("test that clear button is present and has proper label");
+
+ if
(selenium.isElementPresent("//div[@id='logConsole']/button")) {
+ String clearBtnLabel =
selenium.getText("//div[@id='logConsole']/button");
+ if (null == clearBtnLabel ||
!clearBtnLabel.trim().equalsIgnoreCase("Clear")) {
+ Assert.fail("Clear button has obscure label");
+ }
+ } else {
+ Assert.fail("Clear button is not rendered");
+ }
+
+ writeStatus("at least dozen messages have to be logged");
+ int logCount =
selenium.getXpathCount("//div[(a)id='logConsole']/div").intValue();
+ if (logCount < 12) {
+ Assert.fail("There are suspiciously few log messages here");
+ }
+
+ writeStatus("check clear button");
+ selenium.click("//div[@id='logConsole']/button");
+
+ logCount =
selenium.getXpathCount("//div[(a)id='logConsole']/div").intValue();
+ if (logCount > 0) {
+ Assert.fail("log must be empty");
+ }
+
+ writeStatus("test style attribute");
+
+ String style =
selenium.getAttribute("//div[@id='logConsole']@style");
+
+ if (!style.contains("WIDTH: 800px; HEIGHT: 300px")) {
+ Assert.fail("Style does not affect ajax log component");
+ }
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/ajaxLog/ajaxLogTest.xhtml";
+ }
+
+}
Property changes on:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxLogTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native