JBoss Rich Faces SVN: r8908 - in trunk/test-applications/seleniumTest/src: main/webapp/pages/calendar and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-06-05 08:22:07 -0400 (Thu, 05 Jun 2008)
New Revision: 8908
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/src/main/webapp/pages/calendar/calendarTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
calender test fix
Modified: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-06-04 19:40:37 UTC (rev 8907)
+++ trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-06-05 12:22:07 UTC (rev 8908)
@@ -119,4 +119,9 @@
<managed-bean-class>org.ajax4jsf.bean.InputNumberSliderBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>calendarBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.bean.CalendarTestBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
</faces-config>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/src/main/webapp/pages/calendar/calendarTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java 2008-06-04 19:40:37 UTC (rev 8907)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java 2008-06-05 12:22:07 UTC (rev 8908)
@@ -60,9 +60,9 @@
public void stopSelenium() {
super.stopSelenium();
}
-
+
@Test
- public void testContextMenuComponent() throws Exception {
+ public void testCalendarComponent() throws Exception {
_testSelectDateComponent(Template.SIMPLE);
_testCalendarComponent(Template.DATA_TABLE);
_testCalendarComponent(Template.MODAL_PANEL);
15 years, 11 months
JBoss Rich Faces SVN: r8907 - branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-06-04 15:40:37 -0400 (Wed, 04 Jun 2008)
New Revision: 8907
Modified:
branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-3376
Modified: branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java
===================================================================
--- branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java 2008-06-04 19:37:09 UTC (rev 8906)
+++ branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java 2008-06-04 19:40:37 UTC (rev 8907)
@@ -241,7 +241,7 @@
}
protected String escapeHtmlEntities(CharSequence orig) {
- StringBuffer buff = new StringBuffer(orig);
+ StringBuffer buff = new StringBuffer(orig.toString());
EntityTable defaultEntityTable = EntityTable.getDefaultEntityTable();
Matcher matcher = Pattern.compile("\\&\\w+\\;").matcher(orig);
int delta = 0;
15 years, 11 months
JBoss Rich Faces SVN: r8906 - trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-06-04 15:37:09 -0400 (Wed, 04 Jun 2008)
New Revision: 8906
Modified:
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
Log:
Minor optimization for SuggestionBoxRenderer
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-06-04 19:34:57 UTC (rev 8905)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-06-04 19:37:09 UTC (rev 8906)
@@ -863,13 +863,15 @@
renderChild(context, nothingLabelFacet);
writer.write(endHtml);
}
- else if (null != suggestionBox.getNothingLabel() &&
- !"".equals(suggestionBox.getNothingLabel())) {
- writer.write(startHtml);
- writer.write(suggestionBox.getNothingLabel());
- writer.write(endHtml);
+ else {
+ String nothingLabel = suggestionBox.getNothingLabel();
+ if (null != nothingLabel &&
+ !"".equals(nothingLabel)) {
+ writer.write(startHtml);
+ writer.write(nothingLabel);
+ writer.write(endHtml);
+ }
}
-
}
/**
15 years, 11 months
JBoss Rich Faces SVN: r8905 - branches/3.1.x/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-06-04 15:34:57 -0400 (Wed, 04 Jun 2008)
New Revision: 8905
Modified:
branches/3.1.x/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
Log:
Minor optimization for SuggestionBoxRenderer
Modified: branches/3.1.x/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- branches/3.1.x/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-06-04 17:20:34 UTC (rev 8904)
+++ branches/3.1.x/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-06-04 19:34:57 UTC (rev 8905)
@@ -777,13 +777,15 @@
renderChild(context, nothingLabelFacet);
writer.write(endHtml);
}
- else if (null != suggestionBox.getNothingLabel() &&
- !"".equals(suggestionBox.getNothingLabel())) {
- writer.write(startHtml);
- writer.write(suggestionBox.getNothingLabel());
- writer.write(endHtml);
+ else {
+ String nothingLabel = suggestionBox.getNothingLabel();
+ if (null != nothingLabel &&
+ !"".equals(nothingLabel)) {
+ writer.write(startHtml);
+ writer.write(nothingLabel);
+ writer.write(endHtml);
+ }
}
-
}
/**
15 years, 11 months
JBoss Rich Faces SVN: r8904 - branches/3.1.x/ui/calendar/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-06-04 13:20:34 -0400 (Wed, 04 Jun 2008)
New Revision: 8904
Modified:
branches/3.1.x/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-3637
http://jira.jboss.com/jira/browse/RF-997
Modified: branches/3.1.x/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- branches/3.1.x/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-06-04 16:13:03 UTC (rev 8903)
+++ branches/3.1.x/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-06-04 17:20:34 UTC (rev 8904)
@@ -475,7 +475,19 @@
//Fix for myFaces 1.1.x RF-997
Date date;
if(calendar.isValid()){
- Date submittedValue = calendar.getAsDate(calendar.getSubmittedValue());
+ // Hack. Use converter in "Render response" phase
+ // in order to have java.util.Date object to highlight
+ // selected date in Calendar popup.
+ Date submittedValue = null;
+ try {
+ submittedValue = calendar.getAsDate(calendar.getSubmittedValue());
+ } catch(ConverterException ce) {
+ // ignore ConverterException for the case when the user
+ // has entered invalid date and there was no validation
+ // (and conversion) before, i.e. the form submit has attribute
+ // "immediate" = true; and Calendar has "immediate" = false
+ submittedValue = null;
+ }
if (submittedValue != null) {
date = submittedValue;
} else {
15 years, 11 months
JBoss Rich Faces SVN: r8902 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-06-04 11:51:58 -0400 (Wed, 04 Jun 2008)
New Revision: 8902
Modified:
trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml
Log:
RF-3550--<rich:toolTip> component "Details of usage" section rewriting
Modified: trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml 2008-06-04 14:58:48 UTC (rev 8901)
+++ trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml 2008-06-04 15:51:58 UTC (rev 8902)
@@ -70,58 +70,81 @@
</section>
<section>
- <title>Details of Usage</title>
- <para>
+ <title>Details of Usage</title>
+ <para>
To specify text information, labeled on a <property>tooltip</property>, use <emphasis><property>"value"</property></emphasis> attribute.
Images, links, buttons and other RichFaces components also may be put and composed inside <property>tooltip</property>.
Text, specified between <property>tooltip's</property> start and end tags will be rendered in browser as simple text.
<property>Tooltip</property> borders stretch to enclose it contents.
- </para>
- <para>
+ </para>
+ <para>
There are three ways to attach a <property>tooltip</property> to a page element.
One of them uses nesting (this way is shown on example <link linkend="tab_ccpt">above</link>).
- In such cases <property>tooltip</property> is attached to the parent component by default.
- </para>
- <note>
- <title>Note:</title>
- <para>
+ In such cases <property>tooltip</property> is attached to the parent component by default.
+ </para>
+ <note>
+ <title>Note:</title>
+ <para>
It is recommended to specify <emphasis><property>"id"</property></emphasis> for parent page element to ensure <property>tooltip's</property> correct work.
- </para>
- </note>
- <note>
- <title>Note:</title>
- <para>
- If parent component contains more than one child, it is recommended to define <emphasis role="bold"><property><rich:toolTip></property></emphasis> the last one.
- </para>
- </note>
- <para>
- Second way uses the attribute <emphasis><property>"for"</property></emphasis>. In this case a <property>tooltip</property> may be defined separately from a page element it is applied to.
+ </para>
+ </note>
+ <note>
+ <title>Note:</title>
+ <para>
+ If parent component contains more than one child, it is recommended to define <emphasis role="bold"><property><rich:toolTip></property></emphasis> as the last one.
+ </para>
+ </note>
+ <para>
+ <property>Tooltip</property> may be attached to a page element by the use of <emphasis><property>"for"</property></emphasis> attribute. In this case a <property>tooltip</property> may be defined separately from a page element it is applied to.
<emphasis><property>"id"</property></emphasis> for page element is necessary (see the example below).
- </para>
- <para>
+ </para>
+ <para>
<emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
-<rich:panel id=”panelid”>
-…
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:panel id="panelId">
+...
</rich:panel>
-<rich:toolTip value="This is a tooltip content" for=”panelid”/>
+<rich:toolTip value="This is a tooltip content" for="panelId"/>
...
-]]></programlisting>
- <para>Here, the attribute <emphasis><property>"for"</property></emphasis> of a <emphasis role="bold">
- <property><rich:toolTip></property>
- </emphasis> component is required. Without it an example doesn't work because HTML elements aren't presented in component tree built by facelets.
- </para>
-
+]]></programlisting>
<para>
-There is possibility to define a facet with the name "defaultContent". This facet provides the default content to
-display while the main content is loaded to a page in an Ajax mode. Thus when <property>toolTip</property> called in an Ajax mode, it
-appears with the content defined in the facet and when loading is completed, the content is changed to a loaded one.
-</para>
-<para>
- Here is an example:
-</para>
- <para>
+ Because HTML elements are not presented in components tree built by facelets,
+ use the attribute <emphasis><property>"for"</property></emphasis> with HTML elements as shown in example below.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<div id="elementId">
+ <rich:toolTip for="elementId">Using a toolTip</rich:toolTip>
+ <p>The first simple example</p>
+</div>
+...
+<div id="elementId">
+ <p>The second simple example</p>
+</div>
+<rich:toolTip for="elementId">Using a toolTip</rich:toolTip>
+...
+]]></programlisting>
+ <para>
+ <property>Tooltip</property> may also be invoked by JS API function.
+ List of JS API functions available for <emphasis role="bold"><property><rich:toolTip></property></emphasis> is listed <link linkend="tab_jsapi">below</link>.
+ JS API functions are defined for a page element, the <property>tooltip</property> is applied to. So, <property>tooltip</property> can be defined separately from that page element.
+ It is necessary to specify <emphasis><property>"ids"</property></emphasis> for both and set <property>tooltip</property> <emphasis><property>"attached"</property></emphasis> attribute's value to <emphasis><property>"false"</property></emphasis> (see the example below).
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:panel id="paneld" onclick="#{rich:component("tooltipId")}.show();">
+...
+</rich:panel>
+<rich:toolTip id="tooltipId" attached="false" value="This is a tooltip content"/>
+...
+]]></programlisting>
+ <para>
+ The component works properly in client and Ajax modes.
+ For Ajax mode there is possibility to define a facet "defaultContent", which provides default tooltip content to be displayed, while main content is loading into the <property>tooltip</property> (see the example below).
+ </para>
+ <para>
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
@@ -170,25 +193,8 @@
the "delay" attribute (default=0) or after calling JS API function show(). <property>toolTip</property> deactivation occurs after mouseout event on the parent component (excepting the situation when the mouse is hovered onto the <property>toolTip</property> itself) or after calling JS API function hide().
</para>
- <para>The attribute <emphasis><property>"for"</property></emphasis> is used for defining the <emphasis><property>"id"</property></emphasis> of an element a toolTip should be attached to. Look at the example:
-</para>
+
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
-<div id="elementId">
- <rich:toolTip for="elementId">Using a toolTip</rich:toolTip>
- <p>The first simple example</p>
-</div>
-...
-<div id="elementId">
- <p>The second simple example</p>
-</div>
-<rich:toolTip for="elementId">Using a toolTip</rich:toolTip>
-...
-]]></programlisting>
-
<para>
15 years, 11 months
JBoss Rich Faces SVN: r8901 - in trunk/sandbox/samples/darkX/src/main/resources: org/richfaces/skins/darkx/css and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-06-04 10:58:48 -0400 (Wed, 04 Jun 2008)
New Revision: 8901
Modified:
trunk/sandbox/samples/darkX/src/main/resources/META-INF/skins/darkX.skin.properties
trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/calendar.xcss
trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/contextmenu.xcss
trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/dataTable.xcss
trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/datascroller.xcss
trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/dropdownmenu.xcss
trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/fileUpload.xcss
trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/inplaceselect.xcss
trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/inputNumberSpinner.xcss
trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/sdt.xcss
trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/standard.xcss
trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/tabPanel.xcss
Log:
Modified: trunk/sandbox/samples/darkX/src/main/resources/META-INF/skins/darkX.skin.properties
===================================================================
--- trunk/sandbox/samples/darkX/src/main/resources/META-INF/skins/darkX.skin.properties 2008-06-04 14:07:49 UTC (rev 8900)
+++ trunk/sandbox/samples/darkX/src/main/resources/META-INF/skins/darkX.skin.properties 2008-06-04 14:58:48 UTC (rev 8901)
@@ -1,9 +1,9 @@
-baseSkin=wine
+baseSkin=classic
gradientType=plastic
generalStyleSheet=resource:///META-INF/skins/darkX.xcss
-headerBackgroundColor=#516738
+headerBackgroundColor=#1F4986
headerTextColor=#FFFFFF
-intShadow=#A69E78
-newBorder=#B6AD84
+intShadow=#c0c0c0
+newBorder=#ADADAD
generalTextColor=#474747
Modified: trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/calendar.xcss
===================================================================
--- trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/calendar.xcss 2008-06-04 14:07:49 UTC (rev 8900)
+++ trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/calendar.xcss 2008-06-04 14:58:48 UTC (rev 8901)
@@ -30,7 +30,7 @@
<u:selector name=".rich-calendar-cell">
<u:style name="border-color" skin="newBorder" />
-</u:selector>
+ </u:selector>
<u:selector name=".rich-calendar-tool">
<u:style name="background-repeat" value="repeat-x" />
@@ -248,7 +248,6 @@
</u:selector>
<u:selector name=".rich-calendar-cell-size">
- <u:style name="width" value="27px" />
</u:selector>
<u:selector name=".rich-calendar-cell-div">
Modified: trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/contextmenu.xcss
===================================================================
--- trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/contextmenu.xcss 2008-06-04 14:07:49 UTC (rev 8900)
+++ trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/contextmenu.xcss 2008-06-04 14:58:48 UTC (rev 8901)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<f:template xmlns:f='http:/jsf.exadel.com/template'
- xmlns:u='http:/jsf.exadel.com/template/util'
- xmlns="http://www.w3.org/1999/xhtml" >
-
- <u:selector name=".rich-cm-attached">
- </u:selector>
-
-
+<?xml version="1.0" encoding="UTF-8"?>
+<f:template xmlns:f='http:/jsf.exadel.com/template'
+ xmlns:u='http:/jsf.exadel.com/template/util'
+ xmlns="http://www.w3.org/1999/xhtml" >
+
+ <u:selector name=".rich-cm-attached">
+ </u:selector>
+
+
</f:template>
\ No newline at end of file
Modified: trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/dataTable.xcss
===================================================================
--- trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/dataTable.xcss 2008-06-04 14:07:49 UTC (rev 8900)
+++ trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/dataTable.xcss 2008-06-04 14:58:48 UTC (rev 8901)
@@ -31,26 +31,26 @@
</u:selector>
<u:selector name=".rich-table-header" >
- <u:style name="background-position" value="0% 50%" />
+ <u:style name="background-position" value="0% 0%" />
<u:style name="padding" value="6px " />
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
- <f:attribute name="valign" value="middle" />
+ <f:attribute name="valign" value="top" />
- <f:attribute name="gradientHeight" value="28px" />
+ <f:attribute name="gradientHeight" value="22px" />
<f:attribute name="baseColor" skin="headerBackgroundColor" />
</f:resource>
</u:style>
</u:selector>
<u:selector name=".rich-table-header-continue" >
- <u:style name="background-position" value="0% 50%" />
+ <u:style name="background-position" value="0% 100%" />
<u:style name="padding" value="6px " />
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
- <f:attribute name="valign" value="middle" />
+ <f:attribute name="valign" value="top" />
- <f:attribute name="gradientHeight" value="28px" />
+ <f:attribute name="gradientHeight" value="22px" />
<f:attribute name="baseColor" skin="headerBackgroundColor" />
</f:resource>
</u:style>
Modified: trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/datascroller.xcss
===================================================================
--- trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/datascroller.xcss 2008-06-04 14:07:49 UTC (rev 8900)
+++ trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/datascroller.xcss 2008-06-04 14:58:48 UTC (rev 8901)
@@ -8,16 +8,21 @@
<u:selector name=".rich-dtascroller-table">
<u:style name="border-color" skin="tableBorderColor" />
+ <u:style name="background-color" skin="generalBackgroundColor" />
</u:selector>
<u:selector name=".rich-datascr-button">
- <u:style name="border-color" skin="tableBorderColor" />
- <u:style name="background-position" value="0% 0%" />
+ <u:style name="border-color" skin="panelBorderColor" />
+ <u:style name="color" skin="headerTextColor" />
+ <u:style name="vertical-align" value="middle" />
+ <u:style name="font-size" value="150%" />
+ <u:style name="line-height" value="50%" />
+ <u:style name="background-position" value="0% 50%" />
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
- <f:attribute name="valign" value="top" />
+ <f:attribute name="valign" value="middle" />
- <f:attribute name="gradientHeight" value="16px" />
+ <f:attribute name="gradientHeight" value="22px" />
<f:attribute name="baseColor" skin="headerBackgroundColor" />
</f:resource>
</u:style>
@@ -25,12 +30,13 @@
<u:selector name=".rich-datascr-button-dsbld">
<u:style name="border-color" skin="tableBorderColor" />
- <u:style name="background-position" value="0% 0%" />
+ <u:style name="color" skin="panelBorderColor" />
+ <u:style name="background-position" value="0% 50%" />
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
- <f:attribute name="valign" value="top" />
+ <f:attribute name="valign" value="middle" />
- <f:attribute name="gradientHeight" value="16px" />
+ <f:attribute name="gradientHeight" value="22px" />
<f:attribute name="baseColor" skin="headerGradientColor" />
</f:resource>
</u:style>
@@ -43,5 +49,6 @@
</u:selector>
<u:selector name=".rich-datascr-inact">
+ <u:style name="color" skin="headerBackgroundColor" />
</u:selector>
</f:template>
\ No newline at end of file
Modified: trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/dropdownmenu.xcss
===================================================================
--- trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/dropdownmenu.xcss 2008-06-04 14:07:49 UTC (rev 8900)
+++ trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/dropdownmenu.xcss 2008-06-04 14:58:48 UTC (rev 8901)
@@ -16,6 +16,7 @@
</u:selector>
<u:selector name=".rich-menu-list-border">
+ <u:style name="background-color" skin="generalBackgroundColor" />
<u:style name="filter" value="alpha(opacity=90)" />
<u:style name="opacity" value="0.9" />
</u:selector>
Modified: trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/fileUpload.xcss
===================================================================
--- trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/fileUpload.xcss 2008-06-04 14:07:49 UTC (rev 8900)
+++ trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/fileUpload.xcss 2008-06-04 14:58:48 UTC (rev 8901)
@@ -17,6 +17,7 @@
</u:selector>
<u:selector name=".rich-fileupload-toolbar-decor">
+ <u:style name="background-color" skin="generalBackgroundColor" />
</u:selector>
<u:selector name=".rich-fileupload-button-border">
@@ -121,6 +122,7 @@
</u:selector>
<u:selector name=".rich-fileupload-list-overflow">
+ <u:style name="background-color" skin="generalBackgroundColor" />
</u:selector>
</f:template>
Modified: trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/inplaceselect.xcss
===================================================================
--- trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/inplaceselect.xcss 2008-06-04 14:07:49 UTC (rev 8900)
+++ trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/inplaceselect.xcss 2008-06-04 14:58:48 UTC (rev 8901)
@@ -30,20 +30,6 @@
<u:selector name=".rich-inplace-select-list-decoration">
</u:selector>
- <u:selector name=".rich-inplace-select-selected-item">
- <u:style name="background-position" value="0% 50%" />
- <u:style name="border-color" skin="newBorder" />
- <u:style name="color" skin="headerTextColor" />
- <u:style name="background-image">
- <f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
- <f:attribute name="valign" value="middle" />
-
- <f:attribute name="gradientHeight" value="36px" />
- <f:attribute name="baseColor" skin="headerBackgroundColor" />
- </f:resource>
- </u:style>
- </u:selector>
-
<u:selector name=".rich-inplace-select-shadow-tl">
</u:selector>
@@ -98,4 +84,17 @@
<u:selector name=".rich-inplace-select-changed-hover">
</u:selector>
+ <u:selector name=".rich-inplace-select-selected-item">
+ <u:style name="background-position" value="0% 50%" />
+ <u:style name="border-color" skin="newBorder" />
+ <u:style name="color" skin="headerTextColor" />
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
+ <f:attribute name="valign" value="middle" />
+ <f:attribute name="gradientHeight" value="36px" />
+ <f:attribute name="baseColor" skin="headerBackgroundColor" />
+ </f:resource>
+ </u:style>
+ </u:selector>
+
</f:template>
\ No newline at end of file
Modified: trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/inputNumberSpinner.xcss
===================================================================
--- trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/inputNumberSpinner.xcss 2008-06-04 14:07:49 UTC (rev 8900)
+++ trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/inputNumberSpinner.xcss 2008-06-04 14:58:48 UTC (rev 8901)
@@ -9,7 +9,7 @@
<u:selector name=".rich-spinner-c">
</u:selector>
- <u:selector name=".dr-spnr-b">
+ <u:selector name=".rich-spinner-buttons">
<u:style name="background-position" value="0% 50%" />
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
@@ -19,6 +19,7 @@
<f:attribute name="baseColor" skin="headerBackgroundColor" />
</f:resource>
</u:style>
+ <u:style name="border-style" value="outset" />
</u:selector>
<u:selector name=".rich-spinner-button">
Modified: trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/sdt.xcss
===================================================================
--- trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/sdt.xcss 2008-06-04 14:07:49 UTC (rev 8900)
+++ trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/sdt.xcss 2008-06-04 14:58:48 UTC (rev 8901)
@@ -29,7 +29,7 @@
</u:selector>
<u:selector name=".rich-sdt-header-cell" >
- <u:style name="padding-top" value="3px" />
+ <u:style name="padding-top" value="5px" />
<u:style name="background-position" value="0% 50%" />
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
Modified: trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/standard.xcss
===================================================================
--- trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/standard.xcss 2008-06-04 14:07:49 UTC (rev 8900)
+++ trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/standard.xcss 2008-06-04 14:58:48 UTC (rev 8901)
@@ -46,6 +46,45 @@
</u:style>
</u:selector>
+ <u:selector name="*|button[disabled]">
+ <u:style name="font-weight" value="bold" />
+ <u:style name="border-color" skin="panelBorderColor" />
+ <u:style name="font-size" skin="generalSizeFont" />
+ <u:style name="font-family" skin="generalFamilyFont" />
+ <u:style name="background-color" skin="panelBorderColor" />
+ <u:style name="padding" value="2px 0px 1px 0px " />
+
+ <u:style name="background-position" value="0% 50%" />
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
+ <f:attribute name="valign" value="middle" />
+
+ <f:attribute name="gradientHeight" value="36px" />
+ <f:attribute name="baseColor" skin="panelBorderColor" />
+ </f:resource>
+ </u:style>
+ </u:selector>
+
+ <u:selector name="button[type="button"][disabled], button[type="reset"][disabled], button[type="submit"][disabled],
+ input[type="reset"][disabled], input[type="submit"][disabled], input[type="button"][disabled]">
+ <u:style name="font-weight" value="bold" />
+ <u:style name="border-color" skin="panelBorderColor" />
+ <u:style name="font-size" skin="generalSizeFont" />
+ <u:style name="font-family" skin="generalFamilyFont" />
+ <u:style name="background-color" skin="panelBorderColor" />
+ <u:style name="padding" value="2px 0px 1px 0px " />
+
+ <u:style name="background-position" value="0% 50%" />
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
+ <f:attribute name="valign" value="middle" />
+
+ <f:attribute name="gradientHeight" value="36px" />
+ <f:attribute name="baseColor" skin="panelBorderColor" />
+ </f:resource>
+ </u:style>
+ </u:selector>
+
<u:selector name=".rich-input" >
Modified: trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/tabPanel.xcss
===================================================================
--- trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/tabPanel.xcss 2008-06-04 14:07:49 UTC (rev 8900)
+++ trunk/sandbox/samples/darkX/src/main/resources/org/richfaces/skins/darkx/css/tabPanel.xcss 2008-06-04 14:58:48 UTC (rev 8901)
@@ -17,7 +17,7 @@
</u:selector>
<u:selector name=".rich-tab-active">
- <u:style name="color" skin="headerTextColor" />
+ <u:style name="color" skin="generalTextColor" />
<u:style name="background-position" value="0% 0%" />
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
@@ -32,23 +32,25 @@
<u:selector name=".rich-tab-inactive">
<u:style name="background-position" value="0% 50%" />
+ <u:style name="color" skin="generalTextColor" />
+ <u:style name="background-color" skin="generalBackgroundColor" />
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
<f:attribute name="valign" value="middle" />
<f:attribute name="gradientHeight" value="22px" />
- <f:attribute name="baseColor" skin="headerBackgroundColor" />
+ <f:attribute name="baseColor" skin="panelBorderColor" />
</f:resource>
</u:style>
</u:selector>
<u:selector name=".rich-tab-disabled">
- <u:style name="color" skin="generalBackgroundColor" />
+ <u:style name="color" skin="tabDisabledTextColor" />
<u:style name="background-position" value="0% 50%" />
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
<f:attribute name="valign" value="middle" />
<f:attribute name="gradientHeight" value="22px" />
- <f:attribute name="baseColor" skin="headerBackgroundColor" />
+ <f:attribute name="baseColor" skin="panelBorderColor" />
</f:resource>
</u:style>
</u:selector>
15 years, 11 months
JBoss Rich Faces SVN: r8900 - in trunk/test-applications/seleniumTest/src: main/java/org/ajax4jsf/template and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-06-04 10:07:49 -0400 (Wed, 04 Jun 2008)
New Revision: 8900
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/TestConstants.java
Removed:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java
Modified:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/Template.java
trunk/test-applications/seleniumTest/src/main/webapp/layout/controlLayout.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/RichSeleniumTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java
Log:
refactoring
Modified: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -21,53 +21,60 @@
package org.ajax4jsf.bean;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
import org.ajax4jsf.template.Template;
-
public class TemplateBean {
- public static final String PARAM_NAME = "t";
-
- private String template = "simple";
+ public static final String PARAM_NAME = "t";
- /*public void initTemplate (ActionEvent event) {
- Map<String, String> reqMap = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
- String template = reqMap.get(PARAM_NAME);
- this.template = template != null ? template : "simple";
- }*/
-
- public String getTemplateId() {
- return template;
- }
-
- public void setTemplateId(String template) {
- if (this.template != null && !this.template.equals(template)) {
- this.template = template;
- }
- }
-
-
- public String getParentId () {
- if ("dataTable".equals(template)) {
- return Template.COMPONENT_PREFIX_INSIDE_TABLE;
- }
- return Template.COMPONENT_PREFIX_SIMPLE;
- }
+ private Template template = Template.SIMPLE;
+ /*
+ * public void initTemplate (ActionEvent event) { Map<String, String>
+ * reqMap =
+ * FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ * String template = reqMap.get(PARAM_NAME); this.template = template !=
+ * null ? template : "simple"; }
+ */
- /**
- * @return the template
- */
- public String getTemplate() {
- return "../../template/" + template + ".xhtml";
- }
+ public String getTemplateId() {
+ return template.toString();
+ }
+ public void setTemplateId(String template) {
+ this.template = Template.valueOf(template);
+ }
- /**
- * @param template the template to set
- */
- public void setTemplate(String template) {
- this.template = template;
- }
-
-
+ public String getParentId() {
+ return template.getPrefix();
+ }
+
+ /**
+ * @return the template
+ */
+ public String getTemplate() {
+ return "../../template/" + template.getName() + ".xhtml";
+ }
+
+ /**
+ * @param template
+ * the template to set
+ */
+ public void setTemplate(Template template) {
+ this.template = template;
+ }
+
+ public List<SelectItem> getAvailableTemplates() {
+ List<SelectItem> retVal = new ArrayList<SelectItem>();
+ for (Template template : Template.values()) {
+ retVal.add(new SelectItem(template.toString(), template.getDesc()));
+ }
+
+ return retVal;
+ }
+
}
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/Template.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/Template.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/Template.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,9 +1,55 @@
package org.ajax4jsf.template;
-public interface Template {
+/**
+ * Kids of templates that can be put in harness.
+ * @author carcasser
+ *
+ */
+public enum Template implements TestConstants {
+ SIMPLE (SIMPLE_TEMPLATE_NAME, COMPONENT_PREFIX_SIMPLE, SIMPLE_TEMPLATE_DESC),
+ DATA_TABLE (DATA_TABLE_TEMPLATE_NAME, COMPONENT_PREFIX_INSIDE_TABLE, DATA_TABLE_TEMPLATE_DESC),
+ MODAL_PANEL (MODAL_PANEL_TEMPLATE_NAME, COMPONENT_PREFIX_SIMPLE, MODAL_PANEL_TEMPLATE_DESC);
- public static final String COMPONENT_PREFIX_INSIDE_TABLE = "_Selenium_Test_DataTable:0:";
+ private String name;
- public static final String COMPONENT_PREFIX_SIMPLE = "";
-
+ private String prefix;
+
+ private String desc;
+
+ /**
+ * Private constructor.
+ *
+ * @param name
+ * @param prefix
+ */
+ private Template(String name, String prefix, String desc) {
+ this.name = name;
+ this.prefix = prefix;
+ this.desc = desc;
+ }
+
+ /**
+ * Gets value of name field.
+ * @return value of name field
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Gets value of prefix field.
+ * @return value of prefix field
+ */
+ public String getPrefix() {
+ return prefix;
+ }
+
+ /**
+ * Gets value of desc field.
+ * @return value of desc field
+ */
+ public String getDesc() {
+ return desc;
+ }
+
}
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/TestConstants.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/TestConstants.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/TestConstants.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -0,0 +1,19 @@
+package org.ajax4jsf.template;
+
+public interface TestConstants {
+
+ /* Constants of component prefixes */
+ public static final String COMPONENT_PREFIX_INSIDE_TABLE = "_Selenium_Test_DataTable:0:";
+ public static final String COMPONENT_PREFIX_SIMPLE = "";
+
+ /* Constants of template names */
+ public static final String SIMPLE_TEMPLATE_NAME = "simple";
+ public static final String DATA_TABLE_TEMPLATE_NAME = "dataTable";
+ public static final String MODAL_PANEL_TEMPLATE_NAME = "modalPanel";
+
+ /* Constants of template descriptions */
+ public static final String SIMPLE_TEMPLATE_DESC = "Simple";
+ public static final String DATA_TABLE_TEMPLATE_DESC = "DataTable";
+ public static final String MODAL_PANEL_TEMPLATE_DESC = "Modal Panel";
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/TestConstants.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/seleniumTest/src/main/webapp/layout/controlLayout.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/layout/controlLayout.xhtml 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/main/webapp/layout/controlLayout.xhtml 2008-06-04 14:07:49 UTC (rev 8900)
@@ -12,9 +12,7 @@
</td>
<td>
<h:selectOneMenu value="#{templateBean.templateId}" id="_Selenium_Test_Template_id">
- <f:selectItem itemValue="simple" itemLabel="Simple"/>
- <f:selectItem itemValue="dataTable" itemLabel="DataTable"/>
- <f:selectItem itemValue="modalPanel" itemLabel="Modal Panel"/>
+ <f:selectItems value="#{templateBean.availableTemplates}" />
</h:selectOneMenu>
</td>
<td>
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/RichSeleniumTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/RichSeleniumTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/RichSeleniumTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,11 +1,11 @@
package org.richfaces;
public interface RichSeleniumTest {
-
- public void startSelenium (String browser);
-
- public void stopSelenium();
-
- public String getTestUrl();
-
+
+ public void startSelenium(String browser);
+
+ public void stopSelenium();
+
+ public String getTestUrl();
+
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -22,6 +22,7 @@
package org.richfaces;
import org.ajax4jsf.javascript.ScriptUtils;
+import org.ajax4jsf.template.Template;
import org.testng.Assert;
import com.thoughtworks.selenium.DefaultSelenium;
@@ -91,55 +92,59 @@
selenium.start();
}
- /**
- * Renders page
- */
- @Deprecated
- protected void renderPage(String homePage) {
- selenium.open(protocol + "://" + host + ":" + port + "/" + APPLICATION_NAME + homePage);
- selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+// /**
+// * Renders page
+// */
+// @Deprecated
+// protected void renderPage(String homePage) {
+// selenium.open(protocol + "://" + host + ":" + port + "/" + APPLICATION_NAME + homePage);
+// selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+//
+// checkPageRendering(); // At the first we check if page has been
+// // rendered
+// checkJSError(); // At the second we check if JS errors occurred
+//
+// // reRenderForm(); // ReRender component
+//
+// // checkPageRendering(); // Check all again
+// // checkJSError();
+//
+// }
- checkPageRendering(); // At the first we check if page has been
- // rendered
- checkJSError(); // At the second we check if JS errors occurred
-
- // reRenderForm(); // ReRender component
-
- // checkPageRendering(); // Check all again
- // checkJSError();
-
- }
-
- /**
- * Renders page
- */
- @Deprecated
- protected void renderPage(String homePage, Templates template) {
- selenium.open(protocol + "://" + host + ":" + port + "/" + APPLICATION_NAME + homePage);
- selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
-
- template.loadTemplate(this);
-
- checkPageRendering(); // At the first we check if page has been
- // rendered
- checkJSError(); // At the second we check if JS errors occurred
-
- reRenderForm(); // ReRender component
-
- checkPageRendering(); // Check all again
- checkJSError();
-
- }
+// /**
+// * Renders page
+// */
+// @Deprecated
+// protected void renderPage(String homePage, Template template) {
+// selenium.open(protocol + "://" + host + ":" + port + "/" + APPLICATION_NAME + homePage);
+// selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+//
+// setParentId(template.getPrefix());
+// runScript("loadTemplate('" + template.getName() + "');", false);
+// waitForPageToLoad();
+//
+// checkPageRendering(); // At the first we check if page has been
+// // rendered
+// checkJSError(); // At the second we check if JS errors occurred
+//
+// reRenderForm(); // ReRender component
+//
+// checkPageRendering(); // Check all again
+// checkJSError();
+//
+// }
/**
* Renders page
*/
- protected void renderPage(Templates template) {
+ protected void renderPage(Template template) {
selenium.open(protocol + "://" + host + ":" + port + "/" + APPLICATION_NAME + getTestUrl());
selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
-
- template.loadTemplate(this);
+ setParentId(template.getPrefix());
+ runScript("loadTemplate('" + template + "');", false);
+ waitForPageToLoad();
+
checkPageRendering(); // At the first we check if page has been
// rendered
checkJSError(); // At the second we check if JS errors occurred
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,48 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.template.Template;
-
-
-
-public class Templates implements Template {
-
- private String template = null;
-
- public Templates(String name) {
- template = name;
- }
-
- public static Templates SIMPLE = new Templates("simple");
-
- public static Templates DATATABLE = new Templates("dataTable");
-
- public static Templates MODALPANEL = new Templates("modalPanel");
-
- private void setParentId(SeleniumTestBase test) {
- if ("dataTable".equals(template)) {
- test.setParentId(COMPONENT_PREFIX_INSIDE_TABLE);
- } else {
- test.setParentId(COMPONENT_PREFIX_SIMPLE);
- }
- }
-
- public void loadTemplate(SeleniumTestBase test) {
- setParentId(test);
- test.runScript("loadTemplate('" + template + "');", false);
- test.waitForPageToLoad();
- }
-
- public boolean equals(Object obj) {
- if (obj == null || !(obj instanceof Templates)) {
- return false;
- }
- Templates template = (Templates) obj;
- if (template.template.equals(this.template)) {
- return true;
- }
- return false;
- }
-
-
-
-}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -35,12 +35,12 @@
@Test
public void testAjaxCommandButtonComponent() throws Exception {
- _testAjaxCommandButtonComponent(Templates.SIMPLE);
- _testAjaxCommandButtonComponent(Templates.DATATABLE);
- _testAjaxCommandButtonComponent(Templates.MODALPANEL);
+ _testAjaxCommandButtonComponent(Template.SIMPLE);
+ _testAjaxCommandButtonComponent(Template.DATA_TABLE);
+ _testAjaxCommandButtonComponent(Template.MODAL_PANEL);
}
- private void _testAjaxCommandButtonComponent(Templates template) {
+ private void _testAjaxCommandButtonComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
@@ -84,8 +84,6 @@
waitForAjaxCompletion();
waitForOnCompleteHndler();
checkButton(buttonId, true, ajaxSingle, immediate, true, true, true, false);
-
-
}
private void setValidation(boolean success) {
@@ -122,8 +120,8 @@
}
- public String getTestUrl() {
- return "/faces/pages/ajaxCommandButton/ajaxButtonTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/ajaxCommandButton/ajaxButtonTest.xhtml";
+ }
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -15,7 +15,7 @@
public AjaxCommandLinkTest() {
super("http", "localhost", serverPort);
}
-
+
/**
* This method are invoking before selenium tests started
*/
@@ -35,16 +35,16 @@
@Test
public void testAjaxCommandLinkComponent() throws Exception {
- _testAjaxCommandLinkComponent(Templates.SIMPLE);
- _testAjaxCommandLinkComponent(Templates.DATATABLE);
- _testAjaxCommandLinkComponent(Templates.MODALPANEL);
+ _testAjaxCommandLinkComponent(Template.SIMPLE);
+ _testAjaxCommandLinkComponent(Template.DATA_TABLE);
+ _testAjaxCommandLinkComponent(Template.MODAL_PANEL);
}
- private void _testAjaxCommandLinkComponent(Templates template) {
+ private void _testAjaxCommandLinkComponent(Template template) {
renderPage(template);
-
+
String parentId = getParentId() + "_form:";
-
+
String linkId = parentId + "l1";
boolean ajaxSingle = false;
boolean immediate = false;
@@ -122,8 +122,8 @@
}
- public String getTestUrl() {
- return "/faces/pages/ajaxCommandLink/ajaxLinkTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/ajaxCommandLink/ajaxLinkTest.xhtml";
+ }
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -3,9 +3,9 @@
*/
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -18,74 +18,76 @@
*/
public class AjaxPollTest extends SeleniumTestBase implements RichSeleniumTest {
- public AjaxPollTest() {
- super("http", "localhost", serverPort);
- }
+ public AjaxPollTest() {
+ super("http", "localhost", serverPort);
+ }
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeTest
- @Parameters( { "browser" })
- public void startSelenium(String browser) {
- super.startSelenium(browser);
- }
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterTest
- public void stopSelenium() {
- super.stopSelenium();
- }
-
- @Test
- public void testAjaxPollComponent() {
- _testAjaxPollComponent(Templates.SIMPLE);
- _testAjaxPollComponent(Templates.DATATABLE);
- _testAjaxPollComponent(Templates.MODALPANEL);
- }
-
- private void _testAjaxPollComponent(Templates template) {
- renderPage(template);
- String parentId = getParentId() + "_form:";
- String pollId = parentId + "poll";
- String inputId = parentId + "_value";
-
- enablePoll(parentId + "_enabled");
- AssertValueEquals(inputId, "1");
-
- writeStatus("Polling in progress...");
- pause(1500, pollId);
- AssertValueNotEquals(inputId, "1", "Polling does not fire after component was enabled. Or 'ReRender' attribute does not work");
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
- waiteForCondition("document.getElementById('"+inputId+"').value == 8", 7000);
-
- pause(1500, pollId);
- writeStatus("Polling should be stopped...");
-
- AssertValueEquals(inputId, "8", "Polling should be stopped. It continues to poll after component was disabled.");
- AssertTextEquals(parentId + "_text", "Polling", "Polling terminated abnormal or invalid count of ajax requests has been submitted");
+ @Test
+ public void testAjaxPollComponent() {
+ _testAjaxPollComponent(Template.SIMPLE);
+ _testAjaxPollComponent(Template.DATA_TABLE);
+ _testAjaxPollComponent(Template.MODAL_PANEL);
+ }
- }
-
- private void enablePoll(String id) {
- writeStatus("Enable polling...");
- try {
- clickById(id);
- waitForAjaxCompletion();
- }catch (Exception e) {
- Assert.fail("Poll component failed after attempt to enable polling. Caused by " + e);
- }
- }
+ private void _testAjaxPollComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form:";
+ String pollId = parentId + "poll";
+ String inputId = parentId + "_value";
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.test.base.RichSeleniumTest#getTestUrl()
- */
- public String getTestUrl() {
- return "/faces/pages/ajaxPoll/ajaxPollTest.xhtml";
- }
+ enablePoll(parentId + "_enabled");
+ AssertValueEquals(inputId, "1");
+ writeStatus("Polling in progress...");
+ pause(1500, pollId);
+ AssertValueNotEquals(inputId, "1",
+ "Polling does not fire after component was enabled. Or 'ReRender' attribute does not work");
+
+ waiteForCondition("document.getElementById('" + inputId + "').value == 8", 7000);
+
+ pause(1500, pollId);
+ writeStatus("Polling should be stopped...");
+
+ AssertValueEquals(inputId, "8", "Polling should be stopped. It continues to poll after component was disabled.");
+ AssertTextEquals(parentId + "_text", "Polling",
+ "Polling terminated abnormal or invalid count of ajax requests has been submitted");
+
+ }
+
+ private void enablePoll(String id) {
+ writeStatus("Enable polling...");
+ try {
+ clickById(id);
+ waitForAjaxCompletion();
+ } catch (Exception e) {
+ Assert.fail("Poll component failed after attempt to enable polling. Caused by " + e);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.test.base.RichSeleniumTest#getTestUrl()
+ */
+ public String getTestUrl() {
+ return "/faces/pages/ajaxPoll/ajaxPollTest.xhtml";
+ }
+
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -33,13 +33,13 @@
@Test
public void testAjaxRegionComponent() throws Exception {
- _testAjaxRegionComponent(Templates.SIMPLE);
- _testAjaxRegionComponent(Templates.DATATABLE);
- _testAjaxRegionComponent(Templates.MODALPANEL);
+ _testAjaxRegionComponent(Template.SIMPLE);
+ _testAjaxRegionComponent(Template.DATA_TABLE);
+ _testAjaxRegionComponent(Template.MODAL_PANEL);
}
- private void _testAjaxRegionComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testAjaxRegionComponent(Template template) {
+ renderPage(template);
String parentId = getParentId() + "_form:";
@@ -96,8 +96,8 @@
AssertValueEquals(renderElemId, "11");
}
- public String getTestUrl() {
- return "/faces/pages/ajaxRegion/ajaxRegionTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/ajaxRegion/ajaxRegionTest.xhtml";
+ }
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -34,13 +34,13 @@
@Test
public void testAjaxStatusComponent() throws Exception {
- _testAjaxStatusComponent(Templates.SIMPLE);
- _testAjaxStatusComponent(Templates.DATATABLE);
- _testAjaxStatusComponent(Templates.MODALPANEL);
+ _testAjaxStatusComponent(Template.SIMPLE);
+ _testAjaxStatusComponent(Template.DATA_TABLE);
+ _testAjaxStatusComponent(Template.MODAL_PANEL);
}
- private void _testAjaxStatusComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testAjaxStatusComponent(Template template) {
+ renderPage(template);
String parentId = getParentId() + "_form:";
String btn1 = parentId + "button1";
@@ -85,7 +85,7 @@
}
- public String getTestUrl() {
- return "/faces/pages/ajaxStatus/ajaxStatusTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/ajaxStatus/ajaxStatusTest.xhtml";
+ }
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -25,9 +25,9 @@
import java.util.Date;
import org.ajax4jsf.bean.CalendarTestBean;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -63,14 +63,14 @@
@Test
public void testContextMenuComponent() throws Exception {
- _testSelectDateComponent(Templates.SIMPLE);
- _testCalendarComponent(Templates.DATATABLE);
- _testCalendarComponent(Templates.MODALPANEL);
+ _testSelectDateComponent(Template.SIMPLE);
+ _testCalendarComponent(Template.DATA_TABLE);
+ _testCalendarComponent(Template.MODAL_PANEL);
}
-
- private void _testCalendarComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
+
+ private void _testCalendarComponent(Template template) {
+ renderPage(template);
+
String containerId = getParentId() + "_form:";
String calendarOpenedId = containerId + "calendar";
String calendarCollapsedId = calendarOpenedId + "Popup";
@@ -96,8 +96,8 @@
Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
}
- private void _testSelectDateComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testSelectDateComponent(Template template) {
+ renderPage(template);
Date newSelectedDate = CalendarTestBean.getDayInMay(15);
@@ -137,9 +137,7 @@
}
Assert.assertEquals(readDate, newSelectedDate, "Date representation after selecting 15.May.2008 is wrong!");
- Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
-
-
+ Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
}
public String getTestUrl() {
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -34,13 +34,13 @@
@Test
public void testComboBoxComponent() throws Exception {
- _testComboBoxComponent(Templates.SIMPLE);
- _testComboBoxComponent(Templates.DATATABLE);
- _testComboBoxComponent(Templates.MODALPANEL);
+ _testComboBoxComponent(Template.SIMPLE);
+ _testComboBoxComponent(Template.DATA_TABLE);
+ _testComboBoxComponent(Template.MODAL_PANEL);
}
- private void _testComboBoxComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testComboBoxComponent(Template template) {
+ renderPage(template);
String parentId = getParentId() + "_form:";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -21,9 +21,9 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -31,94 +31,93 @@
import org.testng.annotations.Test;
public class ContextMenuTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public ContextMenuTest() {
- super("http", "localhost", serverPort);
- }
- /**
+ public ContextMenuTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
@BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
@AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
+
@Test
public void testContextMenuComponent() throws Exception {
- _testContextMenuComponent(Templates.SIMPLE);
- _testContextMenuComponent(Templates.DATATABLE);
- _testContextMenuComponent(Templates.MODALPANEL);
+ _testContextMenuComponent(Template.SIMPLE);
+ _testContextMenuComponent(Template.DATA_TABLE);
+ _testContextMenuComponent(Template.MODAL_PANEL);
}
- private void _testContextMenuComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
- String inputId = parentId + "input";
- String input2Id = parentId + "input2";
- String outputId = parentId + "_value2";
- String menuId = parentId + "menu_input_menu";
- String menu2Id = parentId + "menu_input2_menu";
-
- String menu1_item_ajax = parentId + "menu1_item1";
- String menu1_item_server = parentId + "menu1_item2";
- String menu2_item_ajax = parentId + "menu2_item1";
- String menu2_item_server = parentId + "menu2_item2";
-
- writeStatus("Click on first input");
- clickById(inputId);
- Assert.assertTrue(isVisibleById(menuId));
-
- writeStatus("Click on second input");
- clickById(input2Id);
- Assert.assertFalse(isVisibleById(menuId));
- Assert.assertTrue(isVisibleById(menu2Id));
-
- writeStatus("Click on first input again");
- clickById(inputId);
- Assert.assertTrue(isVisibleById(menuId));
- Assert.assertFalse(isVisibleById(menu2Id));
-
- writeStatus("Click on ajax item in first menu");
- clickById(menu1_item_ajax);
+ private void _testContextMenuComponent(Template template) {
+ renderPage(template);
+
+ String parentId = getParentId() + "_form:";
+ String inputId = parentId + "input";
+ String input2Id = parentId + "input2";
+ String outputId = parentId + "_value2";
+ String menuId = parentId + "menu_input_menu";
+ String menu2Id = parentId + "menu_input2_menu";
+
+ String menu1_item_ajax = parentId + "menu1_item1";
+ String menu1_item_server = parentId + "menu1_item2";
+ String menu2_item_ajax = parentId + "menu2_item1";
+ String menu2_item_server = parentId + "menu2_item2";
+
+ writeStatus("Click on first input");
+ clickById(inputId);
+ Assert.assertTrue(isVisibleById(menuId));
+
+ writeStatus("Click on second input");
+ clickById(input2Id);
+ Assert.assertFalse(isVisibleById(menuId));
+ Assert.assertTrue(isVisibleById(menu2Id));
+
+ writeStatus("Click on first input again");
+ clickById(inputId);
+ Assert.assertTrue(isVisibleById(menuId));
+ Assert.assertFalse(isVisibleById(menu2Id));
+
+ writeStatus("Click on ajax item in first menu");
+ clickById(menu1_item_ajax);
waitForAjaxCompletion();
AssertValueEquals(inputId, "menu1_item1");
AssertTextEquals(outputId, "1");
-
+
writeStatus("Click on server item in first menu");
clickCommandAndWait(menu1_item_server);
AssertValueEquals(inputId, "menu1_item2");
AssertTextEquals(outputId, "2");
-
+
writeStatus("Click on second input again");
- clickById(input2Id);
- Assert.assertTrue(isVisibleById(menu2Id));
-
- writeStatus("Click on ajax item in first menu");
- clickById(menu2_item_ajax);
+ clickById(input2Id);
+ Assert.assertTrue(isVisibleById(menu2Id));
+
+ writeStatus("Click on ajax item in first menu");
+ clickById(menu2_item_ajax);
waitForAjaxCompletion();
AssertValueEquals(inputId, "menu2_item1");
AssertTextEquals(outputId, "3");
-
+
writeStatus("Click on server item in second menu");
clickCommandAndWait(menu2_item_server);
AssertValueEquals(inputId, "menu2_item2");
AssertTextEquals(outputId, "4");
- }
-
- public String getTestUrl() {
- return "/faces/pages/contextMenu/contextMenu.xhtml";
- }
+ }
-}
+ public String getTestUrl() {
+ return "/faces/pages/contextMenu/contextMenu.xhtml";
+ }
+}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -10,226 +10,220 @@
import org.testng.annotations.Test;
public class DataTableTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public DataTableTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeTest
- @Parameters( { "browser" })
- public void startSelenium(String browser) {
- super.startSelenium(browser);
- }
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterTest
- public void stopSelenium() {
- super.stopSelenium();
- }
-
- public String getTestUrl() {
- return "/faces/pages/dataTable/dataTableTest.xhtml";
- }
-
- @Test
- public void testDataTable() {
- _testDataTable(Templates.SIMPLE);
- }
-
- private void _testDataTable(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
- String dataTableId = parentId + "table";
-
- writeStatus("Check columns count equals to 3 ");
- assertColumnsCount(3, dataTableId);
- writeStatus("Check rows count equals to 22 ");
- assertRowsCount(22, dataTableId);
+ public DataTableTest() {
+ super("http", "localhost", serverPort);
+ }
- String columnsId = getColumnId(dataTableId, 0);
-
- writeStatus("Check inputs' values ");
- assertInputValue(dataTableId, 0, columnsId, "0");
- assertInputValue(dataTableId, 5, columnsId, "5");
- assertInputValue(dataTableId, 19, columnsId, "19");
-
- columnsId = getColumnId(dataTableId, 1);
-
- assertInputValue(dataTableId, 0, columnsId, "1");
- assertInputValue(dataTableId, 7, columnsId, "8");
- assertInputValue(dataTableId, 19, columnsId, "20");
-
- columnsId = getColumnId(dataTableId, 2);
-
- assertInputValue(dataTableId, 0, columnsId, "2");
- assertInputValue(dataTableId, 11, columnsId, "13");
- assertInputValue(dataTableId, 19, columnsId, "21");
-
- writeStatus("Insert some values ");
- insertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
- insertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
-
- writeStatus("Rerender table");
- clickById("_form:submit");
- waitForAjaxCompletion();
-
- writeStatus("Check values entered ");
- assertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
- assertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
-
- columnsId = getColumnId(dataTableId, 0);
-
- writeStatus("Sort ASC by 1'st column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "000");
- assertInputValue(dataTableId, 1, columnsId, "1");
- assertInputValue(dataTableId, 18, columnsId, "8");
- assertInputValue(dataTableId, 19, columnsId, "9");
-
- writeStatus("Sort DESC by 1'st column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "9");
- assertInputValue(dataTableId, 1, columnsId, "8");
- assertInputValue(dataTableId, 18, columnsId, "1");
- assertInputValue(dataTableId, 19, columnsId, "000");
-
- columnsId = getColumnId(dataTableId, 2);
-
- writeStatus("Sort ASC by 3'st column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "10");
- assertInputValue(dataTableId, 1, columnsId, "11");
- assertInputValue(dataTableId, 18, columnsId, "8");
- assertInputValue(dataTableId, 19, columnsId, "9");
-
- writeStatus("Set columns count == 5, rows count == 10");
- changeColumnCount(10, 5, 0 ,100);
-
-
- writeStatus("Check columns count equals to 5 ");
- assertColumnsCount(5, dataTableId);
- writeStatus("Check rows count equals to 12 ");
- assertRowsCount(12, dataTableId);
-
- columnsId = getColumnId(dataTableId, 0);
-
- writeStatus("Check inputs' values ");
- assertInputValue(dataTableId, 0, columnsId, "0");
- assertInputValue(dataTableId, 5, columnsId, "5");
- assertInputValue(dataTableId, 9, columnsId, "9");
-
- columnsId = getColumnId(dataTableId, 1);
-
- assertInputValue(dataTableId, 0, columnsId, "1");
- assertInputValue(dataTableId, 7, columnsId, "8");
- assertInputValue(dataTableId, 9, columnsId, "10");
-
- columnsId = getColumnId(dataTableId, 4);
-
- assertInputValue(dataTableId, 0, columnsId, "4");
- assertInputValue(dataTableId, 2, columnsId, "6");
- assertInputValue(dataTableId, 9, columnsId, "13");
-
- writeStatus("Sort ASC by the last column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "10");
- assertInputValue(dataTableId, 2, columnsId, "12");
- assertInputValue(dataTableId, 9, columnsId, "9");
-
- writeStatus("Sort DESC by the last column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "9");
- assertInputValue(dataTableId, 2, columnsId, "7");
- assertInputValue(dataTableId, 9, columnsId, "10");
-
- columnsId = getColumnId(dataTableId, 2);
- writeStatus("Sort ASC by the 3d column ");
- sortColumn(dataTableId, columnsId);
-
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "10");
- assertInputValue(dataTableId, 2, columnsId, "2");
- assertInputValue(dataTableId, 9, columnsId, "9");
-
- changeColumnCount(2, 5, 2 ,2);
- assertColumnsCount(1, dataTableId);
- assertRowsCount(4, dataTableId);
-
- changeColumnCount(10, 5, 10 ,0);
- assertRowsCount(0, dataTableId);
-
-
-
- }
-
- private String getColumnId (String tableId, int i) {
- String script = "$('"+tableId+"').rows[0].cells["+String.valueOf(i)+"].id";
- String id = runScript(script);
- id = id.replace(tableId + ":", "");
- id = id.replace("header", "");
- return id;
- }
-
- private void changeColumnCount(int rows, int columns, int begin, int end) {
- String script = "$('_controls:rows').value='" + String.valueOf(rows) + "';";
- runScript(script);
- script = "$('_controls:column').value='" + String.valueOf(columns) + "';";
- runScript(script);
- script = "$('_controls:begin').value='" + String.valueOf(begin) + "';";
- runScript(script);
- script = "$('_controls:end').value='" + String.valueOf(end) + "';";
- runScript(script);
- clickById("_controls:apply");
- waitForAjaxCompletion();
- }
-
- private void sortColumn(String tableId, String columnId) {
- clickById(tableId + ":" + columnId + "header");
- waitForAjaxCompletion();
- }
-
-
- private void insertInputValue(String tableId, int row, String inputId, String value) {
- String id = tableId + ":"+row+":"+inputId;
- String script = ("$('" + id + "').firstChild.value='" + value + "';");
- runScript(script);
- }
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
-
- private void assertInputValue(String tableId, int row, String inputId, String value) {
- String id = tableId + ":"+row+":"+inputId;
- String script = "$('" + id + "').firstChild.value";
- Assert.assertEquals(runScript(script), value);
- }
-
-
- private void assertColumnsCount(int i, String tableId) {
- StringBuffer script = new StringBuffer("$('");
- script.append(tableId);
- script.append("').rows[0].cells.length");
-
- String count = runScript(script.toString());
- Assert.assertEquals(count, String.valueOf(i));
- }
-
- private void assertRowsCount(int i, String tableId) {
- StringBuffer script = new StringBuffer("$('");
- script.append(tableId);
- script.append("').rows.length");
-
- String count = runScript(script.toString());
- Assert.assertEquals(count, String.valueOf(i));
- }
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+ public String getTestUrl() {
+ return "/faces/pages/dataTable/dataTableTest.xhtml";
+ }
+
+ @Test
+ public void testDataTable() {
+ _testDataTable(Template.SIMPLE);
+ }
+
+ private void _testDataTable(Template template) {
+ renderPage(template);
+
+ String parentId = getParentId() + "_form:";
+ String dataTableId = parentId + "table";
+
+ writeStatus("Check columns count equals to 3 ");
+ assertColumnsCount(3, dataTableId);
+ writeStatus("Check rows count equals to 22 ");
+ assertRowsCount(22, dataTableId);
+
+ String columnsId = getColumnId(dataTableId, 0);
+
+ writeStatus("Check inputs' values ");
+ assertInputValue(dataTableId, 0, columnsId, "0");
+ assertInputValue(dataTableId, 5, columnsId, "5");
+ assertInputValue(dataTableId, 19, columnsId, "19");
+
+ columnsId = getColumnId(dataTableId, 1);
+
+ assertInputValue(dataTableId, 0, columnsId, "1");
+ assertInputValue(dataTableId, 7, columnsId, "8");
+ assertInputValue(dataTableId, 19, columnsId, "20");
+
+ columnsId = getColumnId(dataTableId, 2);
+
+ assertInputValue(dataTableId, 0, columnsId, "2");
+ assertInputValue(dataTableId, 11, columnsId, "13");
+ assertInputValue(dataTableId, 19, columnsId, "21");
+
+ writeStatus("Insert some values ");
+ insertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
+ insertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
+
+ writeStatus("Rerender table");
+ clickById("_form:submit");
+ waitForAjaxCompletion();
+
+ writeStatus("Check values entered ");
+ assertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
+ assertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
+
+ columnsId = getColumnId(dataTableId, 0);
+
+ writeStatus("Sort ASC by 1'st column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "000");
+ assertInputValue(dataTableId, 1, columnsId, "1");
+ assertInputValue(dataTableId, 18, columnsId, "8");
+ assertInputValue(dataTableId, 19, columnsId, "9");
+
+ writeStatus("Sort DESC by 1'st column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "9");
+ assertInputValue(dataTableId, 1, columnsId, "8");
+ assertInputValue(dataTableId, 18, columnsId, "1");
+ assertInputValue(dataTableId, 19, columnsId, "000");
+
+ columnsId = getColumnId(dataTableId, 2);
+
+ writeStatus("Sort ASC by 3'st column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "10");
+ assertInputValue(dataTableId, 1, columnsId, "11");
+ assertInputValue(dataTableId, 18, columnsId, "8");
+ assertInputValue(dataTableId, 19, columnsId, "9");
+
+ writeStatus("Set columns count == 5, rows count == 10");
+ changeColumnCount(10, 5, 0, 100);
+
+ writeStatus("Check columns count equals to 5 ");
+ assertColumnsCount(5, dataTableId);
+ writeStatus("Check rows count equals to 12 ");
+ assertRowsCount(12, dataTableId);
+
+ columnsId = getColumnId(dataTableId, 0);
+
+ writeStatus("Check inputs' values ");
+ assertInputValue(dataTableId, 0, columnsId, "0");
+ assertInputValue(dataTableId, 5, columnsId, "5");
+ assertInputValue(dataTableId, 9, columnsId, "9");
+
+ columnsId = getColumnId(dataTableId, 1);
+
+ assertInputValue(dataTableId, 0, columnsId, "1");
+ assertInputValue(dataTableId, 7, columnsId, "8");
+ assertInputValue(dataTableId, 9, columnsId, "10");
+
+ columnsId = getColumnId(dataTableId, 4);
+
+ assertInputValue(dataTableId, 0, columnsId, "4");
+ assertInputValue(dataTableId, 2, columnsId, "6");
+ assertInputValue(dataTableId, 9, columnsId, "13");
+
+ writeStatus("Sort ASC by the last column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "10");
+ assertInputValue(dataTableId, 2, columnsId, "12");
+ assertInputValue(dataTableId, 9, columnsId, "9");
+
+ writeStatus("Sort DESC by the last column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "9");
+ assertInputValue(dataTableId, 2, columnsId, "7");
+ assertInputValue(dataTableId, 9, columnsId, "10");
+
+ columnsId = getColumnId(dataTableId, 2);
+ writeStatus("Sort ASC by the 3d column ");
+ sortColumn(dataTableId, columnsId);
+
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "10");
+ assertInputValue(dataTableId, 2, columnsId, "2");
+ assertInputValue(dataTableId, 9, columnsId, "9");
+
+ changeColumnCount(2, 5, 2, 2);
+ assertColumnsCount(1, dataTableId);
+ assertRowsCount(4, dataTableId);
+
+ changeColumnCount(10, 5, 10, 0);
+ assertRowsCount(0, dataTableId);
+
+ }
+
+ private String getColumnId(String tableId, int i) {
+ String script = "$('" + tableId + "').rows[0].cells[" + String.valueOf(i) + "].id";
+ String id = runScript(script);
+ id = id.replace(tableId + ":", "");
+ id = id.replace("header", "");
+ return id;
+ }
+
+ private void changeColumnCount(int rows, int columns, int begin, int end) {
+ String script = "$('_controls:rows').value='" + String.valueOf(rows) + "';";
+ runScript(script);
+ script = "$('_controls:column').value='" + String.valueOf(columns) + "';";
+ runScript(script);
+ script = "$('_controls:begin').value='" + String.valueOf(begin) + "';";
+ runScript(script);
+ script = "$('_controls:end').value='" + String.valueOf(end) + "';";
+ runScript(script);
+ clickById("_controls:apply");
+ waitForAjaxCompletion();
+ }
+
+ private void sortColumn(String tableId, String columnId) {
+ clickById(tableId + ":" + columnId + "header");
+ waitForAjaxCompletion();
+ }
+
+ private void insertInputValue(String tableId, int row, String inputId, String value) {
+ String id = tableId + ":" + row + ":" + inputId;
+ String script = ("$('" + id + "').firstChild.value='" + value + "';");
+ runScript(script);
+ }
+
+ private void assertInputValue(String tableId, int row, String inputId, String value) {
+ String id = tableId + ":" + row + ":" + inputId;
+ String script = "$('" + id + "').firstChild.value";
+ Assert.assertEquals(runScript(script), value);
+ }
+
+ private void assertColumnsCount(int i, String tableId) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(tableId);
+ script.append("').rows[0].cells.length");
+
+ String count = runScript(script.toString());
+ Assert.assertEquals(count, String.valueOf(i));
+ }
+
+ private void assertRowsCount(int i, String tableId) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(tableId);
+ script.append("').rows.length");
+
+ String count = runScript(script.toString());
+ Assert.assertEquals(count, String.valueOf(i));
+ }
+
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -33,13 +33,13 @@
@Test
public void testDropDownMenuComponent() throws Exception {
- _testDropDownMenuComponent(Templates.SIMPLE);
- _testDropDownMenuComponent(Templates.DATATABLE);
- _testDropDownMenuComponent(Templates.MODALPANEL);
+ _testDropDownMenuComponent(Template.SIMPLE);
+ _testDropDownMenuComponent(Template.DATA_TABLE);
+ _testDropDownMenuComponent(Template.MODAL_PANEL);
}
- private void _testDropDownMenuComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testDropDownMenuComponent(Template template) {
+ renderPage(template);
String parentId = getParentId() + "_form:";
String file = parentId + "file";
@@ -88,7 +88,8 @@
}
- public String getTestUrl() {
- return "/faces/pages/dropDownMenu/dropDownMenuTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/dropDownMenu/dropDownMenuTest.xhtml";
+ }
+
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -34,12 +34,12 @@
@Test
public void testInplaceSelectComponent() throws Exception {
- _testInplaceSelectComponent(Templates.SIMPLE);
- _testInplaceSelectComponent(Templates.DATATABLE);
- _testInplaceSelectComponent(Templates.MODALPANEL);
+ _testInplaceSelectComponent(Template.SIMPLE);
+ _testInplaceSelectComponent(Template.DATA_TABLE);
+ _testInplaceSelectComponent(Template.MODAL_PANEL);
}
- private void _testInplaceSelectComponent(Templates template) {
+ private void _testInplaceSelectComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -20,9 +20,9 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -30,113 +30,115 @@
import org.testng.annotations.Test;
public class InputNumberSliderTest extends SeleniumTestBase implements RichSeleniumTest {
- private static final int BAR_SCALE = 10;
+ private static final int BAR_SCALE = 10;
- public InputNumberSliderTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeTest
- @Parameters( { "browser" })
- public void startSelenium(String browser) {
- super.startSelenium(browser);
- }
+ public InputNumberSliderTest() {
+ super("http", "localhost", serverPort);
+ }
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterTest
- public void stopSelenium() {
- super.stopSelenium();
- }
-
- @Test
- public void testInputNumberSliderComponent() throws Exception {
- _testInputNumberSlider(Templates.SIMPLE);
- _testInputNumberSlider(Templates.DATATABLE);
- //_testInputNumberSlider(Templates.MODALPANEL);
- }
-
- private void _testInputNumberSlider(Templates template) {
- renderPage(template);
-
- String parentId = getParentId() + "_form:";
- String slider = parentId + "slider";
-
- String input = slider + "Input";
- String tip = slider + "Tip";
- String track = slider + "Track";
-
- String ajax = parentId + "ajax";
- String server = parentId + "server";
- String output = parentId + "output";
-
- writeStatus("Checking initial rendering");
- Assert.assertFalse(isVisibleById(tip));
- checkSliderVisualState(slider, 40);
- AssertTextEquals(output, "40");
-
- writeStatus("Checking if tip is visible during click");
- selenium.mouseDownAt("id=" + track, "800,1");
- Assert.assertTrue(isVisibleById(tip));
- selenium.mouseUpAt("id=" + track, "800,1");
- Assert.assertFalse(isVisibleById(tip));
-
- writeStatus("Checking if value is changed with previous click");
- checkSliderVisualState(slider, 80);
-
- writeStatus("Checking if value is changed with input field");
- selenium.runScript("var input = $('" + input + "'); input.focus(); input.value = 22; input.blur();");
- checkSliderVisualState(slider, 22);
-
- writeStatus("Checking if slider is properly re-rendered and submitted with ajax");
- clickById(ajax);
- waitForAjaxCompletion();
- checkSliderVisualState(slider, 32);
- AssertTextEquals(output, "32");
-
- writeStatus("Checking if slider is properly submitted");
- clickCommandAndWait(server);
- checkSliderVisualState(slider, 42);
- AssertTextEquals(output, "42");
-
- writeStatus("Checking validation");
- selenium.mouseDownAt("id=" + track, "950,1");
- selenium.mouseUpAt("id=" + track, "950,1");
- clickById(ajax);
- waitForAjaxCompletion();
- checkSliderVisualState(slider, 95);
- AssertTextEquals(output, "42");
-
- selenium.mouseDownAt("id=" + track, "300,1");
- selenium.mouseUpAt("id=" + track, "300,1");
- clickById(ajax);
- waitForAjaxCompletion();
- checkSliderVisualState(slider, 40);
- AssertTextEquals(output, "40");
- }
-
- private void checkSliderVisualState(String id, int value) {
- writeStatus("Checking value in input field");
- AssertValueEquals(id + "Input", new Integer(value).toString());
- AssertTextEquals(id + "Tip", new Integer(value).toString());
-
- writeStatus("Checking tip and tracker position");
- String actualHandle = selenium.getEval(WINDOW_JS_RESOLVER + "document.getElementById('" + id + "Handle').style.left");
- String actualTip = selenium.getEval(WINDOW_JS_RESOLVER + "document.getElementById('" + id + "Tip').style.left");
-
- Assert.assertEquals(actualHandle, actualTip);
- Assert.assertTrue(actualTip.endsWith("px"));
-
- int actual = new Integer(actualTip.replace("px", "")).intValue();
- int expected = BAR_SCALE*value;
- Assert.assertTrue(Math.abs(actual - expected) <= BAR_SCALE, "Handle position is not syncronized with slider value!");
- }
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
- public String getTestUrl() {
- return "/faces/pages/inputNumberSlider/inputNumberSliderTest.xhtml";
- }
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ @Test
+ public void testInputNumberSliderComponent() throws Exception {
+ _testInputNumberSlider(Template.SIMPLE);
+ _testInputNumberSlider(Template.DATA_TABLE);
+ // _testInputNumberSlider(Templates.MODAL_PANEL);
+ }
+
+ private void _testInputNumberSlider(Template template) {
+ renderPage(template);
+
+ String parentId = getParentId() + "_form:";
+ String slider = parentId + "slider";
+
+ String input = slider + "Input";
+ String tip = slider + "Tip";
+ String track = slider + "Track";
+
+ String ajax = parentId + "ajax";
+ String server = parentId + "server";
+ String output = parentId + "output";
+
+ writeStatus("Checking initial rendering");
+ Assert.assertFalse(isVisibleById(tip));
+ checkSliderVisualState(slider, 40);
+ AssertTextEquals(output, "40");
+
+ writeStatus("Checking if tip is visible during click");
+ selenium.mouseDownAt("id=" + track, "800,1");
+ Assert.assertTrue(isVisibleById(tip));
+ selenium.mouseUpAt("id=" + track, "800,1");
+ Assert.assertFalse(isVisibleById(tip));
+
+ writeStatus("Checking if value is changed with previous click");
+ checkSliderVisualState(slider, 80);
+
+ writeStatus("Checking if value is changed with input field");
+ selenium.runScript("var input = $('" + input + "'); input.focus(); input.value = 22; input.blur();");
+ checkSliderVisualState(slider, 22);
+
+ writeStatus("Checking if slider is properly re-rendered and submitted with ajax");
+ clickById(ajax);
+ waitForAjaxCompletion();
+ checkSliderVisualState(slider, 32);
+ AssertTextEquals(output, "32");
+
+ writeStatus("Checking if slider is properly submitted");
+ clickCommandAndWait(server);
+ checkSliderVisualState(slider, 42);
+ AssertTextEquals(output, "42");
+
+ writeStatus("Checking validation");
+ selenium.mouseDownAt("id=" + track, "950,1");
+ selenium.mouseUpAt("id=" + track, "950,1");
+ clickById(ajax);
+ waitForAjaxCompletion();
+ checkSliderVisualState(slider, 95);
+ AssertTextEquals(output, "42");
+
+ selenium.mouseDownAt("id=" + track, "300,1");
+ selenium.mouseUpAt("id=" + track, "300,1");
+ clickById(ajax);
+ waitForAjaxCompletion();
+ checkSliderVisualState(slider, 40);
+ AssertTextEquals(output, "40");
+ }
+
+ private void checkSliderVisualState(String id, int value) {
+ writeStatus("Checking value in input field");
+ AssertValueEquals(id + "Input", new Integer(value).toString());
+ AssertTextEquals(id + "Tip", new Integer(value).toString());
+
+ writeStatus("Checking tip and tracker position");
+ String actualHandle = selenium.getEval(WINDOW_JS_RESOLVER + "document.getElementById('" + id
+ + "Handle').style.left");
+ String actualTip = selenium.getEval(WINDOW_JS_RESOLVER + "document.getElementById('" + id + "Tip').style.left");
+
+ Assert.assertEquals(actualHandle, actualTip);
+ Assert.assertTrue(actualTip.endsWith("px"));
+
+ int actual = new Integer(actualTip.replace("px", "")).intValue();
+ int expected = BAR_SCALE * value;
+ Assert.assertTrue(Math.abs(actual - expected) <= BAR_SCALE,
+ "Handle position is not syncronized with slider value!");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/inputNumberSlider/inputNumberSliderTest.xhtml";
+ }
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -35,13 +35,13 @@
@Test
public void testInputNumberSpinnerComponent() throws Exception {
- _testInputNumberSpinnerComponent(Templates.SIMPLE);
+ _testInputNumberSpinnerComponent(Template.SIMPLE);
//it looks as if the spinner does not work inside rich:dataTable
- _testInputNumberSpinnerComponent(Templates.DATATABLE);
- _testInputNumberSpinnerComponent(Templates.MODALPANEL);
+ _testInputNumberSpinnerComponent(Template.DATA_TABLE);
+ _testInputNumberSpinnerComponent(Template.MODAL_PANEL);
}
- private void _testInputNumberSpinnerComponent(Templates template) {
+ private void _testInputNumberSpinnerComponent(Template template) {
renderPage(template);
writeStatus("check whether the spinner is invariant with respect to pair of sequential opposite operations");
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -3,9 +3,9 @@
import static org.testng.Assert.assertEquals;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -36,13 +36,13 @@
@Test
public void testJSFunctionComponent() throws Exception {
- _testJSFunctionComponent(Templates.SIMPLE);
- _testJSFunctionComponent(Templates.DATATABLE);
- _testJSFunctionComponent(Templates.MODALPANEL);
+ _testJSFunctionComponent(Template.SIMPLE);
+ _testJSFunctionComponent(Template.DATA_TABLE);
+ _testJSFunctionComponent(Template.MODAL_PANEL);
}
- private void _testJSFunctionComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testJSFunctionComponent(Template template) {
+ renderPage(template);
String showNameElemId = getParentId() + "showname";
selenium.mouseOver("alex");
@@ -58,8 +58,8 @@
assertEquals(getTextById(showNameElemId), "Roger");
}
- public String getTestUrl() {
- return "/faces/pages/jsFunction/jsFunctionTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/jsFunction/jsFunctionTest.xhtml";
+ }
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -33,13 +33,13 @@
@Test
public void testKeepAliveComponent() throws Exception {
- _testKeepAliveComponent(Templates.SIMPLE);
- _testKeepAliveComponent(Templates.DATATABLE);
- _testKeepAliveComponent(Templates.MODALPANEL);
+ _testKeepAliveComponent(Template.SIMPLE);
+ _testKeepAliveComponent(Template.DATA_TABLE);
+ _testKeepAliveComponent(Template.MODAL_PANEL);
}
- private void _testKeepAliveComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testKeepAliveComponent(Template template) {
+ renderPage(template);
String parentId = getParentId();
@@ -84,7 +84,8 @@
// AssertValueEquals(sumAjaxOnlyElemId, "10");
}
- public String getTestUrl() {
- return "/faces/pages/keepAlive/keepAliveTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/keepAlive/keepAliveTest.xhtml";
+ }
+
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -2,9 +2,9 @@
import static org.testng.Assert.assertEquals;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -35,13 +35,13 @@
@Test
public void testLoadScriptComponent() throws Exception {
- _testLoadScriptComponent(Templates.SIMPLE);
- _testLoadScriptComponent(Templates.DATATABLE);
- _testLoadScriptComponent(Templates.MODALPANEL);
+ _testLoadScriptComponent(Template.SIMPLE);
+ _testLoadScriptComponent(Template.DATA_TABLE);
+ _testLoadScriptComponent(Template.MODAL_PANEL);
}
- private void _testLoadScriptComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testLoadScriptComponent(Template template) {
+ renderPage(template);
String jsCall = "summarize(%1$s, %2$s);";
int opr1 = 1;
int opr2 = 2;
@@ -49,7 +49,8 @@
assertEquals(Integer.parseInt(result), opr1 + opr2);
}
- public String getTestUrl() {
- return "/faces/pages/loadScript/loadScriptTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/loadScript/loadScriptTest.xhtml";
+ }
+
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -3,9 +3,9 @@
import static org.testng.Assert.assertEquals;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -36,19 +36,20 @@
@Test
public void testLoadStyleComponent() throws Exception {
- _testLoadStyleComponent(Templates.SIMPLE);
- _testLoadStyleComponent(Templates.DATATABLE);
- _testLoadStyleComponent(Templates.MODALPANEL);
+ _testLoadStyleComponent(Template.SIMPLE);
+ _testLoadStyleComponent(Template.DATA_TABLE);
+ _testLoadStyleComponent(Template.MODAL_PANEL);
}
- private void _testLoadStyleComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testLoadStyleComponent(Template template) {
+ renderPage(template);
String divId = getParentId() + "rectangle";
assertEquals(50, getWidthById(divId));
assertEquals(100, getHeightById(divId));
}
- public String getTestUrl() {
- return "/faces/pages/loadStyle/loadStyleTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/loadStyle/loadStyleTest.xhtml";
+ }
+
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -21,210 +21,220 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class OrderingListTest extends SeleniumTestBase implements RichSeleniumTest {
- private String firstButton;
- private String firstButtonDisabled;
-
- private String upButton;
- private String upButtonDisabled;
-
- private String downButton;
- private String downButtonDisabled;
-
- private String lastButton;
- private String lastButtonDisabled;
-
- private String firstRow;
-
- private String actionResultText;
- private String ajax;
- private String server;
- private String thirdRow;
- private String selectionText;
- private String activeItemText;
-
- public OrderingListTest() {
- super("http", "localhost", serverPort);
- }
-
- public OrderingListTest(String protocol, String host, String port) {
- super(protocol, host, port);
- }
-
- /**
+public class OrderingListTest extends SeleniumTestBase implements RichSeleniumTest {
+ private String firstButton;
+
+ private String firstButtonDisabled;
+
+ private String upButton;
+
+ private String upButtonDisabled;
+
+ private String downButton;
+
+ private String downButtonDisabled;
+
+ private String lastButton;
+
+ private String lastButtonDisabled;
+
+ private String firstRow;
+
+ private String actionResultText;
+
+ private String ajax;
+
+ private String server;
+
+ private String thirdRow;
+
+ private String selectionText;
+
+ private String activeItemText;
+
+ public OrderingListTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ public OrderingListTest(String protocol, String host, String port) {
+ super(protocol, host, port);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
@BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
@AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
+
@Test
public void testOrderingListComponent() throws Exception {
- _testOrderingListComponent(Templates.SIMPLE);
- _testOrderingListComponent(Templates.DATATABLE);
- _testOrderingListComponent(Templates.MODALPANEL);
+ _testOrderingListComponent(Template.SIMPLE);
+ _testOrderingListComponent(Template.DATA_TABLE);
+ _testOrderingListComponent(Template.MODAL_PANEL);
}
- private void _testOrderingListComponent(Templates template) {
- renderPage(getTestUrl(), template);
- initFields();
-
- _testButtons();
- _testActions();
- _testJSFunctions();
- }
-
- public String getTestUrl() {
- return "/faces/pages/orderingList/orderingListTest.xhtml";
- }
-
- private void _testButtons() {
- writeStatus("Check if all buttons are disabled first time");
- checkButtons(true, true, true, true);
-
- writeStatus("Click on first row");
- clickById(firstRow);
- checkButtons(true, true, false, false);
-
- writeStatus("Click on down button");
- Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
- clickById(downButton);
- checkButtons(false, false, false, false);
- Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 1);
-
- writeStatus("Click on last button");
- clickById(lastButton);
- checkButtons(false, false, true, true);
- Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 3);
-
- writeStatus("Click on first button");
- clickById(firstButton);
- checkButtons(true, true, false, false);
- Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
- }
-
- private void _testActions() {
- writeStatus("Select two rows");
- clickById(firstRow);
- selenium.controlKeyDown();
- clickById(thirdRow);
- selenium.controlKeyUp();
- checkButtons(true, true, false, false);
-
- writeStatus("Click on ajax button");
+ private void _testOrderingListComponent(Template template) {
+ renderPage(template);
+ initFields();
+
+ _testButtons();
+ _testActions();
+ _testJSFunctions();
+ }
+
+ private void _testButtons() {
+ writeStatus("Check if all buttons are disabled first time");
+ checkButtons(true, true, true, true);
+
+ writeStatus("Click on first row");
+ clickById(firstRow);
+ checkButtons(true, true, false, false);
+
+ writeStatus("Click on down button");
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
+ clickById(downButton);
+ checkButtons(false, false, false, false);
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 1);
+
+ writeStatus("Click on last button");
+ clickById(lastButton);
+ checkButtons(false, false, true, true);
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 3);
+
+ writeStatus("Click on first button");
+ clickById(firstButton);
+ checkButtons(true, true, false, false);
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
+ }
+
+ private void _testActions() {
+ writeStatus("Select two rows");
+ clickById(firstRow);
+ selenium.controlKeyDown();
+ clickById(thirdRow);
+ selenium.controlKeyUp();
+ checkButtons(true, true, false, false);
+
+ writeStatus("Click on ajax button");
clickById(ajax);
waitForAjaxCompletion();
AssertTextEquals(actionResultText, "item0");
AssertTextEquals(selectionText, "item0,item2");
AssertTextEquals(activeItemText, "Item [item2]");
-
+
writeStatus("Select one row");
- clickById(firstRow);
-
+ clickById(firstRow);
+
writeStatus("Click on server link");
clickCommandAndWait(server);
AssertTextEquals(actionResultText, "item1");
AssertTextEquals(selectionText, "item0");
AssertTextEquals(activeItemText, "Item [item0]");
checkButtons(true, true, false, false);
- }
-
- private void _testJSFunctions() {
- writeStatus("Select one row");
- clickById(thirdRow);
-
- writeStatus("Check if 'onupclick' event works");
- clickById(upButton);
- Assert.assertEquals(selenium.getEval("window.status"), "up orderchanged");
-
- writeStatus("Check if 'ondownclick' event works");
- clickById(downButton);
- Assert.assertEquals(selenium.getEval("window.status"), "down orderchanged");
-
- writeStatus("Check if 'ontopclick' event works");
- clickById(firstButton);
- Assert.assertEquals(selenium.getEval("window.status"), "top orderchanged");
-
- writeStatus("Check if 'onbottomclick' event works");
- clickById(lastButton);
- Assert.assertEquals(selenium.getEval("window.status"), "bottom orderchanged");
- }
-
- private void checkButtons(boolean firstDisabled, boolean upDisabled, boolean downDisabled, boolean lastDisabled) {
- if (firstDisabled) {
- Assert.assertTrue(isVisibleById(firstButtonDisabled));
- Assert.assertFalse(isVisibleById(firstButton));
- } else {
- Assert.assertFalse(isVisibleById(firstButtonDisabled));
- Assert.assertTrue(isVisibleById(firstButton));
- }
-
- if (upDisabled) {
- Assert.assertTrue(isVisibleById(upButtonDisabled));
- Assert.assertFalse(isVisibleById(upButton));
- } else {
- Assert.assertFalse(isVisibleById(upButtonDisabled));
- Assert.assertTrue(isVisibleById(upButton));
- }
-
- if (downDisabled) {
- Assert.assertTrue(isVisibleById(downButtonDisabled));
- Assert.assertFalse(isVisibleById(downButton));
- } else {
- Assert.assertFalse(isVisibleById(downButtonDisabled));
- Assert.assertTrue(isVisibleById(downButton));
- }
-
- if (lastDisabled) {
- Assert.assertTrue(isVisibleById(lastButtonDisabled));
- Assert.assertFalse(isVisibleById(lastButton));
- } else {
- Assert.assertFalse(isVisibleById(lastButtonDisabled));
- Assert.assertTrue(isVisibleById(lastButton));
- }
- }
-
- private void initFields() {
- String parentId = getParentId() + "_form:orderingList";
-
- firstButton = parentId + "first";
- firstButtonDisabled = parentId + "disfirst";
-
- upButton = parentId + "up";
- upButtonDisabled = parentId + "disup";
-
- downButton = parentId + "down";
- downButtonDisabled = parentId + "disdown";
-
- lastButton = parentId + "last";
- lastButtonDisabled = parentId + "dislast";
-
- firstRow = parentId + ":0";
- thirdRow = parentId + ":2";
-
- actionResultText = getParentId() + "_form:actionResult";
- selectionText = getParentId() + "_form:selection";
- activeItemText = getParentId() + "_form:activeItem";
- ajax = firstRow + ":_ajax";
- server = parentId + ":1:_server";
- }
+ }
+
+ private void _testJSFunctions() {
+ writeStatus("Select one row");
+ clickById(thirdRow);
+
+ writeStatus("Check if 'onupclick' event works");
+ clickById(upButton);
+ Assert.assertEquals(selenium.getEval("window.status"), "up orderchanged");
+
+ writeStatus("Check if 'ondownclick' event works");
+ clickById(downButton);
+ Assert.assertEquals(selenium.getEval("window.status"), "down orderchanged");
+
+ writeStatus("Check if 'ontopclick' event works");
+ clickById(firstButton);
+ Assert.assertEquals(selenium.getEval("window.status"), "top orderchanged");
+
+ writeStatus("Check if 'onbottomclick' event works");
+ clickById(lastButton);
+ Assert.assertEquals(selenium.getEval("window.status"), "bottom orderchanged");
+ }
+
+ private void checkButtons(boolean firstDisabled, boolean upDisabled, boolean downDisabled, boolean lastDisabled) {
+ if (firstDisabled) {
+ Assert.assertTrue(isVisibleById(firstButtonDisabled));
+ Assert.assertFalse(isVisibleById(firstButton));
+ } else {
+ Assert.assertFalse(isVisibleById(firstButtonDisabled));
+ Assert.assertTrue(isVisibleById(firstButton));
+ }
+
+ if (upDisabled) {
+ Assert.assertTrue(isVisibleById(upButtonDisabled));
+ Assert.assertFalse(isVisibleById(upButton));
+ } else {
+ Assert.assertFalse(isVisibleById(upButtonDisabled));
+ Assert.assertTrue(isVisibleById(upButton));
+ }
+
+ if (downDisabled) {
+ Assert.assertTrue(isVisibleById(downButtonDisabled));
+ Assert.assertFalse(isVisibleById(downButton));
+ } else {
+ Assert.assertFalse(isVisibleById(downButtonDisabled));
+ Assert.assertTrue(isVisibleById(downButton));
+ }
+
+ if (lastDisabled) {
+ Assert.assertTrue(isVisibleById(lastButtonDisabled));
+ Assert.assertFalse(isVisibleById(lastButton));
+ } else {
+ Assert.assertFalse(isVisibleById(lastButtonDisabled));
+ Assert.assertTrue(isVisibleById(lastButton));
+ }
+ }
+
+ private void initFields() {
+ String parentId = getParentId() + "_form:orderingList";
+
+ firstButton = parentId + "first";
+ firstButtonDisabled = parentId + "disfirst";
+
+ upButton = parentId + "up";
+ upButtonDisabled = parentId + "disup";
+
+ downButton = parentId + "down";
+ downButtonDisabled = parentId + "disdown";
+
+ lastButton = parentId + "last";
+ lastButtonDisabled = parentId + "dislast";
+
+ firstRow = parentId + ":0";
+ thirdRow = parentId + ":2";
+
+ actionResultText = getParentId() + "_form:actionResult";
+ selectionText = getParentId() + "_form:selection";
+ activeItemText = getParentId() + "_form:activeItem";
+ ajax = firstRow + ":_ajax";
+ server = parentId + ":1:_server";
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/orderingList/orderingListTest.xhtml";
+ }
+
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -21,89 +21,87 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class PanelBarTest extends SeleniumTestBase implements RichSeleniumTest {
-
-
- public PanelBarTest() {
- super("http", "localhost", serverPort);
- }
-
+public class PanelBarTest extends SeleniumTestBase implements RichSeleniumTest {
- /**
+ public PanelBarTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
- @BeforeTest
+ @BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
- @AfterTest
+ @AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
- @Test
+
+ @Test
public void testPanelBarComponent() throws Exception {
- _testPanelBarComponent(Templates.SIMPLE);
- _testPanelBarComponent(Templates.DATATABLE);
- _testPanelBarComponent(Templates.MODALPANEL);
+ _testPanelBarComponent(Template.SIMPLE);
+ _testPanelBarComponent(Template.DATA_TABLE);
+ _testPanelBarComponent(Template.MODAL_PANEL);
}
-
- private void _testPanelBarComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
-
- String label2 = parentId + "label2";
- String label3 = parentId + "label3";
-
- String output1 = parentId + "output1";
- String output2 = parentId + "output2";
- String output3 = parentId + "output3";
-
- String ajaxButton = parentId + "button_ajax";
- String simpleButton = parentId + "button_simple";
-
- writeStatus("Click on label two. It should be opened.");
- clickById(label2);
+
+ private void _testPanelBarComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form:";
+
+ String label2 = parentId + "label2";
+ String label3 = parentId + "label3";
+
+ String output1 = parentId + "output1";
+ String output2 = parentId + "output2";
+ String output3 = parentId + "output3";
+
+ String ajaxButton = parentId + "button_ajax";
+ String simpleButton = parentId + "button_simple";
+
+ writeStatus("Click on label two. It should be opened.");
+ clickById(label2);
Assert.assertFalse(isVisibleById(output1));
Assert.assertTrue(isVisibleById(output2));
Assert.assertFalse(isVisibleById(output3));
-
+
writeStatus("Click on simple commandButton. Opened states should not change after page reloaded.");
clickCommandAndWait(simpleButton);
- Assert.assertFalse(isVisibleById(output1));
+ Assert.assertFalse(isVisibleById(output1));
Assert.assertTrue(isVisibleById(output2));
Assert.assertFalse(isVisibleById(output3));
-
+
writeStatus("Click on label three. It should be opened.");
clickById(label3);
Assert.assertFalse(isVisibleById(output1));
Assert.assertFalse(isVisibleById(output2));
Assert.assertTrue(isVisibleById(output3));
-
+
writeStatus("Click on ajax commandButton. Opened states should not change.");
clickById(ajaxButton);
- waitForAjaxCompletion();
- Assert.assertFalse(isVisibleById(output1));
+ waitForAjaxCompletion();
+ Assert.assertFalse(isVisibleById(output1));
Assert.assertFalse(isVisibleById(output2));
Assert.assertTrue(isVisibleById(output3));
}
-
+
public String getTestUrl() {
- return "/faces/pages/panelBar/panelBarTest.xhtml";
- }
+ return "/faces/pages/panelBar/panelBarTest.xhtml";
+ }
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,286 +1,286 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class PanelMenuTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public PanelMenuTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
+public class PanelMenuTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public PanelMenuTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
- @BeforeTest
+ @BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
- @AfterTest
+ @AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
- @Test
+
+ @Test
public void testPanelMenuComponent() throws Exception {
-
- _testPanelMenuComponent(Templates.SIMPLE);
- _testPanelMenuComponent(Templates.DATATABLE);
- _testPanelMenuComponent(Templates.MODALPANEL);
-
- _testPanelMenuComponentSingleMode(Templates.SIMPLE);
- _testPanelMenuComponentSingleMode(Templates.DATATABLE);
- _testPanelMenuComponentSingleMode(Templates.MODALPANEL);
- _testPanelMenuItemAction(Templates.SIMPLE);
- _testPanelMenuItemAction(Templates.DATATABLE);
- _testPanelMenuItemAction(Templates.MODALPANEL);
-
- _testPanelMenuClientAPI(Templates.SIMPLE);
- _testPanelMenuClientAPI(Templates.DATATABLE);
- _testPanelMenuClientAPI(Templates.MODALPANEL);
+ _testPanelMenuComponent(Template.SIMPLE);
+ _testPanelMenuComponent(Template.DATA_TABLE);
+ _testPanelMenuComponent(Template.MODAL_PANEL);
+
+ _testPanelMenuComponentSingleMode(Template.SIMPLE);
+ _testPanelMenuComponentSingleMode(Template.DATA_TABLE);
+ _testPanelMenuComponentSingleMode(Template.MODAL_PANEL);
+
+ _testPanelMenuItemAction(Template.SIMPLE);
+ _testPanelMenuItemAction(Template.DATA_TABLE);
+ _testPanelMenuItemAction(Template.MODAL_PANEL);
+
+ _testPanelMenuClientAPI(Template.SIMPLE);
+ _testPanelMenuClientAPI(Template.DATA_TABLE);
+ _testPanelMenuClientAPI(Template.MODAL_PANEL);
}
-
- private void _testPanelMenuClientAPI(Templates template) {
- renderPage(template);
-
- String form1 = getParentId() + "_form1:";
- String form2 = getParentId() + "_form2:";
-
- String group = form1 + "pGroup3";
- String sigleGroup = form2 + "pGroup3_single";
-
- String ajaxItem = "tablehide" + form1 + "pItem1";
- String serverItem = "tablehide" + form1 + "pItem2";
- String clientItem = "tablehide" + form1 + "pItem3";
-
- writeStatus("Test expand JS API method for ajax multiple panel menu.");
- selenium.runScript("$('" + group + "').component.expand()");
- Assert.assertFalse(isVisibleById(ajaxItem));
+
+ private void _testPanelMenuClientAPI(Template template) {
+ renderPage(template);
+
+ String form1 = getParentId() + "_form1:";
+ String form2 = getParentId() + "_form2:";
+
+ String group = form1 + "pGroup3";
+ String sigleGroup = form2 + "pGroup3_single";
+
+ String ajaxItem = "tablehide" + form1 + "pItem1";
+ String serverItem = "tablehide" + form1 + "pItem2";
+ String clientItem = "tablehide" + form1 + "pItem3";
+
+ writeStatus("Test expand JS API method for ajax multiple panel menu.");
+ selenium.runScript("$('" + group + "').component.expand()");
+ Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertTrue(isVisibleById(clientItem));
-
+
writeStatus("Test collapse JS API method for ajax multiple panel menu.");
selenium.runScript("$('" + group + "').component.collapse()");
- Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
- ajaxItem = "tablehide" + form2 + "pItem1_single";
- serverItem = "tablehide" + form2 + "pItem2_single";
- clientItem = "tablehide" + form2 + "pItem3_single";
-
- writeStatus("Test expand JS API method for ajax single panel menu.");
- selenium.runScript("$('" + sigleGroup + "').component.expand()");
- Assert.assertFalse(isVisibleById(ajaxItem));
+
+ ajaxItem = "tablehide" + form2 + "pItem1_single";
+ serverItem = "tablehide" + form2 + "pItem2_single";
+ clientItem = "tablehide" + form2 + "pItem3_single";
+
+ writeStatus("Test expand JS API method for ajax single panel menu.");
+ selenium.runScript("$('" + sigleGroup + "').component.expand()");
+ Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertTrue(isVisibleById(clientItem));
-
+
writeStatus("Test collapse JS API method for ajax single panel menu.");
selenium.runScript("$('" + sigleGroup + "').component.collapse()");
- Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
- tearDown();
- }
-
- private void _testPanelMenuComponent(Templates template) {
- renderPage(template);
- String parentId = getParentId() + "_form1:";
-
- String value1Id = getParentId() + "_value";
+
+ tearDown();
+ }
+
+ private void _testPanelMenuComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form1:";
+
+ String value1Id = getParentId() + "_value";
String value2Id = getParentId() + "_value2";
-
+
String ajaxGroup = "tablehide" + parentId + "pGroup1";
String serverGroup = "tablehide" + parentId + "pGroup2";
String clientGroup = "tablehide" + parentId + "pGroup3";
String disabledGroup = "tablehide" + parentId + "pGroup4";
-
+
String ajaxItem = "tablehide" + parentId + "pItem1";
String serverItem = "tablehide" + parentId + "pItem2";
String clientItem = "tablehide" + parentId + "pItem3";
String disabledItem = "tablehide" + parentId + "pItem4";
-
+
writeStatus("Click on ajax group");
clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertTextEquals(value1Id, "pGroup1");
+ waitForAjaxCompletion();
+ AssertTextEquals(value1Id, "pGroup1");
AssertTextEquals(value2Id, "1");
Assert.assertTrue(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on server group");
- clickCommandAndWait(serverGroup);
- AssertTextEquals(value1Id, "pGroup2");
+ clickCommandAndWait(serverGroup);
+ AssertTextEquals(value1Id, "pGroup2");
AssertTextEquals(value2Id, "2");
Assert.assertTrue(isVisibleById(ajaxItem));
Assert.assertTrue(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on ajax group");
clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertTextEquals(value1Id, "pGroup1");
+ waitForAjaxCompletion();
+ AssertTextEquals(value1Id, "pGroup1");
AssertTextEquals(value2Id, "3");
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertTrue(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on server group");
clickCommandAndWait(serverGroup);
-
- AssertTextEquals(value1Id, "pGroup2");
+
+ AssertTextEquals(value1Id, "pGroup2");
AssertTextEquals(value2Id, "4");
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on client group");
clickById(clientGroup);
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertTrue(isVisibleById(clientItem));
-
+
writeStatus("Click on client group");
clickById(clientGroup);
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on disabled client group");
clickById(disabledGroup);
Assert.assertFalse(isVisibleById(disabledItem));
-
+
tearDown();
- }
-
- private void _testPanelMenuComponentSingleMode(Templates template) {
- renderPage(template);
- String parentId = getParentId() + "_form2:";
-
- String value1Id = getParentId() + "_value";
+ }
+
+ private void _testPanelMenuComponentSingleMode(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form2:";
+
+ String value1Id = getParentId() + "_value";
String value2Id = getParentId() + "_value2";
-
+
String ajaxGroup = "tablehide" + parentId + "pGroup1_single";
String serverGroup = "tablehide" + parentId + "pGroup2_single";
String clientGroup = "tablehide" + parentId + "pGroup3_single";
String disabledGroup = "tablehide" + parentId + "pGroup4_single";
-
+
String ajaxItem = "tablehide" + parentId + "pItem1_single";
String serverItem = "tablehide" + parentId + "pItem2_single";
String clientItem = "tablehide" + parentId + "pItem3_single";
String disabledItem = "tablehide" + parentId + "pItem4_single";
-
+
writeStatus("Click on ajax group");
clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertTextEquals(value1Id, "pGroup1_single");
+ waitForAjaxCompletion();
+ AssertTextEquals(value1Id, "pGroup1_single");
AssertTextEquals(value2Id, "1");
Assert.assertTrue(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on server group");
clickCommandAndWait(serverGroup);
- AssertTextEquals(value1Id, "pGroup2_single");
+ AssertTextEquals(value1Id, "pGroup2_single");
AssertTextEquals(value2Id, "2");
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertTrue(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on ajax group");
clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertTextEquals(value1Id, "pGroup1_single");
+ waitForAjaxCompletion();
+ AssertTextEquals(value1Id, "pGroup1_single");
AssertTextEquals(value2Id, "3");
Assert.assertTrue(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on server group");
clickCommandAndWait(serverGroup);
- AssertTextEquals(value1Id, "pGroup2_single");
+ AssertTextEquals(value1Id, "pGroup2_single");
AssertTextEquals(value2Id, "4");
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertTrue(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on client group");
clickById(clientGroup);
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertTrue(isVisibleById(clientItem));
-
+
writeStatus("Click on client group");
clickById(clientGroup);
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on disabled client group");
clickById(disabledGroup);
Assert.assertFalse(isVisibleById(disabledItem));
-
+
tearDown();
- }
-
- private void _testPanelMenuItemAction(Templates template) {
- renderPage(template);
- String parentId = getParentId() + "_form";
-
- String value1Id = getParentId() + "_value";
+ }
+
+ private void _testPanelMenuItemAction(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form";
+
+ String value1Id = getParentId() + "_value";
String value2Id = getParentId() + "_value2";
-
- String group = "tablehide" + parentId + "1:pGroup1";
- String groupSingle = "tablehide" + parentId + "2:pGroup1_single";
-
- String item = "tablehide" + parentId + "1:pItem1";
+
+ String group = "tablehide" + parentId + "1:pGroup1";
+ String groupSingle = "tablehide" + parentId + "2:pGroup1_single";
+
+ String item = "tablehide" + parentId + "1:pItem1";
String itemSingle = "tablehide" + parentId + "2:pItem1_single";
-
+
writeStatus("Click on ajax group");
clickById(group);
- waitForAjaxCompletion();
- AssertTextEquals(value1Id, "pGroup1");
-
- writeStatus("Click on ajax group");
+ waitForAjaxCompletion();
+ AssertTextEquals(value1Id, "pGroup1");
+
+ writeStatus("Click on ajax group");
clickById(groupSingle);
- waitForAjaxCompletion();
- AssertTextEquals(value1Id, "pGroup1_single");
-
- writeStatus("Click on server group");
- clickCommandAndWait(item);
- AssertTextEquals(value1Id, "pItem1");
+ waitForAjaxCompletion();
+ AssertTextEquals(value1Id, "pGroup1_single");
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(item);
+ AssertTextEquals(value1Id, "pItem1");
AssertTextEquals(value2Id, "1");
-
+
writeStatus("Click on server group");
clickCommandAndWait(itemSingle);
- AssertTextEquals(value1Id, "pItem1_single");
+ AssertTextEquals(value1Id, "pItem1_single");
AssertTextEquals(value2Id, "2");
-
+
tearDown();
- }
-
+ }
+
public String getTestUrl() {
- return "/faces/pages/panelMenu/panelMenuTest.xhtml";
- }
-
+ return "/faces/pages/panelMenu/panelMenuTest.xhtml";
+ }
+
private void tearDown() {
- writeStatus("Clean bean values");
- clickById(getParentId() + "_form2:clean");
- waitForAjaxCompletion();
+ writeStatus("Clean bean values");
+ clickById(getParentId() + "_form2:clean");
+ waitForAjaxCompletion();
}
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -34,13 +34,13 @@
@Test
public void testPickListComponent() throws Exception {
- _testPickListComponent(Templates.SIMPLE);
- _testPickListComponent(Templates.DATATABLE);
- _testPickListComponent(Templates.MODALPANEL);
+ _testPickListComponent(Template.SIMPLE);
+ _testPickListComponent(Template.DATA_TABLE);
+ _testPickListComponent(Template.MODAL_PANEL);
}
- private void _testPickListComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testPickListComponent(Template template) {
+ renderPage(template);
String parentId = getParentId() + "_form:";
String pickListId = "pickList";
@@ -96,8 +96,8 @@
return retVal;
}
- public String getTestUrl() {
- return "/faces/pages/pickList/pickListTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/pickList/pickListTest.xhtml";
+ }
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -1,139 +1,138 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class ProgressBarTest extends SeleniumTestBase implements
- RichSeleniumTest {
+public class ProgressBarTest extends SeleniumTestBase implements RichSeleniumTest {
- public ProgressBarTest() {
- super("http", "localhost", serverPort);
- }
+ public ProgressBarTest() {
+ super("http", "localhost", serverPort);
+ }
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeTest
- @Parameters( { "browser" })
- public void startSelenium(String browser) {
- super.startSelenium(browser);
- }
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterTest
- public void stopSelenium() {
- super.stopSelenium();
- }
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
- @Test
- public void testProgressBarComponent() {
- _testProgressBarComponent(Templates.SIMPLE);
- _testProgressBarComponent(Templates.DATATABLE);
- _testProgressBarComponent(Templates.MODALPANEL);
- }
+ @Test
+ public void testProgressBarComponent() {
+ _testProgressBarComponent(Template.SIMPLE);
+ _testProgressBarComponent(Template.DATA_TABLE);
+ _testProgressBarComponent(Template.MODAL_PANEL);
+ }
- private void _testProgressBarComponent(Templates template) {
-
- renderPage(template);
-
- String parentId = getParentId() + "_form:";
-
- String progressBarId = parentId + "progressBar1";
- int value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value < 0, "Progress value should be negative");
- String text = getTextById(progressBarId);
- writeStatus("Check if process not started");
- Assert.assertTrue(text.startsWith("Process not started"), "Initial facet does not appear");
-
- writeStatus("Enable polling");
- enableProgressBar(progressBarId, true);
-
- pause(5000, progressBarId);
-
- writeStatus("Disable polling");
- enableProgressBar(progressBarId, false);
-
- writeStatus("Check label");
- text = getTextById(progressBarId + ":remain");
- Assert.assertTrue(text.endsWith("%"), "Percent label doesnot appear");
-
- writeStatus("Check value");
- value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value > 0, "Progress value should be positive");
-
- writeStatus("Enable polling");
- enableProgressBar(progressBarId, true);
-
- pause(5000, progressBarId);
- writeStatus("Check value");
- Assert.assertTrue((getProgressBarValue(progressBarId).intValue() != value), "Progress has been terminated abnormal");
-
- writeStatus("Disable polling");
- enableProgressBar(progressBarId, false);
-
- value = getProgressBarValue(progressBarId);
- pause(1500, progressBarId);
- writeStatus("Check value");
- Assert.assertTrue(getProgressBarValue(progressBarId) == value, "Progress didnt stop after progressBar disabling");
-
- clickById(parentId + "_complete");
- waitForAjaxCompletion();
- writeStatus("Check if process completed");
- text = getTextById(progressBarId);
- Assert.assertTrue(text.startsWith("Process completed"),"Comlete facet does not appear");
-
-
- // - Test client mode
-
- writeStatus("Check value");
- progressBarId = parentId + "progressBar2";
- value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value == -5, "Progress value should be -5 ");
-
- text = getTextById(progressBarId);
- writeStatus("Check if process not started");
- Assert.assertTrue(text.startsWith("Process not started"), "Initial facet does not appear");
-
- setProgressBarValue(progressBarId, 20);
- value = getProgressBarValue(progressBarId);
- writeStatus("Check value");
- Assert.assertTrue(value == 20, "Progress value should be 20 ");
-
- setProgressBarValue(progressBarId, 60);
- value = getProgressBarValue(progressBarId);
- writeStatus("Check value");
- Assert.assertTrue(value == 60,"Progress value should be 60");
-
- clickById(parentId + "_reset");
- waitForAjaxCompletion();
-
- }
+ private void _testProgressBarComponent(Template template) {
- private void enableProgressBar(String id, boolean enable) {
- invokeFromComponent(id, (enable ? "enable" : "disable"), null);
- }
+ renderPage(template);
- private void setProgressBarValue(String id, Object value) {
- invokeFromComponent(id, "setValue", value);
- }
+ String parentId = getParentId() + "_form:";
- private Integer getProgressBarValue(String id) {
- String value = invokeFromComponent(id, "getValue", null); //runScript(script.toString());
- Integer v = Integer.parseInt(value);
- return v;
- }
-
- public String getTestUrl() {
- return "/faces/pages/progressBar/progressBarTest.xhtml";
- }
+ String progressBarId = parentId + "progressBar1";
+ int value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value < 0, "Progress value should be negative");
+ String text = getTextById(progressBarId);
+ writeStatus("Check if process not started");
+ Assert.assertTrue(text.startsWith("Process not started"), "Initial facet does not appear");
+ writeStatus("Enable polling");
+ enableProgressBar(progressBarId, true);
+ pause(5000, progressBarId);
+
+ writeStatus("Disable polling");
+ enableProgressBar(progressBarId, false);
+
+ writeStatus("Check label");
+ text = getTextById(progressBarId + ":remain");
+ Assert.assertTrue(text.endsWith("%"), "Percent label doesnot appear");
+
+ writeStatus("Check value");
+ value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value > 0, "Progress value should be positive");
+
+ writeStatus("Enable polling");
+ enableProgressBar(progressBarId, true);
+
+ pause(5000, progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue((getProgressBarValue(progressBarId).intValue() != value),
+ "Progress has been terminated abnormal");
+
+ writeStatus("Disable polling");
+ enableProgressBar(progressBarId, false);
+
+ value = getProgressBarValue(progressBarId);
+ pause(1500, progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue(getProgressBarValue(progressBarId) == value,
+ "Progress didnt stop after progressBar disabling");
+
+ clickById(parentId + "_complete");
+ waitForAjaxCompletion();
+ writeStatus("Check if process completed");
+ text = getTextById(progressBarId);
+ Assert.assertTrue(text.startsWith("Process completed"), "Comlete facet does not appear");
+
+ // - Test client mode
+
+ writeStatus("Check value");
+ progressBarId = parentId + "progressBar2";
+ value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value == -5, "Progress value should be -5 ");
+
+ text = getTextById(progressBarId);
+ writeStatus("Check if process not started");
+ Assert.assertTrue(text.startsWith("Process not started"), "Initial facet does not appear");
+
+ setProgressBarValue(progressBarId, 20);
+ value = getProgressBarValue(progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue(value == 20, "Progress value should be 20 ");
+
+ setProgressBarValue(progressBarId, 60);
+ value = getProgressBarValue(progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue(value == 60, "Progress value should be 60");
+
+ clickById(parentId + "_reset");
+ waitForAjaxCompletion();
+
+ }
+
+ private void enableProgressBar(String id, boolean enable) {
+ invokeFromComponent(id, (enable ? "enable" : "disable"), null);
+ }
+
+ private void setProgressBarValue(String id, Object value) {
+ invokeFromComponent(id, "setValue", value);
+ }
+
+ private Integer getProgressBarValue(String id) {
+ String value = invokeFromComponent(id, "getValue", null); // runScript(script.toString());
+ Integer v = Integer.parseInt(value);
+ return v;
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/progressBar/progressBarTest.xhtml";
+ }
+
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -21,96 +21,95 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class SimpleTogglePanelTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public SimpleTogglePanelTest() {
- super("http", "localhost", serverPort);
- }
+public class SimpleTogglePanelTest extends SeleniumTestBase implements RichSeleniumTest {
- /**
+ public SimpleTogglePanelTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
@BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
@AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
+
@Test
public void testSimpleTogglePanelComponent() throws Exception {
- _testSimpleTogglePanelComponent(Templates.SIMPLE);
- _testSimpleTogglePanelComponent(Templates.DATATABLE);
- _testSimpleTogglePanelComponent(Templates.MODALPANEL);
+ _testSimpleTogglePanelComponent(Template.SIMPLE);
+ _testSimpleTogglePanelComponent(Template.DATA_TABLE);
+ _testSimpleTogglePanelComponent(Template.MODAL_PANEL);
}
-
- private void _testSimpleTogglePanelComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
- String inputId = parentId + "_value";
+
+ private void _testSimpleTogglePanelComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form:";
+ String inputId = parentId + "_value";
String outputId = parentId + "_value2";
-
- String ajaxHeader = parentId + "panel1_header";
- String serverHeader = parentId + "panel2_header";
- String clientHeader = parentId + "panel3_header";
-
- String ajaxBody = parentId + "panel1_body";
- String serverBody = parentId + "panel2_body";
- String clientBody = parentId + "panel3_body";
-
- writeStatus("Click on client simple toggle panel. It should be opened.");
+
+ String ajaxHeader = parentId + "panel1_header";
+ String serverHeader = parentId + "panel2_header";
+ String clientHeader = parentId + "panel3_header";
+
+ String ajaxBody = parentId + "panel1_body";
+ String serverBody = parentId + "panel2_body";
+ String clientBody = parentId + "panel3_body";
+
+ writeStatus("Click on client simple toggle panel. It should be opened.");
clickById(clientHeader);
Assert.assertTrue(isVisibleById(clientBody));
writeStatus("Click on client simple toggle panel again. It should be closed.");
clickById(clientHeader);
Assert.assertFalse(isVisibleById(clientBody));
-
+
writeStatus("Click on ajax simple toggle panel. It should be opened.");
clickById(ajaxHeader);
waitForAjaxCompletion();
AssertValueEquals(inputId, "panel1");
AssertTextEquals(outputId, "1");
Assert.assertTrue(isVisibleById(ajaxBody));
-
+
writeStatus("Click on ajax simple toggle panel again. It should be closed.");
clickById(ajaxHeader);
waitForAjaxCompletion();
AssertValueEquals(inputId, "panel1");
AssertTextEquals(outputId, "2");
Assert.assertFalse(isVisibleById(ajaxBody));
-
+
writeStatus("Click on server simple toggle panel. It should be opened.");
clickCommandAndWait(serverHeader);
AssertValueEquals(inputId, "panel2");
AssertTextEquals(outputId, "3");
Assert.assertTrue(isVisibleById(serverBody));
-
+
writeStatus("Click on server simple toggle panel. It should be closed.");
clickCommandAndWait(serverHeader);
AssertValueEquals(inputId, "panel2");
AssertTextEquals(outputId, "4");
Assert.assertFalse(isVisibleById(serverBody));
}
-
+
public String getTestUrl() {
- return "/faces/pages/simpleTogglePanel/simpleTogglePanel.xhtml";
- }
+ return "/faces/pages/simpleTogglePanel/simpleTogglePanel.xhtml";
+ }
-
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -21,103 +21,105 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class SpacerTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public SpacerTest() {
- super("http", "localhost", serverPort);
- }
+public class SpacerTest extends SeleniumTestBase implements RichSeleniumTest {
- /**
+ public SpacerTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
@BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
@AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
+
@Test
public void testSimpleTogglePanelComponent() throws Exception {
- _testSimpleTogglePanelComponent(Templates.SIMPLE);
- _testSimpleTogglePanelComponent(Templates.DATATABLE);
- _testSimpleTogglePanelComponent(Templates.MODALPANEL);
+ _testSimpleTogglePanelComponent(Template.SIMPLE);
+ _testSimpleTogglePanelComponent(Template.DATA_TABLE);
+ _testSimpleTogglePanelComponent(Template.MODAL_PANEL);
}
-
- private void _testSimpleTogglePanelComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId();
- String spacerId = parentId + "sp";
-
- writeStatus("Check width ");
- assertWidth(1 + 2, spacerId);
- writeStatus("Check height ");
- assertHeight(5 + 2, spacerId);
-
- writeStatus("Check styleClass ");
- assertStyleClass("sp", spacerId);
-
- writeStatus("Check style ");
- assertStyleClass("border: solid 1px green;", spacerId);
- }
-
+ private void _testSimpleTogglePanelComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId();
+ String spacerId = parentId + "sp";
+
+ writeStatus("Check width ");
+ assertWidth(1 + 2, spacerId);
+
+ writeStatus("Check height ");
+ assertHeight(5 + 2, spacerId);
+
+ writeStatus("Check styleClass ");
+ assertStyleClass("sp", spacerId);
+
+ writeStatus("Check style ");
+ assertStyleClass("border: solid 1px green;", spacerId);
+ }
+
+ private void assertWidth(int width, String spacerId) {
+ StringBuffer script = new StringBuffer(" document.getElementById('");
+ script.append(spacerId);
+ script.append("').offsetWidth");
+
+ String w = runScript(script.toString());
+ Assert.assertEquals(w, String.valueOf(width));
+ }
+
+ private void assertHeight(int height, String spacerId) {
+ StringBuffer script = new StringBuffer(" document.getElementById('");
+ script.append(spacerId);
+ script.append("').offsetHeight");
+
+ String h = runScript(script.toString());
+ Assert.assertEquals(h, String.valueOf(height));
+ }
+
+ private void assertStyleClass(String styleClass, String spacerId) {
+ StringBuffer script = new StringBuffer(" document.getElementById('");
+ script.append(spacerId);
+ script.append("').className");
+
+ String sc = runScript(script.toString());
+ if (sc != null) {
+ Assert.assertTrue(sc.endsWith("sp"));
+ } else {
+ Assert.fail("ClassName is null");
+ }
+ }
+
+ private void assertStyle(String style, String spacerId) {
+ StringBuffer script = new StringBuffer(" document.getElementById('");
+ script.append(spacerId);
+ script.append("').style");
+
+ String s = runScript(script.toString());
+ Assert.assertEquals(s, style);
+ }
+
public String getTestUrl() {
- return "/faces/pages/spacer/spacerTest.xhtml";
- }
+ return "/faces/pages/spacer/spacerTest.xhtml";
+ }
- private void assertWidth(int width, String spacerId) {
- StringBuffer script = new StringBuffer(" document.getElementById('");
- script.append(spacerId);
- script.append("').offsetWidth");
-
- String w = runScript(script.toString());
- Assert.assertEquals(w, String.valueOf(width));
- }
-
- private void assertHeight(int height, String spacerId) {
- StringBuffer script = new StringBuffer(" document.getElementById('");
- script.append(spacerId);
- script.append("').offsetHeight");
-
- String h = runScript(script.toString());
- Assert.assertEquals(h, String.valueOf(height));
- }
-
- private void assertStyleClass(String styleClass, String spacerId) {
- StringBuffer script = new StringBuffer(" document.getElementById('");
- script.append(spacerId);
- script.append("').className");
-
- String sc = runScript(script.toString());
- if (sc != null) {
- Assert.assertTrue(sc.endsWith("sp"));
- } else {
- Assert.fail("ClassName is null");
- }
- }
- private void assertStyle(String style, String spacerId) {
- StringBuffer script = new StringBuffer(" document.getElementById('");
- script.append(spacerId);
- script.append("').style");
-
- String s = runScript(script.toString());
- Assert.assertEquals(s, style);
- }
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -21,9 +21,9 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -34,44 +34,44 @@
public class TabPanelTest extends SeleniumTestBase implements RichSeleniumTest {
- public TabPanelTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
+ public TabPanelTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
@BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
@AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
+
@Test
public void testTabPanelComponent() throws Exception {
- _testRichTabPanelComponent(Templates.SIMPLE);
- _testRichTabPanelComponent(Templates.DATATABLE);
- _testRichTabPanelComponent(Templates.MODALPANEL);
+ _testRichTabPanelComponent(Template.SIMPLE);
+ _testRichTabPanelComponent(Template.DATA_TABLE);
+ _testRichTabPanelComponent(Template.MODAL_PANEL);
}
-
- private void _testRichTabPanelComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
- String linkId = parentId + "tab2_lbl";
- String tabId1 = parentId + "tab1";
- String tabId2 = parentId + "tab2";
- String tabId4 = parentId + "tab4";
+
+ private void _testRichTabPanelComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form:";
+ String linkId = parentId + "tab2_lbl";
+ String tabId1 = parentId + "tab1";
+ String tabId2 = parentId + "tab2";
+ String tabId4 = parentId + "tab4";
String inputId = parentId + "_value";
String outputId = parentId + "_value2";
-
+
writeStatus("Click on tab1");
clickById(linkId);
waitForAjaxCompletion();
@@ -80,12 +80,12 @@
Assert.assertTrue(isVisibleById(tabId2));
Assert.assertFalse(isVisibleById(tabId4));
try {
- getTextById(tabId1);
- Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered for tab panel.");
+ getTextById(tabId1);
+ Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered for tab panel.");
} catch (SeleniumException se) {
-
+
}
-
+
writeStatus("Click on tab2");
linkId = parentId + "tab1_lbl";
clickCommandAndWait(linkId);
@@ -94,34 +94,33 @@
Assert.assertTrue(isVisibleById(tabId1));
Assert.assertFalse(isVisibleById(tabId4));
try {
- getTextById(tabId2);
- Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered for tab panel.");
+ getTextById(tabId2);
+ Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered for tab panel.");
} catch (SeleniumException se) {
-
+
}
-
+
writeStatus("Click on tab3");
linkId = parentId + "tab3_lbl";
clickById(linkId);
AssertValueEquals(inputId, "tab1");
Assert.assertTrue(isVisibleById(tabId1));
-
+
writeStatus("Click on tab4");
linkId = parentId + "tab4_lbl";
clickById(linkId);
Assert.assertTrue(isVisibleById(tabId4));
Assert.assertFalse(isVisibleById(tabId1));
try {
- getTextById(tabId2);
- Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered for tab panel.");
+ getTextById(tabId2);
+ Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered for tab panel.");
} catch (SeleniumException se) {
-
+
}
}
-
+
public String getTestUrl() {
- return "/faces/pages/tabPanel/tabPanelTest.xhtml";
- }
+ return "/faces/pages/tabPanel/tabPanelTest.xhtml";
+ }
-
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java 2008-06-04 10:32:10 UTC (rev 8899)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java 2008-06-04 14:07:49 UTC (rev 8900)
@@ -21,9 +21,9 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -32,169 +32,162 @@
import com.thoughtworks.selenium.SeleniumException;
-public class TogglePanelTest extends SeleniumTestBase implements
- RichSeleniumTest {
-
- public TogglePanelTest() {
- super("http", "localhost", serverPort);
- }
+public class TogglePanelTest extends SeleniumTestBase implements RichSeleniumTest {
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeTest
- @Parameters( { "browser" })
- public void startSelenium(String browser) {
- super.startSelenium(browser);
- }
+ public TogglePanelTest() {
+ super("http", "localhost", serverPort);
+ }
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterTest
- public void stopSelenium() {
- super.stopSelenium();
- }
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
- @Test
- public void testTogglePanelComponent() throws Exception {
- _testTogglePanelComponent(Templates.SIMPLE);
- _testTogglePanelComponent(Templates.DATATABLE);
- _testTogglePanelComponent(Templates.MODALPANEL);
- }
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
- private void _testTogglePanelComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
+ @Test
+ public void testTogglePanelComponent() throws Exception {
+ _testTogglePanelComponent(Template.SIMPLE);
+ _testTogglePanelComponent(Template.DATA_TABLE);
+ _testTogglePanelComponent(Template.MODAL_PANEL);
+ }
- String inputId = parentId + "_value";
- String outputId = parentId + "_value2";
+ private void _testTogglePanelComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form:";
- String controlNext = parentId + "ajax_next";
- String controlOne = parentId + "ajax_one";
- String controlTwo = parentId + "ajax_two";
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_value2";
- String oneFacet = parentId + "ajax_state_one";
- String twoFacet = parentId + "ajax_state_two";
-
- String cleanButton = parentId + "clean";
+ String controlNext = parentId + "ajax_next";
+ String controlOne = parentId + "ajax_one";
+ String controlTwo = parentId + "ajax_two";
- writeStatus("Click on ajax controlNext");
- clickById(controlNext);
- waitForAjaxCompletion();
- //pause(6000, "panel_ajax");
- AssertValueEquals(inputId, "ajax_next");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
- } catch (SeleniumException se) {
+ String oneFacet = parentId + "ajax_state_one";
+ String twoFacet = parentId + "ajax_state_two";
- }
+ String cleanButton = parentId + "clean";
- writeStatus("Click on ajax controlOne");
- clickById(controlOne);
- waitForAjaxCompletion(5000);
- AssertValueEquals(inputId, "ajax_one");
- AssertTextEquals(outputId, "2");
- Assert.assertTrue(isVisibleById(oneFacet));
- try {
- getTextById(twoFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
- } catch (SeleniumException se) {
+ writeStatus("Click on ajax controlNext");
+ clickById(controlNext);
+ waitForAjaxCompletion();
+ // pause(6000, "panel_ajax");
+ AssertValueEquals(inputId, "ajax_next");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(twoFacet));
+ try {
+ getTextById(oneFacet);
+ Assert.fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
+ } catch (SeleniumException se) {
- }
+ }
- writeStatus("Click on ajax controlTwo");
- clickById(controlTwo);
- waitForAjaxCompletion(5000);
- AssertValueEquals(inputId, "ajax_two");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
- } catch (SeleniumException se) {
+ writeStatus("Click on ajax controlOne");
+ clickById(controlOne);
+ waitForAjaxCompletion(5000);
+ AssertValueEquals(inputId, "ajax_one");
+ AssertTextEquals(outputId, "2");
+ Assert.assertTrue(isVisibleById(oneFacet));
+ try {
+ getTextById(twoFacet);
+ Assert.fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
+ } catch (SeleniumException se) {
- }
+ }
- controlNext = parentId + "server_next";
- controlOne = parentId + "server_one";
- controlTwo = parentId + "server_two";
- oneFacet = parentId + "server_state_one";
- twoFacet = parentId + "server_state_two";
+ writeStatus("Click on ajax controlTwo");
+ clickById(controlTwo);
+ waitForAjaxCompletion(5000);
+ AssertValueEquals(inputId, "ajax_two");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(twoFacet));
+ try {
+ getTextById(oneFacet);
+ Assert.fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
+ } catch (SeleniumException se) {
- writeStatus("Click on controlNext");
- clickCommandAndWait(controlNext);
- AssertValueEquals(inputId, "server_next");
- AssertTextEquals(outputId, "2");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
- } catch (SeleniumException se) {
+ }
- }
+ controlNext = parentId + "server_next";
+ controlOne = parentId + "server_one";
+ controlTwo = parentId + "server_two";
+ oneFacet = parentId + "server_state_one";
+ twoFacet = parentId + "server_state_two";
- writeStatus("Click on server controlOne");
- clickCommandAndWait(controlOne);
- AssertValueEquals(inputId, "server_one");
- AssertTextEquals(outputId, "3");
- Assert.assertTrue(isVisibleById(oneFacet));
- try {
- getTextById(twoFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
- } catch (SeleniumException se) {
+ writeStatus("Click on controlNext");
+ clickCommandAndWait(controlNext);
+ AssertValueEquals(inputId, "server_next");
+ AssertTextEquals(outputId, "2");
+ Assert.assertTrue(isVisibleById(twoFacet));
+ try {
+ getTextById(oneFacet);
+ Assert.fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
+ } catch (SeleniumException se) {
- }
+ }
- writeStatus("Click on server controlTwo");
- clickCommandAndWait(controlTwo);
- AssertValueEquals(inputId, "server_two");
- AssertTextEquals(outputId, "4");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
- } catch (SeleniumException se) {
+ writeStatus("Click on server controlOne");
+ clickCommandAndWait(controlOne);
+ AssertValueEquals(inputId, "server_one");
+ AssertTextEquals(outputId, "3");
+ Assert.assertTrue(isVisibleById(oneFacet));
+ try {
+ getTextById(twoFacet);
+ Assert.fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
+ } catch (SeleniumException se) {
- }
+ }
- controlNext = parentId + "client_next";
- controlOne = parentId + "client_one";
- controlTwo = parentId + "client_two";
- oneFacet = parentId + "client_state_one";
- twoFacet = parentId + "client_state_two";
+ writeStatus("Click on server controlTwo");
+ clickCommandAndWait(controlTwo);
+ AssertValueEquals(inputId, "server_two");
+ AssertTextEquals(outputId, "4");
+ Assert.assertTrue(isVisibleById(twoFacet));
+ try {
+ getTextById(oneFacet);
+ Assert.fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
+ } catch (SeleniumException se) {
- writeStatus("Click on client controlNext");
- clickById(controlNext);
- Assert.assertTrue(isVisibleById(twoFacet));
- Assert.assertFalse(isVisibleById(oneFacet));
+ }
- writeStatus("Click on client controlOne");
- clickById(controlOne);
- Assert.assertTrue(isVisibleById(oneFacet));
- Assert.assertFalse(isVisibleById(twoFacet));
+ controlNext = parentId + "client_next";
+ controlOne = parentId + "client_one";
+ controlTwo = parentId + "client_two";
+ oneFacet = parentId + "client_state_one";
+ twoFacet = parentId + "client_state_two";
- writeStatus("Click on client controlTwo");
- clickById(controlTwo);
- Assert.assertTrue(isVisibleById(twoFacet));
- Assert.assertFalse(isVisibleById(oneFacet));
-
- writeStatus("Clean bean values");
- clickById(cleanButton);
- waitForAjaxCompletion();
- }
+ writeStatus("Click on client controlNext");
+ clickById(controlNext);
+ Assert.assertTrue(isVisibleById(twoFacet));
+ Assert.assertFalse(isVisibleById(oneFacet));
- public String getTestUrl() {
- return "/faces/pages/togglePanel/togglePanelTest.xhtml";
- }
+ writeStatus("Click on client controlOne");
+ clickById(controlOne);
+ Assert.assertTrue(isVisibleById(oneFacet));
+ Assert.assertFalse(isVisibleById(twoFacet));
+ writeStatus("Click on client controlTwo");
+ clickById(controlTwo);
+ Assert.assertTrue(isVisibleById(twoFacet));
+ Assert.assertFalse(isVisibleById(oneFacet));
+
+ writeStatus("Clean bean values");
+ clickById(cleanButton);
+ waitForAjaxCompletion();
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/togglePanel/togglePanelTest.xhtml";
+ }
+
}
15 years, 11 months
JBoss Rich Faces SVN: r8899 - trunk/ui/tooltip/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-06-04 06:32:10 -0400 (Wed, 04 Jun 2008)
New Revision: 8899
Modified:
trunk/ui/tooltip/src/main/config/component/toolTip.xml
Log:
RF-3550--<rich:toolTip> component "Details of usage" section rewriting
Modified: trunk/ui/tooltip/src/main/config/component/toolTip.xml
===================================================================
--- trunk/ui/tooltip/src/main/config/component/toolTip.xml 2008-06-04 10:31:19 UTC (rev 8898)
+++ trunk/ui/tooltip/src/main/config/component/toolTip.xml 2008-06-04 10:32:10 UTC (rev 8899)
@@ -39,25 +39,25 @@
<property>
<name>layout</name>
<classname>java.lang.String</classname>
- <description>Block/inline mode flag. Possible value are: "inline" or "block". Default value is "inline". Tooltip will contain div/span elements respectively.</description>
+ <description>Block/inline mode flag. Possible value are: "inline" or "block". Default value is "inline". Tooltip will contain div/span elements respectively</description>
<defaultvalue><![CDATA["inline"]]></defaultvalue>
</property>
<property>
<name>showDelay</name>
<classname>int</classname>
- <description>Delay in milliseconds before tooltip will be displayed. Default value is "0".</description>
+ <description>Delay in milliseconds before tooltip will be displayed. Default value is "0"</description>
<defaultvalue><![CDATA[0]]></defaultvalue>
</property>
<property>
<name>hideDelay</name>
<classname>int</classname>
- <description>Delay in milliseconds before tooltip will be hidden. Default value is "0".</description>
+ <description>Delay in milliseconds before tooltip will be hidden. Default value is "0"</description>
<defaultvalue><![CDATA[0]]></defaultvalue>
</property>
<property>
<name>zorder</name>
<classname>int</classname>
- <description>The same as CSS z-index for toolTip. Default value is "99".</description>
+ <description>The same as CSS z-index for toolTip. Default value is "99"</description>
<defaultvalue><![CDATA[99]]></defaultvalue>
</property>
<property>
@@ -84,7 +84,7 @@
<property>
<name>for</name>
<classname>java.lang.String</classname>
- <description>Id of the target component.</description>
+ <description>Id of the target component</description>
</property>
@@ -97,13 +97,13 @@
<property>
<name>mode</name>
<classname>java.lang.String</classname>
- <description>controls the way of data loading to tooltip and should have following values client (default), ajax</description>
+ <description>Controls the way of data loading to a tooltip. May have following values: "client" (default) and "ajax"</description>
<defaultvalue><![CDATA["client"]]></defaultvalue>
</property>
<property>
<name>disabled</name>
<classname>boolean</classname>
- <description>If false the components is rendered on the client but JavaScript for calling disabled. Default value is "false".</description>
+ <description>If false the components is rendered on the client but JavaScript for calling disabled. Default value is "false"</description>
<defaultvalue>false</defaultvalue>
</property>
<property>
@@ -111,25 +111,25 @@
<classname>java.lang.String</classname>
<description>Defines direction of the popup list to appear.
Possible values are "top-right", "top-left", "bottom-right", "bottom-left", "auto".
- Default value is "bottom-right".</description>
+ Default value is "bottom-right"</description>
<defaultvalue><![CDATA["bottom-right"]]></defaultvalue>
</property>
<property>
<name>followMouse</name>
<classname>boolean</classname>
- <description>If 'true' tooltip should follow the mouse while it moves over the parent element. Default value is "false".</description>
+ <description>If 'true' tooltip should follow the mouse while it moves over the parent element. Default value is "false"</description>
<defaultvalue>false</defaultvalue>
</property>
<property>
<name>horizontalOffset</name>
<classname>int</classname>
- <description>Sets the horizontal offset between pop-up list and mouse pointer. Default value is "10".</description>
+ <description>Sets the horizontal offset between pop-up list and mouse pointer. Default value is "10"</description>
<defaultvalue>10</defaultvalue>
</property>
<property>
<name>verticalOffset</name>
<classname>int</classname>
- <description>Sets the vertical offset between pop-up list and mouse pointer. Default value is "10".</description>
+ <description>Sets the vertical offset between pop-up list and mouse pointer. Default value is "10"</description>
<defaultvalue>10</defaultvalue>
</property>
<property>
@@ -181,7 +181,7 @@
<property exist="true" existintag="true">
<name>showEvent</name>
<classname>java.lang.String</classname>
- <description>Event that triggers the tooltip. Default value is "onmouseover".</description>
+ <description>Event that triggers the tooltip. Default value is "onmouseover"</description>
<defaultvalue><![CDATA["onmouseover"]]></defaultvalue>
</property>
<property>
@@ -195,7 +195,7 @@
<classname>boolean</classname>
<description>
If the value of the "attached" attribute is true, a component is attached to the parent component;
- if false, component does not listen to activating browser events, but could be activated externally. Default value is "true".
+ if false, component does not listen to activating browser events, but could be activated externally. Default value is "true"
</description>
<defaultvalue>true</defaultvalue>
</property>
@@ -203,7 +203,7 @@
<property>
<name>event</name>
<classname>java.lang.String</classname>
- <description>DEPRECATED. Use showEvent instead. Default value is "mouseover".</description>
+ <description>DEPRECATED. Use showEvent instead. Default value is "mouseover"</description>
<defaultvalue><![CDATA["mouseover"]]></defaultvalue>
</property>
</component>
15 years, 11 months
JBoss Rich Faces SVN: r8898 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-06-04 06:31:19 -0400 (Wed, 04 Jun 2008)
New Revision: 8898
Modified:
trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml
Log:
RF-3550--<rich:toolTip> component "Details of usage" section rewriting
Modified: trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml 2008-06-03 22:45:33 UTC (rev 8897)
+++ trunk/docs/userguide/en/src/main/docbook/included/toolTip.xml 2008-06-04 10:31:19 UTC (rev 8898)
@@ -41,8 +41,8 @@
</tgroup>
</table>
- <section>
- <title>Creating the Component with a Page Tag</title>
+<section>
+ <title id="tab_ccpt">Creating the Component with a Page Tag</title>
<para>To create the simplest variant of <emphasis role="bold"><property><rich:toolTip></property></emphasis>
component on a page, use the following syntax:</para>
@@ -55,9 +55,9 @@
</rich:panel>
...
]]></programlisting>
- </section>
+</section>
- <section>
+<section>
<title>Creating the Component Dynamically Using Java</title>
<para>
<emphasis role="bold">Example:</emphasis>
@@ -69,14 +69,51 @@
]]></programlisting>
</section>
-<section>
-<title>Details of Usage</title>
-<para>
-<property>toolTip</property> main area is a simple rectangle area with any information inside. The content may be defined via
-<emphasis><property>"value"</property></emphasis> attribute as text or via any nested content. When both are defined, the value is displayed as text and nested content
-after the text. <property>toolTip</property> stretches if the content more than the <property>toolTip</property> sizes.
-</para>
-<para>
+ <section>
+ <title>Details of Usage</title>
+ <para>
+ To specify text information, labeled on a <property>tooltip</property>, use <emphasis><property>"value"</property></emphasis> attribute.
+ Images, links, buttons and other RichFaces components also may be put and composed inside <property>tooltip</property>.
+ Text, specified between <property>tooltip's</property> start and end tags will be rendered in browser as simple text.
+ <property>Tooltip</property> borders stretch to enclose it contents.
+ </para>
+ <para>
+ There are three ways to attach a <property>tooltip</property> to a page element.
+ One of them uses nesting (this way is shown on example <link linkend="tab_ccpt">above</link>).
+ In such cases <property>tooltip</property> is attached to the parent component by default.
+ </para>
+ <note>
+ <title>Note:</title>
+ <para>
+ It is recommended to specify <emphasis><property>"id"</property></emphasis> for parent page element to ensure <property>tooltip's</property> correct work.
+ </para>
+ </note>
+ <note>
+ <title>Note:</title>
+ <para>
+ If parent component contains more than one child, it is recommended to define <emphasis role="bold"><property><rich:toolTip></property></emphasis> the last one.
+ </para>
+ </note>
+ <para>
+ Second way uses the attribute <emphasis><property>"for"</property></emphasis>. In this case a <property>tooltip</property> may be defined separately from a page element it is applied to.
+ <emphasis><property>"id"</property></emphasis> for page element is necessary (see the example below).
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:panel id=”panelid”>
+…
+</rich:panel>
+<rich:toolTip value="This is a tooltip content" for=”panelid”/>
+...
+]]></programlisting>
+ <para>Here, the attribute <emphasis><property>"for"</property></emphasis> of a <emphasis role="bold">
+ <property><rich:toolTip></property>
+ </emphasis> component is required. Without it an example doesn't work because HTML elements aren't presented in component tree built by facelets.
+ </para>
+
+ <para>
There is possibility to define a facet with the name "defaultContent". This facet provides the default content to
display while the main content is loaded to a page in an Ajax mode. Thus when <property>toolTip</property> called in an Ajax mode, it
appears with the content defined in the facet and when loading is completed, the content is changed to a loaded one.
@@ -121,14 +158,7 @@
</imageobject>
</mediaobject>
</figure>
- <note>
- <title>Note:</title>
- <para>
- If you define the <emphasis role="bold"><property><rich:toolTip></property></emphasis> attached as the child to some componetns
- and except <emphasis role="bold"><property><rich:toolTip></property></emphasis> there are some other components inside
- it is recommended to define <emphasis role="bold"><property><rich:toolTip></property></emphasis> in code as last component.
- </para>
- </note>
+
<para>
By default, <property>toolTip</property> appears smart positioned. But as you can see from the previous example, you
can define an appearance direction via the corresponding attribute <emphasis><property>"direction"</property></emphasis>. And also it's possible to define vertical and horizontal
@@ -140,12 +170,6 @@
the "delay" attribute (default=0) or after calling JS API function show(). <property>toolTip</property> deactivation occurs after mouseout event on the parent component (excepting the situation when the mouse is hovered onto the <property>toolTip</property> itself) or after calling JS API function hide().
</para>
-<note>
-<title>Note:</title> <para>
- It is recommended to define parent component <emphasis><property>"id"</property></emphasis> for correction of <property>toolTip</property> work.
-</para>
-</note>
-
<para>The attribute <emphasis><property>"for"</property></emphasis> is used for defining the <emphasis><property>"id"</property></emphasis> of an element a toolTip should be attached to. Look at the example:
</para>
@@ -165,10 +189,7 @@
...
]]></programlisting>
- <para>Here, the attribute <emphasis><property>"for"</property></emphasis> of a <emphasis role="bold">
- <property><rich:toolTip></property>
- </emphasis> component is required. Without it an example doesn't work because HTML elements aren't presented in component tree built by facelets.
- </para>
+
<para>
The <emphasis><property>"mode"</property></emphasis> attribute is provided you to control the way of data loading to <property>toolTip</property>. It has following values:
@@ -209,9 +230,9 @@
</para></listitem>
</itemizedlist>
</para>
-</section>
+ </section>
- <section>
+<section>
<title>JavaScript API</title>
<table>
<title>JavaScript API</title>
15 years, 11 months