[richfaces-svn-commits] JBoss Rich Faces SVN: r12339 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces and 1 other directories.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Mon Jan 19 10:51:55 EST 2009
Author: andrei_exadel
Date: 2009-01-19 10:51:55 -0500 (Mon, 19 Jan 2009)
New Revision: 12339
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/tabPanelAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java
Log:
RF-5567
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/tabPanelAutoTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-19 15:40:20 UTC (rev 12338)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-19 15:51:55 UTC (rev 12339)
@@ -1279,7 +1279,7 @@
for (SeleniumEvent ev : eventsExpected) {
if (ev == SeleniumEvent.ONCLICK) {
- clickById(id);
+ selenium.click(id);
}else if (ev == SeleniumEvent.ONDBLCLICK) {
selenium.doubleClick(id);
} else if (ev == SeleniumEvent.ONMOUSEDOWN) {
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java 2009-01-19 15:40:20 UTC (rev 12338)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java 2009-01-19 15:51:55 UTC (rev 12339)
@@ -26,6 +26,7 @@
import org.ajax4jsf.autotest.bean.AutoTestBean;
import org.ajax4jsf.template.Template;
import org.richfaces.AutoTester;
+import org.richfaces.SeleniumEvent;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -67,7 +68,13 @@
params.put("parameter2", "value2");
params.put("parameter3", "value3");
}
+
+ static final Map<String, String> TAB_PANEL_STYLES = new HashMap<String, String>();
+ static {
+ TAB_PANEL_STYLES.put("font-size", "16px");
+ }
+
@Test
public void testRichTabPanelComponent(Template template) {
renderPage(template, RESET_METHOD);
@@ -378,6 +385,41 @@
}
+
+ @Test
+ public void testStylesAndClassesStandardAttributes(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, RESET_METHOD);
+
+ String panelId = autoTester.getClientId(AutoTester.COMPONENT_ID);
+ String tab1Id = autoTester.getClientId("tab1");
+ String tab2Id = autoTester.getClientId("tab2");
+
+ autoTester.testStyleAndClasses(new String [] {"rich-tabpanel", "styleClass"}, TAB_PANEL_STYLES);
+ String title = selenium.getAttribute("//*[@id='" + panelId + "']/@title");
+ if (!"panelTitle".equals(title)) {
+ Assert.fail("Title attribute for tabPanel was not output to client");
+ }
+
+ autoTester.testHTMLEvents();
+
+ assertClassNames("//*[@id='" + panelId + "']/tbody/tr/td", new String [] { "dr-bottom-line", "rich-tab-bottom-line", "headerClass"}, "Header css classes are incoorect or headerClass attribute was not output to client", false);
+
+ assertClassNames("//*[@id='" + tab1Id + "_lbl']", new String [] {"dr-tbpnl-tb", "rich-tab-header", "dr-tbpnl-tb-act", "rich-tab-active", "tabClass", "activeTabClass"}, "Active Tab has incorrect css classes.", false);
+ assertClassNames("//*[@id='" + tab2Id + "_lbl']", new String [] {"dr-tbpnl-tb", "rich-tab-header", "dr-tbpnl-tb-inact", "rich-tab-inactive", "tabClass", "inactiveTabClass"}, "Inactive Tab has incorrect css classes.", false);
+
+ clickAjaxCommandAndWait(tab2Id + "_lbl");
+
+ String tab2ContentPath = "//*[@id='" + tab2Id + "']/table/tbody/tr/td";
+ assertStyleAttributeContains(tab2ContentPath, "font-weight: bold", "Style attribute was not output for tab");
+ assertClassNames(tab2ContentPath, new String [] {"dr-tbpnl-cntnt", "rich-tabpanel-content", "contentClass", "styleClass"}, "Tab css classes are incorrect", false);
+ assertEvents(tab2ContentPath, SeleniumEvent.STANDARD_HTML_EVENTS);
+
+ title = selenium.getAttribute(tab2ContentPath + "/@title");
+ if (!"title".equals(title)) {
+ Assert.fail("Title attribute for tab was not output to client");
+ }
+ }
private void testListener(String parentId) {
More information about the richfaces-svn-commits
mailing list