Author: dsvyatobatsko
Date: 2009-02-20 08:02:15 -0500 (Fri, 20 Feb 2009)
New Revision: 12702
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java
Log:
https://jira.jboss.org/jira/browse/RF-6202
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java 2009-02-20
12:46:27 UTC (rev 12701)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java 2009-02-20
13:02:15 UTC (rev 12702)
@@ -27,6 +27,7 @@
import org.richfaces.AutoTester;
import org.richfaces.SeleniumEvent;
import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
import org.testng.annotations.Test;
public class AjaxHTMLCommandLinkTest extends SeleniumTestBase {
@@ -151,6 +152,17 @@
assertClassAttributeContains(componentId, "noclass", "Class
attribute was not output to client");
}
+ @Test
+ public void testComponentIsRenderedAsLinkWithTextDefinedAsValueAttribute(Template
template) {
+ renderAutoTestPage(LOOK_AND_FEEL_TEST_URL, template, null);
+ writeStatus("Check component is rendered as link with text defined as value
attribute");
+
+ String componentId = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID);
+ isRenderedAs(componentId, "a");
+ AssertTextEquals(componentId, "HtmlCommandLink",
+ "Component should be rendered as link with text defined as value
attribute");
+ }
+
@Override
public void sendAction() {
clickCommandAndWait(getAutoTester(this).getClientId(AutoTester.COMPONENT_ID));
@@ -186,6 +198,12 @@
}
}
+ private void isRenderedAs(String id, String tagName) {
+ if (selenium.getXpathCount("//" + tagName + "[@id='" + id
+ "']").intValue() != 1) {
+ Assert.fail("Dom element with id [" + id + "] is not rendered
as <" + tagName + ">");
+ }
+ }
+
@Override
public String getTestUrl() {
return "pages/ajaxHTMLCommandLink/ajaxHTMLLinkTest.xhtml";