JBoss Rich Faces SVN: r8741 - in trunk/test-applications/seleniumTest/src/test/java/org: richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-23 20:35:04 -0400 (Fri, 23 May 2008)
New Revision: 8741
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SpacerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java
Log:
Server port externalized as constant
Modified: trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -40,6 +40,8 @@
/** Specifies the time to wait for ajax processing */
protected static final int ajaxCompletionTime = 3000;
+ protected static final String serverPort = "8080";
+
private static final String WINDOW_JS_RESOLVER = "selenium.browserbot.getCurrentWindow().";
/** Parent component id */
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -12,7 +12,7 @@
public class AjaxCommandButtonTest extends SeleniumTestBase implements RichSeleniumTest {
public AjaxCommandButtonTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -11,7 +11,7 @@
public class AjaxCommandLinkTest extends SeleniumTestBase implements RichSeleniumTest {
public AjaxCommandLinkTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -18,7 +18,7 @@
public class AjaxPollTest extends SeleniumTestBase implements RichSeleniumTest {
public AjaxPollTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -11,7 +11,7 @@
public class AjaxRegionTest extends SeleniumTestBase implements RichSeleniumTest {
public AjaxRegionTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -12,7 +12,7 @@
public class AjaxStatusTest extends SeleniumTestBase implements RichSeleniumTest {
public AjaxStatusTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -40,7 +40,7 @@
* Default constructor
*/
public CalendarTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -12,7 +12,7 @@
public class ComboBoxTest extends SeleniumTestBase implements RichSeleniumTest {
public ComboBoxTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -33,7 +33,7 @@
public class ContextMenuTest extends SeleniumTestBase implements RichSeleniumTest {
public ContextMenuTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -12,7 +12,7 @@
public class DataTableTest extends SeleniumTestBase implements RichSeleniumTest {
public DataTableTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -11,7 +11,7 @@
public class DropDownMenuTest extends SeleniumTestBase implements RichSeleniumTest {
public DropDownMenuTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -12,7 +12,7 @@
public class InplaceSelectTest extends SeleniumTestBase implements RichSeleniumTest {
public InplaceSelectTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -13,7 +13,7 @@
public class InputNumberSpinnerTest extends SeleniumTestBase implements RichSeleniumTest {
public InputNumberSpinnerTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -14,7 +14,7 @@
public class JSFunctionTest extends SeleniumTestBase implements RichSeleniumTest {
public JSFunctionTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -11,7 +11,7 @@
public class KeepAliveTest extends SeleniumTestBase implements RichSeleniumTest {
public KeepAliveTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -13,7 +13,7 @@
public class LoadScriptTest extends SeleniumTestBase implements RichSeleniumTest {
public LoadScriptTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -13,7 +13,7 @@
public class LoadStyleTest extends SeleniumTestBase implements RichSeleniumTest {
public LoadStyleTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -53,7 +53,7 @@
private String activeItemText;
public OrderingListTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
public OrderingListTest(String protocol, String host, String port) {
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -34,7 +34,7 @@
public PanelBarTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -12,7 +12,7 @@
public class PanelMenuTest extends SeleniumTestBase implements RichSeleniumTest {
public PanelMenuTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -12,7 +12,7 @@
public class PickListTest extends SeleniumTestBase implements RichSeleniumTest {
public PickListTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -13,7 +13,7 @@
RichSeleniumTest {
public ProgressBarTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -33,7 +33,7 @@
public class SimpleTogglePanelTest extends SeleniumTestBase implements RichSeleniumTest {
public SimpleTogglePanelTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SpacerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SpacerTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SpacerTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -33,7 +33,7 @@
public class SpacerTest extends SeleniumTestBase implements RichSeleniumTest {
public SpacerTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -35,7 +35,7 @@
public class TabPanelTest extends SeleniumTestBase implements RichSeleniumTest {
public TabPanelTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java 2008-05-24 00:25:22 UTC (rev 8740)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java 2008-05-24 00:35:04 UTC (rev 8741)
@@ -36,7 +36,7 @@
RichSeleniumTest {
public TogglePanelTest() {
- super("http", "localhost", "8080");
+ super("http", "localhost", serverPort);
}
/**
16 years, 7 months
JBoss Rich Faces SVN: r8740 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-23 20:25:22 -0400 (Fri, 23 May 2008)
New Revision: 8740
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
SeleniumTest switched to 1.0-SNAPSHOT due to incompatibilities with Vista systems
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-05-23 22:15:03 UTC (rev 8739)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-05-24 00:25:22 UTC (rev 8740)
@@ -27,6 +27,19 @@
<enabled>true</enabled>
</releases>
</repository>
+
+ <repository>
+ <id>openqa-snapshots</id>
+ <name>OpenQA Snapshots Repository</name>
+ <url>http://archiva.openqa.org/repository/snapshots</url>
+ <layout>default</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
</repositories>
<build>
<finalName>seleniumTest</finalName>
@@ -196,13 +209,13 @@
<dependency>
<groupId>org.openqa.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver</artifactId>
- <version>1.0-beta-1</version>
+ <version>1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openqa.selenium.server</groupId>
<artifactId>selenium-server-coreless</artifactId>
- <version>1.0-beta-1</version>
+ <version>1.0-SNAPSHOT</version>
<scope>test</scope>
<exclusions>
<exclusion>
16 years, 7 months
JBoss Rich Faces SVN: r8739 - trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-05-23 18:15:03 -0400 (Fri, 23 May 2008)
New Revision: 8739
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoParser.java
Log:
http://jira.jboss.com/jira/browse/RF-3525 resolved
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoParser.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoParser.java 2008-05-23 16:35:54 UTC (rev 8738)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoParser.java 2008-05-23 22:15:03 UTC (rev 8739)
@@ -790,7 +790,8 @@
} else if (mimeType.startsWith(BaseXMLFilter.APPLICATION_XHTML_XML)) {
_serializer = _XHTMLserializer;
} else if (mimeType.startsWith("text/xml")) {
- _serializer = _XMLserialiser;
+ _serializer = _XHTMLserializer;
+// _serializer = _XMLserialiser;
} else {
return false;
}
16 years, 7 months
JBoss Rich Faces SVN: r8738 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-05-23 12:35:54 -0400 (Fri, 23 May 2008)
New Revision: 8738
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
Log:
http://jira.jboss.com/jira/browse/RF-3163
Description of Plug-n-Skin feature was corrected according to comments of Maksim Kaszynski.
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2008-05-23 16:17:29 UTC (rev 8737)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2008-05-23 16:35:54 UTC (rev 8738)
@@ -2315,78 +2315,153 @@
<section id="StPluggableSkinnability">
<title>Plug-n-Skin</title>
- <para>Plug-n-Skin feature is designed to extend and override the base skin you use,
- it allows to redefine the look of a set of components by taking the base skin as basis and plugging-in custom styles.
+ <para>
+ Plug-n-Skin feature is designed to easily create a new custom skin which extends and overrides a base skin,
+ it allows to redefine the look of a set of components by taking the base skin as basis and plugging-in custom styles
+ as well as to unify the appearance of standard controls and RichFaces components.
- </para>
-
-
-<para>Basically, implementation of this feature is performed the same way as you create your own custom skin.
- For more information, please, read <link linkend="CreatingAndUsingYourOwnSkinFile"> "Creating and Using Your Own Skin File"</link> section of the guide.
- The properties that are used to perform the redefinition of the
- base skin are stored in <name>.skin.properties file (same type of file as you would use for creating your own skin). </para>
-
-
- <para>These are the properties you need to set-up this feature:</para>
-
- <itemizedlist>
- <listitem>
- <para><property>baseSkin</property> – the name of the base skin to be used as basis.
- The look of the skin you define will be affected by new style properties.
- </para>
- </listitem>
+ </para>
- <listitem>
- <para><property>generalStyleSheet</property> -
- a path to the style sheet (<newskinname>.xcss) that imports style sheets of the components to be affected by the new skin
- </para>
+ <para>In order to create your own skin using Plug-n-Skin feature, you can follow these step by step instructions.</para>
+
- </listitem>
-
- <listitem>
- <para><property>extendedStyleSheet</property> - a path to a style sheet that is used to unify the appearance of RichFaces components and standard HTML controls.
- For additional information please read <link linkend="StControlsSkinning">"Standard controls skinning"</link> chapter.
- </para></listitem>
-
-
- <listitem>
- <para><property>gradientType</property> is a predefined property to set the type of gradient applied to the new skin. Possible values are glass, plastic, plain. More information on gradient implementation you can find further in this chapter.
- </para>
- </listitem>
-
-
- </itemizedlist>
-
+
+ <para>First of all, you need to create a template for the new skin.
+ Creation of the template can be performed using Maven build and deployment tool More information on how to configure Maven for RichFaces
+ <ulink url="http://wiki.jboss.org/wiki/HowToConfigureMavenForRichFaces">here</ulink>. You can copy and paste these Maven instructions
+ to command line and execute them.
+ </para>
+
+
+ <programlisting role="XML"><![CDATA[...
+mvn archetype:create
+-DarchetypeGroupId=org.richfaces.cdk
+-DarchetypeArtifactId=maven-archetype-plug-n-skin
+-DarchetypeVersion=RF-VERSION
+-DartifactId=ARTIFACT-ID
+-DgroupId=GROUP-ID -Dversion=VERSION
+...
+]]></programlisting>
+ <para>Primary keys for the command:</para>
+ <itemizedlist>
+ <listitem><para><property>DarchetypeVersion</property> Indicates the RichFaces version. For example, "3.2.1-SNAPSHOT"</para></listitem>
+ <listitem><para><property>DartifactId</property> Artifact id of the project</para></listitem>
+ <listitem><para><property>DgroupId</property> Group id of the project</para></listitem>
+ <listitem><para><property>Dversion</property> The version of the project you create, by default it is "1.0.-SNAPSHOT"</para></listitem>
+ </itemizedlist>
<para>
- As it has already been mentioned the <property><newskinname>.xcss</property> contains a list of style sheeted that the new skin affects.
+ After this operation, a folder with the name of your "ARTIFACT-ID" appears.
+ The folder contains a template of Maven project.
</para>
- <para>Importing of the style sheets that redefine the appearance of component to the <newskinname>.xcss is performed using
- <property><f:importResource></property> tag. Please see the example below.
- </para>
-
- <programlisting role="XML"><![CDATA[...
-<f:importResource src="org/richfaces/newSkinName/componentName.xcss" />
+
+ <para>Next steps will guide you though creating of the skin itself.</para>
+
+
+
+<para>
+In the root folder of Maven project (the one that contains "pom.xml" file)
+you should run the following command in the command line:
+</para>
+
+ <programlisting role="XML"><![CDATA[...
+mvn cdk:add-skin -Dname=SKIN-NAME -Dpackage=SKIN-PACKAGE
...
]]></programlisting>
-
- <para>Here is template of the <property><newskinname>.xcss</property> file.</para>
- <programlisting role="XML"><![CDATA[
-<f:template xmlns:f='http:/jsf.exadel.com/template'
- xmlns:u='http:/jsf.exadel.com/template/util'
- xmlns="http://www.w3.org/1999/xhtml" >
- <f:importResource src="org/richfaces/newSkinName/calendar.xcss" />
- <f:importResource src="org/richfaces/newSkinName/combobox.xcss" />
+
+ <para>Primary keys for the command:</para>
+
+ <itemizedlist>
+ <listitem><para>
+ <property>Dname</property> defines the name of the new skin
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <property>Dpackage</property> base package of the skin. By default "groupId" of the project is used.
+ </para>
+ </listitem>
+ <para>
+ Additional optional keys for the command:
+ </para>
+ <listitem>
+ <para>
+ <property>DbaseSkin</property> defines the name of the base skin.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <property>DcreateExt</property> if set to "true", extended CSS classes are added. For more information, please, see
+ <link linkend="StControlsSkinning">"Standard controls skinning"</link>
+ </para>
+ </listitem>
+</itemizedlist>
+
+
+ <para>As a result of the performed operations the following files and folders are created:</para>
+
+ <itemizedlist>
+ <listitem><para><property>BaseImage.java</property> - the base class to store images. Location: "\src\main\java\SKIN-PACKAGE\SKIN-NAME\images\"</para></listitem>
+ <listitem><para><property>BaseImageTest.java</property> - a test version of a class that stores images. Location: "\src\test\java\SKIN-PACKAGE\SKIN-NAME\images\" </para></listitem>
+ <listitem><para><property>XCSS files</property> - XCSS files define the new look of RichFaces components affected by the new skin. Location: "\src\main\resources\SKIN-PACKAGE\SKIN-NAME\css\" </para></listitem>
+ <listitem><para><property>SKIN-NAME.properties </property> - a XCSS file that contains properties of the new skin. Location: "\src\main\resources\SKIN-PACKAGE\SKIN-NAME\css\" </para>
+ <para>The following properties are used to configure the file:</para>
+
+
+ <itemizedlist>
+ <listitem>
+ <para><property>baseSkin</property> – the name of the base skin to be used as basis.
+ The look of the skin you define will be affected by new style properties.
+ </para>
+ </listitem>
+ <listitem>
+ <para><property>generalStyleSheet</property> -
+ a path to the style sheet (<SKIN-NAME>.xcss) that imports style sheets of the components to be affected by the new skin.
+ </para>
+ </listitem>
+ <listitem>
+ <para><property>extendedStyleSheet</property> - a path to a style sheet that is used to unify the appearance of RichFaces components and standard HTML controls.
+ For additional information please read <link linkend="StControlsSkinning">"Standard controls skinning"</link> chapter.
+ </para></listitem>
+ <listitem>
+ <para><property>gradientType</property> is a predefined property to set the type of gradient applied to the new skin. Possible values are glass, plastic, plain. More information on gradient implementation you can find further in this chapter.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para><property>SKIN-NAME.xcss </property> - a XCSS file that imports XCSS files of the components to be affected by the new skin. Location: "src\main\resources\META-INF\skins " </para></listitem>
+ <listitem><para><property>XCSS files</property> If the command is executed with the "DcreateExt" key set to "true", XCSS files that define style for standard controls will be created. Location: "\src\main\resources\SKIN-PACKAGE\SKIN-NAME\css\". </para></listitem>
+ <listitem><para><property>SKIN-NAME-ext.xcss </property> If the command is executed with the "DcreateExt" key set to "true", the configuration SKIN-NAME-ext.xcss file that imports XCSS file defining styles for the standard controls will be created. Location: "src\main\resources\META-INF\skins ". </para></listitem>
+ <listitem><para><property>SKIN-NAME-resources.xml</property> - the file contains the description of all listed above files. Location: "src\main\config\resources ". </para></listitem>
+ </itemizedlist>
+
+
+
+ <para>Having performed the previous steps you can proceed to building the new skin. This can be done by executing the given below command in the command line in the root folder of you skin project (the one that contains pom.xml file). </para>
+
+<programlisting role="XML"><![CDATA[...
+mvn clean install
...
- <f:importResource src="org/richfaces/newSkinName/tree.xcss" />
- <f:importResource src="org/richfaces/newSkinName/virtualEarth.xcss" />
-</f:template>
-]]></programlisting>
+]]></programlisting>
+
+
+
+ <para>Now, you can use your newly-created skin in your project by adding your new skin parameters to web.xml file.</para>
+
+ <programlisting role="XML"><![CDATA[...
+<context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>SKIN-NAME</param-value>
+</context-param>
+...
+]]></programlisting>
-
+
<para>
- So, now having imported the XCSS files with style sheets of components you want to be affected by the new skin, you can start redefining style properties for each component in the
- <property> componentName.xcss</property> files. Please study the example below.</para>
+ So, now having built your new skin you can start redefining style properties in the corresponding XCSS files(located in "\src\main\resources\SKIN-PACKAGE\SKIN-NAME\css\" folder).
+ In the example below, it's shown how to redefine the style properties for "combobox" component.</para>
<programlisting role="XML"><![CDATA[...
<u:selector name=".rich-combobox-item-selected">
@@ -2406,7 +2481,6 @@
...
]]></programlisting>
- <para>In the shown example, new skin properties are applied to the <property>combobox</property> component.</para>
<para>Please notice that <property>background-image</property> can be used to set a predefined gradient by means of
<property><f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient"></property> and the <property>gradientType</property> constant set to one of the possible values.
</para>
@@ -2421,22 +2495,9 @@
<listitem><para> gradientType</para></listitem>
</itemizedlist>
- <para>The base skin and the new skin should be set in web.xml</para>
- <programlisting role="XML"><![CDATA[...
- <context-param>
- <param-name>org.richfaces.SKIN</param-name>
- <param-value>#{skinBean.skin}</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.BASE_SKIN</param-name>
- <param-value>#{skinBean.baseSkin}</param-value>
- </context-param>
-...
-]]></programlisting>
-
</section>
</section>
16 years, 7 months
JBoss Rich Faces SVN: r8736 - trunk/test-applications/seleniumTest/src/main/webapp/layout.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-05-23 12:08:27 -0400 (Fri, 23 May 2008)
New Revision: 8736
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml
Log:
Modified: trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml 2008-05-23 16:05:55 UTC (rev 8735)
+++ trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml 2008-05-23 16:08:27 UTC (rev 8736)
@@ -70,13 +70,6 @@
<div>
<ui:insert name="template"/>
</div>
- <div>
- <h:panelGroup>
- <h:commandButton value="Load 'simple' template" onclick="loadTemplate('simple'); return false;" />
- <h:commandButton value="Load 'dataTable' template" onclick="loadTemplate('dataTable'); return false;" />
- <h:commandButton value="Load 'modalPanel' template" onclick="loadTemplate('modalPanel'); return false;" />
- </h:panelGroup>
- </div>
</h:panelGrid>
<script type="text/javascript">
window.done=false; A4J.AJAX.AddListener(new A4J.AJAX.Listener(function(){window.done=true;}));
16 years, 7 months
JBoss Rich Faces SVN: r8735 - in trunk/test-applications/seleniumTest/src/main: webapp/WEB-INF and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-05-23 12:05:55 -0400 (Fri, 23 May 2008)
New Revision: 8735
Modified:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TemplateBean.java
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
Log:
Modified: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TemplateBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TemplateBean.java 2008-05-23 16:04:20 UTC (rev 8734)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TemplateBean.java 2008-05-23 16:05:55 UTC (rev 8735)
@@ -36,6 +36,10 @@
String template = reqMap.get(PARAM_NAME);
this.template = template != null ? template : "simple";
}
+
+ public String getTemplateId() {
+ return template;
+ }
/**
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-05-23 16:04:20 UTC (rev 8734)
+++ trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-05-23 16:05:55 UTC (rev 8735)
@@ -7,7 +7,14 @@
<faces-config>
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
- </application>
+ </application>
+
+ <managed-bean>
+ <managed-bean-name>indexBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.IndexBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+
<!-- queue.xhtml -->
<managed-bean>
<managed-bean-name>bean</managed-bean-name>
16 years, 7 months
JBoss Rich Faces SVN: r8734 - in trunk/test-applications/seleniumTest/src: main/webapp/layout and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-05-23 12:04:20 -0400 (Fri, 23 May 2008)
New Revision: 8734
Added:
trunk/test-applications/seleniumTest/src/main/webapp/index.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java
Removed:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/index.jsp
trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/template/dataTable.xhtml
Log:
Modified: trunk/test-applications/seleniumTest/src/main/webapp/index.jsp
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/index.jsp 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/main/webapp/index.jsp 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,5 +1 @@
-<html>
-<body>
-<h2>Hello World!</h2>
-</body>
-</html>
+<jsp:forward page="faces/index.xhtml"></jsp:forward>
Added: trunk/test-applications/seleniumTest/src/main/webapp/index.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/index.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/index.xhtml 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+<body>
+ <h:dataTable value="#{indexBean.list}" var="var">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Component"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{var.name}"></h:outputText>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Link"></h:outputText>
+ </f:facet>
+ <h:outputLink value="#{facesContext.externalContext.requestContextPath}/faces/pages/#{var.link}">test</h:outputLink>
+ </h:column>
+ </h:dataTable>
+</body>
+</html>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml 2008-05-23 16:04:20 UTC (rev 8734)
@@ -83,6 +83,29 @@
</script>
<div id="_Selenium_Test_ControlPoint2" style="display: none;">Control2</div>
+<hr />
+<table style="background-color: #F2F2F2">
+<tr>
+<td>
+Current Template:
+</td>
+<td>
+ <h:selectOneMenu value="#{templateBean.templateId}" readonly="true" id="_Selenium_Test_Template_id">
+ <f:selectItem itemValue="simple" itemLabel="Simple"/>
+ <f:selectItem itemValue="dataTable" itemLabel="DataTable"/>
+ <f:selectItem itemValue="modalPanel" itemLabel="Modal Panel"/>
+ </h:selectOneMenu>
+</td>
+<td>
+ <a href="#" onclick="loadTemplate(document.getElementById('_Selenium_Test_Template_id').value); return false;">Load</a>
+</td>
+</tr>
+<tr>
+<td colspan="2">
+ <a href="#{facesContext.externalContext.requestContextPath}/faces/index.xhtml">home</a>
+</td>
+</tr>
+</table>
</body>
</f:view>
</html>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/src/main/webapp/template/dataTable.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,94 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-
-public class AjaxCommandButtonTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public AjaxCommandButtonTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testAjaxCommandButtonComponent() throws Exception {
- _testAjaxCommandButtonComponent(Templates.SIMPLE);
- _testAjaxCommandButtonComponent(Templates.DATATABLE);
- _testAjaxCommandButtonComponent(Templates.MODALPANEL);
- }
-
- private void _testAjaxCommandButtonComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
-
- String buttonId = parentId + "b1";
- String inputId = parentId + "_value";
-
- writeStatus("Click button 1 : ");
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "12345");
-
- writeStatus("Click button 1 again: ");
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "123452345");
-
- buttonId = parentId + "b2";
-
- writeStatus("Click button 2: ");
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "1234523455");
-
- buttonId = parentId + "b3";
-
- writeStatus("Click button 3: ");
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "1234523455");
-
- buttonId = parentId + "b4";
-
- writeStatus("Click button 4: ");
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "12345234555");
-
- buttonId = parentId + "b5";
-
- writeStatus("Click button 5: ");
- clickById(buttonId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "12345234555");
-
- }
-
- public String getTestUrl() {
- return "/faces/pages/ajaxCommandButton/ajaxButtonTest.xhtml";
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,94 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+
+public class AjaxCommandButtonTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public AjaxCommandButtonTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testAjaxCommandButtonComponent() throws Exception {
+ _testAjaxCommandButtonComponent(Templates.SIMPLE);
+ _testAjaxCommandButtonComponent(Templates.DATATABLE);
+ _testAjaxCommandButtonComponent(Templates.MODALPANEL);
+ }
+
+ private void _testAjaxCommandButtonComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+
+ String buttonId = parentId + "b1";
+ String inputId = parentId + "_value";
+
+ writeStatus("Click button 1 : ");
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "12345");
+
+ writeStatus("Click button 1 again: ");
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "123452345");
+
+ buttonId = parentId + "b2";
+
+ writeStatus("Click button 2: ");
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "1234523455");
+
+ buttonId = parentId + "b3";
+
+ writeStatus("Click button 3: ");
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "1234523455");
+
+ buttonId = parentId + "b4";
+
+ writeStatus("Click button 4: ");
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "12345234555");
+
+ buttonId = parentId + "b5";
+
+ writeStatus("Click button 5: ");
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "12345234555");
+
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/ajaxCommandButton/ajaxButtonTest.xhtml";
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,93 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class AjaxCommandLinkTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public AjaxCommandLinkTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testAjaxCommandLinkComponent() throws Exception {
- _testAjaxCommandLinkComponent(Templates.SIMPLE);
- _testAjaxCommandLinkComponent(Templates.DATATABLE);
- _testAjaxCommandLinkComponent(Templates.MODALPANEL);
- }
-
- private void _testAjaxCommandLinkComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
-
- String LinkId = parentId + "l1";
- String inputId = parentId + "_value";
-
- writeStatus("Click link 1 : ");
- clickById(LinkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "12345");
-
- writeStatus("Click link 1 again: ");
- clickById(LinkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "123452345");
-
- LinkId = parentId + "l2";
-
- writeStatus("Click link 2 : ");
- clickById(LinkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "1234523455");
-
- LinkId = parentId + "l3";
-
- writeStatus("Click link 3 : ");
- clickById(LinkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "1234523455");
-
- LinkId = parentId + "l4";
-
- writeStatus("Click link 4 : ");
- clickById(LinkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "12345234555");
-
- LinkId = parentId + "l5";
-
- writeStatus("Click link 5 : ");
- clickById(LinkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "12345234555");
-
- }
-
- public String getTestUrl() {
- return "/faces/pages/ajaxCommandLink/ajaxLinkTest.xhtml";
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,93 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class AjaxCommandLinkTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public AjaxCommandLinkTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testAjaxCommandLinkComponent() throws Exception {
+ _testAjaxCommandLinkComponent(Templates.SIMPLE);
+ _testAjaxCommandLinkComponent(Templates.DATATABLE);
+ _testAjaxCommandLinkComponent(Templates.MODALPANEL);
+ }
+
+ private void _testAjaxCommandLinkComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+
+ String LinkId = parentId + "l1";
+ String inputId = parentId + "_value";
+
+ writeStatus("Click link 1 : ");
+ clickById(LinkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "12345");
+
+ writeStatus("Click link 1 again: ");
+ clickById(LinkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "123452345");
+
+ LinkId = parentId + "l2";
+
+ writeStatus("Click link 2 : ");
+ clickById(LinkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "1234523455");
+
+ LinkId = parentId + "l3";
+
+ writeStatus("Click link 3 : ");
+ clickById(LinkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "1234523455");
+
+ LinkId = parentId + "l4";
+
+ writeStatus("Click link 4 : ");
+ clickById(LinkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "12345234555");
+
+ LinkId = parentId + "l5";
+
+ writeStatus("Click link 5 : ");
+ clickById(LinkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "12345234555");
+
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/ajaxCommandLink/ajaxLinkTest.xhtml";
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,80 +0,0 @@
-/**
- *
- */
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-/**
- * @author Andrey Markavstov
- *
- */
-public class AjaxPollTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public AjaxPollTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
- String pollId = parentId + "poll";
- String inputId = parentId + "_value";
-
- writeStatus("Start polling...");
- clickById(parentId + "_enabled");
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "1");
-
- writeStatus("Polling in progress...");
- pause(1500, pollId);
- AssertValueNotEquals(inputId, "1");
- waiteForCondition("document.getElementById('"+inputId+"').value == 8", 7000);
-
- pause(1500, pollId);
- writeStatus("Polling should be stopped...");
- AssertValueEquals(inputId, "8");
- AssertTextEquals(parentId + "_text", "Polling");
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.test.base.RichSeleniumTest#getTestUrl()
- */
- public String getTestUrl() {
- return "/faces/pages/ajaxPoll/ajaxPollTest.xhtml";
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxPollTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,80 @@
+/**
+ *
+ */
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+/**
+ * @author Andrey Markavstov
+ *
+ */
+public class AjaxPollTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public AjaxPollTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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(getTestUrl(), template);
+ String parentId = getParentId() + "_form:";
+ String pollId = parentId + "poll";
+ String inputId = parentId + "_value";
+
+ writeStatus("Start polling...");
+ clickById(parentId + "_enabled");
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "1");
+
+ writeStatus("Polling in progress...");
+ pause(1500, pollId);
+ AssertValueNotEquals(inputId, "1");
+ waiteForCondition("document.getElementById('"+inputId+"').value == 8", 7000);
+
+ pause(1500, pollId);
+ writeStatus("Polling should be stopped...");
+ AssertValueEquals(inputId, "8");
+ AssertTextEquals(parentId + "_text", "Polling");
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.test.base.RichSeleniumTest#getTestUrl()
+ */
+ public String getTestUrl() {
+ return "/faces/pages/ajaxPoll/ajaxPollTest.xhtml";
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,98 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class AjaxRegionTest extends SeleniumTestBase {
-
- public AjaxRegionTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testAjaxRegionComponent() throws Exception {
- _testAjaxRegionComponent(Templates.SIMPLE);
- _testAjaxRegionComponent(Templates.DATATABLE);
- _testAjaxRegionComponent(Templates.MODALPANEL);
- }
-
- private void _testAjaxRegionComponent(Templates template) {
- renderPage("/faces/pages/ajaxRegion/ajaxRegionTest.xhtml", template);
-
- String parentId = getParentId() + "_form:";
-
- writeStatus("check nested regions");
-
- String externalLink = parentId + "externalLink";
- String internalLink = parentId + "internalLink";
-
- String internalElemId = parentId + "internal";
- String externalElemId = parentId + "external";
-
- selenium.type(internalElemId, "5");
- selenium.type(externalElemId, "5");
-
- clickById(internalLink);
- waitForAjaxCompletion();
- AssertValueEquals(internalElemId, "5");
- AssertValueEquals(externalElemId, "0");
-
- selenium.type(internalElemId, "10");
- selenium.type(externalElemId, "10");
-
- clickById(externalLink);
- waitForAjaxCompletion();
- AssertValueEquals(internalElemId, "10");
- AssertValueEquals(externalElemId, "10");
-
- writeStatus("verify \"selfRendered\" component's attribute");
-
- String selfRenderedLink = parentId + "selfRenderedLink";
- clickById(selfRenderedLink);
- waitForAjaxCompletion();
- AssertNotPresent("transientText");
-
- writeStatus("verify \"renderRegionOnly\" component's attribute");
-
- String renderOnlyLink = parentId + "renderOnlyLink";
- String renderLink = parentId + "renderLink";
-
- String renderOnlyElemId = parentId + "renderOnly";
- String renderElemId = parentId + "render";
-
- selenium.type(renderOnlyElemId, "7");
-
- clickById(renderOnlyLink);
-
- AssertValueEquals(renderOnlyElemId, "7");
- AssertValueEquals(renderElemId, "0");
-
- selenium.type(renderElemId, "11");
- clickById(renderLink);
-
- AssertValueEquals(renderOnlyElemId, "11");
- AssertValueEquals(renderElemId, "11");
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxRegionTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,103 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class AjaxRegionTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public AjaxRegionTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testAjaxRegionComponent() throws Exception {
+ _testAjaxRegionComponent(Templates.SIMPLE);
+ _testAjaxRegionComponent(Templates.DATATABLE);
+ _testAjaxRegionComponent(Templates.MODALPANEL);
+ }
+
+ private void _testAjaxRegionComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+
+ writeStatus("check nested regions");
+
+ String externalLink = parentId + "externalLink";
+ String internalLink = parentId + "internalLink";
+
+ String internalElemId = parentId + "internal";
+ String externalElemId = parentId + "external";
+
+ selenium.type(internalElemId, "5");
+ selenium.type(externalElemId, "5");
+
+ clickById(internalLink);
+ waitForAjaxCompletion();
+ AssertValueEquals(internalElemId, "5");
+ AssertValueEquals(externalElemId, "0");
+
+ selenium.type(internalElemId, "10");
+ selenium.type(externalElemId, "10");
+
+ clickById(externalLink);
+ waitForAjaxCompletion();
+ AssertValueEquals(internalElemId, "10");
+ AssertValueEquals(externalElemId, "10");
+
+ writeStatus("verify \"selfRendered\" component's attribute");
+
+ String selfRenderedLink = parentId + "selfRenderedLink";
+ clickById(selfRenderedLink);
+ waitForAjaxCompletion();
+ AssertNotPresent("transientText");
+
+ writeStatus("verify \"renderRegionOnly\" component's attribute");
+
+ String renderOnlyLink = parentId + "renderOnlyLink";
+ String renderLink = parentId + "renderLink";
+
+ String renderOnlyElemId = parentId + "renderOnly";
+ String renderElemId = parentId + "render";
+
+ selenium.type(renderOnlyElemId, "7");
+
+ clickById(renderOnlyLink);
+
+ AssertValueEquals(renderOnlyElemId, "7");
+ AssertValueEquals(renderElemId, "0");
+
+ selenium.type(renderElemId, "11");
+ clickById(renderLink);
+
+ AssertValueEquals(renderOnlyElemId, "11");
+ AssertValueEquals(renderElemId, "11");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/ajaxRegion/ajaxRegionTest.xhtml";
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,86 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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 AjaxStatusTest extends SeleniumTestBase {
-
- public AjaxStatusTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testAjaxStatusComponent() throws Exception {
- _testAjaxStatusComponent(Templates.SIMPLE);
- _testAjaxStatusComponent(Templates.DATATABLE);
- _testAjaxStatusComponent(Templates.MODALPANEL);
- }
-
- private void _testAjaxStatusComponent(Templates template) {
- renderPage("/faces/pages/ajaxStatus/ajaxStatusTest.xhtml", template);
-
- String parentId = getParentId() + "_form:";
- String btn1 = parentId + "button1";
- clickById(btn1);
-
- String reg1Status = parentId + "region1:status";
-
- writeStatus("Ajax request is in progress");
-
- AssertVisible(reg1Status + ".start");
- AssertNotVisible(reg1Status + ".stop");
- String start = getTextById(reg1Status + ".start");
- Assert.assertTrue(start.startsWith("In progress..."));
- pause(3000, reg1Status);
-
- writeStatus("Ajax request completed");
-
- AssertNotVisible(reg1Status + ".start");
- AssertVisible(reg1Status + ".stop");
- String stop = getTextById(reg1Status + ".stop");
- Assert.assertTrue(stop.startsWith("Complete"));
-
- String btn2 = parentId + "button2";
- clickById(btn2);
-
- String reg2Status = parentId + "region2:status";
-
- writeStatus("Ajax request is in progress");
-
- AssertVisible(reg2Status + ".start");
- AssertNotVisible(reg2Status + ".stop");
- start = getTextById(reg2Status + ".start");
- Assert.assertTrue(start.startsWith("In progress..."));
- pause(3000, reg2Status);
-
- writeStatus("Ajax request completed");
-
- AssertNotVisible(reg2Status + ".start");
- AssertVisible(reg2Status + ".stop");
- stop = getTextById(reg1Status + ".stop");
- Assert.assertTrue(stop.startsWith("Complete"));
-
- }
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxStatusTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,91 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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 AjaxStatusTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public AjaxStatusTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testAjaxStatusComponent() throws Exception {
+ _testAjaxStatusComponent(Templates.SIMPLE);
+ _testAjaxStatusComponent(Templates.DATATABLE);
+ _testAjaxStatusComponent(Templates.MODALPANEL);
+ }
+
+ private void _testAjaxStatusComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+ String btn1 = parentId + "button1";
+ clickById(btn1);
+
+ String reg1Status = parentId + "region1:status";
+
+ writeStatus("Ajax request is in progress");
+
+ AssertVisible(reg1Status + ".start");
+ AssertNotVisible(reg1Status + ".stop");
+ String start = getTextById(reg1Status + ".start");
+ Assert.assertTrue(start.startsWith("In progress..."));
+ pause(3000, reg1Status);
+
+ writeStatus("Ajax request completed");
+
+ AssertNotVisible(reg1Status + ".start");
+ AssertVisible(reg1Status + ".stop");
+ String stop = getTextById(reg1Status + ".stop");
+ Assert.assertTrue(stop.startsWith("Complete"));
+
+ String btn2 = parentId + "button2";
+ clickById(btn2);
+
+ String reg2Status = parentId + "region2:status";
+
+ writeStatus("Ajax request is in progress");
+
+ AssertVisible(reg2Status + ".start");
+ AssertNotVisible(reg2Status + ".stop");
+ start = getTextById(reg2Status + ".start");
+ Assert.assertTrue(start.startsWith("In progress..."));
+ pause(3000, reg2Status);
+
+ writeStatus("Ajax request completed");
+
+ AssertNotVisible(reg2Status + ".start");
+ AssertVisible(reg2Status + ".stop");
+ stop = getTextById(reg1Status + ".stop");
+ Assert.assertTrue(stop.startsWith("Complete"));
+
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/ajaxStatus/ajaxStatusTest.xhtml";
+ }
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,148 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces;
-
-import java.text.ParseException;
-import java.util.Date;
-
-import org.ajax4jsf.CalendarTestBean;
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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 CalendarTest extends SeleniumTestBase implements RichSeleniumTest {
-
- /**
- * Default constructor
- */
- public CalendarTest() {
- super("http", "localhost", "8080");
- }
-
-
- /**
- * 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 testContextMenuComponent() throws Exception {
- _testSelectDateComponent(Templates.SIMPLE);
- _testCalendarComponent(Templates.DATATABLE);
- _testCalendarComponent(Templates.MODALPANEL);
- }
-
- private void _testCalendarComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String containerId = getParentId() + "_form:";
- String calendarOpenedId = containerId + "calendar";
- String calendarCollapsedId = calendarOpenedId + "Popup";
- String calendarInputDate = calendarOpenedId + "InputDate";
- String calendarPopupButton = calendarCollapsedId + "Button";
- String outputPanel = containerId + "outputPanel";
-
- Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
-
- writeStatus("Mouse click on calendar InputDate field");
- clickById(calendarInputDate);
-
- Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
-
- writeStatus("Mouse click outside calendar");
- clickById(outputPanel);
-
- Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
-
- writeStatus("Mouse click on calendar popup button");
- clickById(calendarPopupButton);
-
- Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
- }
-
- private void _testSelectDateComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- Date newSelectedDate = CalendarTestBean.getDayInMay(15);
-
- String containerId = getParentId() + "_form:";
- String calendarOpenedId = containerId + "calendar";
- String calendarCollapsedId = calendarOpenedId + "Popup";
- String calendarInputDate = calendarOpenedId + "InputDate";
- String calendarPopupButton = calendarCollapsedId + "Button";
- String outputPanel = containerId + "outputPanel";
-
- Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
- writeStatus("Mouse click on calendar popup button");
- clickById(calendarPopupButton);
- Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
-
- String inputDateString = getValueById(calendarInputDate);
- Date readDate = null;
- try {
- readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
- } catch(ParseException parseException) {
- // skip exception
- }
- Assert.assertEquals(readDate, CalendarTestBean.DEFAULT_DATE, "Default date representation is wrong!");
-
- // click on 15th of May
- String newSelectedDateId = calendarOpenedId + "DayCell18";
- clickById(newSelectedDateId);
-
- writeStatus("Mouse click outside calendar");
- clickById(outputPanel);
-
- inputDateString = getValueById(calendarInputDate);
- try {
- readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
- } catch(ParseException parseException) {
- // skip exception
- }
- 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!");
-
-
- }
-
- public String getTestUrl() {
- return "/faces/pages/calendar/calendarTest.xhtml";
- }
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,148 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import java.text.ParseException;
+import java.util.Date;
+
+import org.ajax4jsf.CalendarTestBean;
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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 CalendarTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ /**
+ * Default constructor
+ */
+ public CalendarTest() {
+ super("http", "localhost", "8080");
+ }
+
+
+ /**
+ * 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 testContextMenuComponent() throws Exception {
+ _testSelectDateComponent(Templates.SIMPLE);
+ _testCalendarComponent(Templates.DATATABLE);
+ _testCalendarComponent(Templates.MODALPANEL);
+ }
+
+ private void _testCalendarComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String containerId = getParentId() + "_form:";
+ String calendarOpenedId = containerId + "calendar";
+ String calendarCollapsedId = calendarOpenedId + "Popup";
+ String calendarInputDate = calendarOpenedId + "InputDate";
+ String calendarPopupButton = calendarCollapsedId + "Button";
+ String outputPanel = containerId + "outputPanel";
+
+ Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
+
+ writeStatus("Mouse click on calendar InputDate field");
+ clickById(calendarInputDate);
+
+ Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
+
+ writeStatus("Mouse click outside calendar");
+ clickById(outputPanel);
+
+ Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
+
+ writeStatus("Mouse click on calendar popup button");
+ clickById(calendarPopupButton);
+
+ Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
+ }
+
+ private void _testSelectDateComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ Date newSelectedDate = CalendarTestBean.getDayInMay(15);
+
+ String containerId = getParentId() + "_form:";
+ String calendarOpenedId = containerId + "calendar";
+ String calendarCollapsedId = calendarOpenedId + "Popup";
+ String calendarInputDate = calendarOpenedId + "InputDate";
+ String calendarPopupButton = calendarCollapsedId + "Button";
+ String outputPanel = containerId + "outputPanel";
+
+ Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
+ writeStatus("Mouse click on calendar popup button");
+ clickById(calendarPopupButton);
+ Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
+
+ String inputDateString = getValueById(calendarInputDate);
+ Date readDate = null;
+ try {
+ readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
+ } catch(ParseException parseException) {
+ // skip exception
+ }
+ Assert.assertEquals(readDate, CalendarTestBean.DEFAULT_DATE, "Default date representation is wrong!");
+
+ // click on 15th of May
+ String newSelectedDateId = calendarOpenedId + "DayCell18";
+ clickById(newSelectedDateId);
+
+ writeStatus("Mouse click outside calendar");
+ clickById(outputPanel);
+
+ inputDateString = getValueById(calendarInputDate);
+ try {
+ readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
+ } catch(ParseException parseException) {
+ // skip exception
+ }
+ 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!");
+
+
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/calendar/calendarTest.xhtml";
+ }
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,83 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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 ComboBoxTest extends SeleniumTestBase {
-
- public ComboBoxTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testComboBoxComponent() throws Exception {
- _testComboBoxComponent(Templates.SIMPLE);
- _testComboBoxComponent(Templates.DATATABLE);
- _testComboBoxComponent(Templates.MODALPANEL);
- }
-
- private void _testComboBoxComponent(Templates template) {
- renderPage("/faces/pages/comboBox/comboBoxTest.xhtml", template);
-
- String parentId = getParentId() + "_form:";
-
- String predefinedCBId = parentId + "predefined";
- String selectItemsCBId = parentId + "selectItems";
- String suggestionValuesCBId = parentId + "suggestionValues";
-
- writeStatus("check components' default labels");
-
- getTextById(predefinedCBId + "comboboxField").startsWith("Select a");
- getTextById(selectItemsCBId + "comboboxField").startsWith("Select a");
- getTextById(suggestionValuesCBId + "comboboxField").startsWith("Select a");
-
- writeStatus("check a combobox with predefined suggestions");
-
- clickById(predefinedCBId);
- writeStatus("type \"Hunt\"");
-
- selenium.type(predefinedCBId + "comboboxField", "Hunt");
- selenium.typeKeys(predefinedCBId + "comboboxField", "Hunt");
-
- Assert.assertTrue(isVisibleById(predefinedCBId + "list"), "Component pop-up should show up on click");
-
- clickById(predefinedCBId + "list");
-
- Assert.assertFalse(isVisibleById(predefinedCBId + "list"), "Component pop-up has to be closed");
- Assert.assertEquals(getValue(predefinedCBId), "Hunter");
-
- delay(2000);
- }
-
- /**
- * Gets component value.
- * @param clientId
- * @return
- */
- private String getValue(String clientId) {
- return runScript("$('" + clientId + "comboboxValue').value;");
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,88 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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 ComboBoxTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public ComboBoxTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testComboBoxComponent() throws Exception {
+ _testComboBoxComponent(Templates.SIMPLE);
+ _testComboBoxComponent(Templates.DATATABLE);
+ _testComboBoxComponent(Templates.MODALPANEL);
+ }
+
+ private void _testComboBoxComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+
+ String predefinedCBId = parentId + "predefined";
+ String selectItemsCBId = parentId + "selectItems";
+ String suggestionValuesCBId = parentId + "suggestionValues";
+
+ writeStatus("check components' default labels");
+
+ getTextById(predefinedCBId + "comboboxField").startsWith("Select a");
+ getTextById(selectItemsCBId + "comboboxField").startsWith("Select a");
+ getTextById(suggestionValuesCBId + "comboboxField").startsWith("Select a");
+
+ writeStatus("check a combobox with predefined suggestions");
+
+ clickById(predefinedCBId);
+ writeStatus("type \"Hunt\"");
+
+ selenium.type(predefinedCBId + "comboboxField", "Hunt");
+ selenium.typeKeys(predefinedCBId + "comboboxField", "Hunt");
+
+ Assert.assertTrue(isVisibleById(predefinedCBId + "list"), "Component pop-up should show up on click");
+
+ clickById(predefinedCBId + "list");
+
+ Assert.assertFalse(isVisibleById(predefinedCBId + "list"), "Component pop-up has to be closed");
+ Assert.assertEquals(getValue(predefinedCBId), "Hunter");
+
+ delay(2000);
+ }
+
+ /**
+ * Gets component value.
+ * @param clientId
+ * @return
+ */
+ private String getValue(String clientId) {
+ return runScript("$('" + clientId + "comboboxValue').value;");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/comboBox/comboBoxTest.xhtml";
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,124 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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 ContextMenuTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public ContextMenuTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testContextMenuComponent() throws Exception {
- _testContextMenuComponent(Templates.SIMPLE);
- _testContextMenuComponent(Templates.DATATABLE);
- _testContextMenuComponent(Templates.MODALPANEL);
- }
-
- 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);
- 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);
- 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";
- }
-
-}
-
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ContextMenuTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,124 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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 ContextMenuTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public ContextMenuTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testContextMenuComponent() throws Exception {
+ _testContextMenuComponent(Templates.SIMPLE);
+ _testContextMenuComponent(Templates.DATATABLE);
+ _testContextMenuComponent(Templates.MODALPANEL);
+ }
+
+ 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);
+ 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);
+ 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";
+ }
+
+}
+
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,235 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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 DataTableTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public DataTableTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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);
-
- 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));
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DataTableTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,235 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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 DataTableTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public DataTableTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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);
+
+ 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));
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,89 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class DropDownMenuTest extends SeleniumTestBase {
-
- public DropDownMenuTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testDropDownMenuComponent() throws Exception {
- _testDropDownMenuComponent(Templates.SIMPLE);
- _testDropDownMenuComponent(Templates.DATATABLE);
- _testDropDownMenuComponent(Templates.MODALPANEL);
- }
-
- private void _testDropDownMenuComponent(Templates template) {
- renderPage("/faces/pages/dropDownMenu/dropDownMenuTest.xhtml", template);
-
- String parentId = getParentId() + "_form:";
- String file = parentId + "file";
- String open = parentId + "open:anchor";
- String saveAs = parentId + "saveAs:anchor";
- String save = parentId + "save:anchor";
- String saveAll = parentId + "saveAll:anchor";
- String close = parentId + "close:anchor";
- String exit = parentId + "exit:anchor";
- String operation = parentId + "operation";
-
- writeStatus("Check menu item in ajax mode");
-
- selenium.mouseOver(file);
- selenium.mouseOver(saveAs);
- clickById(saveAll);
-
- AssertTextEquals(operation, "Save All");
-
- selenium.mouseOver(file);
- selenium.mouseOver(saveAs);
- clickById(save);
-
- AssertTextEquals(operation, "Save");
-
- writeStatus("Check the drop down menu closed");
-
- AssertNotVisible(save);
- AssertNotVisible(saveAs);
-
- writeStatus("Check menu item in server mode");
-
- selenium.mouseOver(file);
- clickCommandAndWait(close);
-
- AssertTextEquals(operation, "Close");
-
- writeStatus("Check menu item in 'none' mode");
-
- selenium.mouseOver(file);
- selenium.mouseOver(exit);
- clickById(exit);
-
- AssertTextEquals(operation, "Close");
- AssertNotVisible(exit);
-
- }
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,94 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class DropDownMenuTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public DropDownMenuTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testDropDownMenuComponent() throws Exception {
+ _testDropDownMenuComponent(Templates.SIMPLE);
+ _testDropDownMenuComponent(Templates.DATATABLE);
+ _testDropDownMenuComponent(Templates.MODALPANEL);
+ }
+
+ private void _testDropDownMenuComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+ String file = parentId + "file";
+ String open = parentId + "open:anchor";
+ String saveAs = parentId + "saveAs:anchor";
+ String save = parentId + "save:anchor";
+ String saveAll = parentId + "saveAll:anchor";
+ String close = parentId + "close:anchor";
+ String exit = parentId + "exit:anchor";
+ String operation = parentId + "operation";
+
+ writeStatus("Check menu item in ajax mode");
+
+ selenium.mouseOver(file);
+ selenium.mouseOver(saveAs);
+ clickById(saveAll);
+
+ AssertTextEquals(operation, "Save All");
+
+ selenium.mouseOver(file);
+ selenium.mouseOver(saveAs);
+ clickById(save);
+
+ AssertTextEquals(operation, "Save");
+
+ writeStatus("Check the drop down menu closed");
+
+ AssertNotVisible(save);
+ AssertNotVisible(saveAs);
+
+ writeStatus("Check menu item in server mode");
+
+ selenium.mouseOver(file);
+ clickCommandAndWait(close);
+
+ AssertTextEquals(operation, "Close");
+
+ writeStatus("Check menu item in 'none' mode");
+
+ selenium.mouseOver(file);
+ selenium.mouseOver(exit);
+ clickById(exit);
+
+ AssertTextEquals(operation, "Close");
+ AssertNotVisible(exit);
+
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/dropDownMenu/dropDownMenuTest.xhtml";
+ }
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,115 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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 InplaceSelectTest extends SeleniumTestBase {
-
- public InplaceSelectTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testInplaceSelectComponent() throws Exception {
- _testInplaceSelectComponent(Templates.SIMPLE);
- _testInplaceSelectComponent(Templates.DATATABLE);
- _testInplaceSelectComponent(Templates.MODALPANEL);
- }
-
- private void _testInplaceSelectComponent(Templates template) {
- renderPage("/faces/pages/inplaceSelect/inplaceSelectTest.xhtml", template);
-
- String parentId = getParentId() + "_form:";
- String inplaceSelectId = parentId + "inplaceSelect";
- String okButton = parentId + "inplaceSelect" + "ok";
- //String inplaceTmpValueElemId = parentId + "inplaceSelect" + "inplaceTmpValue";
- String cancelButton = parentId + "inplaceSelect" + "cancel";
- String popupId = "list" + inplaceSelectId;
-
- writeStatus("click the component");
-
- clickById(inplaceSelectId);
- Assert.assertFalse(isVisibleById(popupId), "Component pop-up should not show up on solitary click");
-
- writeStatus("double click the component");
-
- selenium.doubleClick(inplaceSelectId);
- Assert.assertTrue(isVisibleById(popupId), "Component pop-up should show up on double click");
-
- writeStatus("Check that controls buttons are present");
-
- Assert.assertTrue(isPresentById(okButton));
- Assert.assertTrue(isPresentById(cancelButton));
-
- writeStatus("Select second element"); //Birch
-
- selenium.mouseMove("xpath=//div[@id='list" + inplaceSelectId + "']/span[2]");
- selenium.fireEvent(okButton, "mousedown");
-
- writeStatus("Check that a new element is selected");
-
- Assert.assertEquals(getValue(inplaceSelectId), "Birch");
-
- writeStatus("Select another element"); // Aspen
-
- selenium.doubleClick(inplaceSelectId);
-
- selenium.mouseMove("xpath=//div[@id='list" + inplaceSelectId + "']/span[3]");
- selenium.fireEvent(cancelButton, "mousedown");
-
- writeStatus("Cancel selected value.");
- Assert.assertEquals(getValue(inplaceSelectId), "Birch", "A value has not to be changed");
-
- writeStatus("Verify javascript event triggering");
-
- runScript("theLatestEvent='undefined'");
-
- writeStatus("Double click the component");
- selenium.doubleClick(inplaceSelectId);
-
- Assert.assertEquals(runScript("theLatestEvent"), "editactivated", "editactivated event has not been triggered");
-
- writeStatus("Stop editing with ok");
- selenium.fireEvent(okButton, "mousedown");
- Assert.assertEquals(runScript("theLatestEvent"), "viewactivated", "viewactivated event has not been triggered");
-
-// viewactivated event is not fired ... almost sure bug
-// writeStatus("Stop editing with cancel");
-// selenium.fireEvent(cancelButton, "mousedown");
-// Assert.assertEquals(runScript("theLatestEvent"), "viewactivated", "viewactivated event has not been triggered");
-
- }
-
- /**
- * Gets component value.
- * Note: JavaScript component API getValue() doesn't exit
- * @param clientId
- * @return
- */
- private String getValue(String clientId) {
- return runScript("$('" + clientId + "inplaceValue').value;");
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,120 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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 InplaceSelectTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public InplaceSelectTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testInplaceSelectComponent() throws Exception {
+ _testInplaceSelectComponent(Templates.SIMPLE);
+ _testInplaceSelectComponent(Templates.DATATABLE);
+ _testInplaceSelectComponent(Templates.MODALPANEL);
+ }
+
+ private void _testInplaceSelectComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+ String inplaceSelectId = parentId + "inplaceSelect";
+ String okButton = parentId + "inplaceSelect" + "ok";
+ //String inplaceTmpValueElemId = parentId + "inplaceSelect" + "inplaceTmpValue";
+ String cancelButton = parentId + "inplaceSelect" + "cancel";
+ String popupId = "list" + inplaceSelectId;
+
+ writeStatus("click the component");
+
+ clickById(inplaceSelectId);
+ Assert.assertFalse(isVisibleById(popupId), "Component pop-up should not show up on solitary click");
+
+ writeStatus("double click the component");
+
+ selenium.doubleClick(inplaceSelectId);
+ Assert.assertTrue(isVisibleById(popupId), "Component pop-up should show up on double click");
+
+ writeStatus("Check that controls buttons are present");
+
+ Assert.assertTrue(isPresentById(okButton));
+ Assert.assertTrue(isPresentById(cancelButton));
+
+ writeStatus("Select second element"); //Birch
+
+ selenium.mouseMove("xpath=//div[@id='list" + inplaceSelectId + "']/span[2]");
+ selenium.fireEvent(okButton, "mousedown");
+
+ writeStatus("Check that a new element is selected");
+
+ Assert.assertEquals(getValue(inplaceSelectId), "Birch");
+
+ writeStatus("Select another element"); // Aspen
+
+ selenium.doubleClick(inplaceSelectId);
+
+ selenium.mouseMove("xpath=//div[@id='list" + inplaceSelectId + "']/span[3]");
+ selenium.fireEvent(cancelButton, "mousedown");
+
+ writeStatus("Cancel selected value.");
+ Assert.assertEquals(getValue(inplaceSelectId), "Birch", "A value has not to be changed");
+
+ writeStatus("Verify javascript event triggering");
+
+ runScript("theLatestEvent='undefined'");
+
+ writeStatus("Double click the component");
+ selenium.doubleClick(inplaceSelectId);
+
+ Assert.assertEquals(runScript("theLatestEvent"), "editactivated", "editactivated event has not been triggered");
+
+ writeStatus("Stop editing with ok");
+ selenium.fireEvent(okButton, "mousedown");
+ Assert.assertEquals(runScript("theLatestEvent"), "viewactivated", "viewactivated event has not been triggered");
+
+// viewactivated event is not fired ... almost sure bug
+// writeStatus("Stop editing with cancel");
+// selenium.fireEvent(cancelButton, "mousedown");
+// Assert.assertEquals(runScript("theLatestEvent"), "viewactivated", "viewactivated event has not been triggered");
+
+ }
+
+ /**
+ * Gets component value.
+ * Note: JavaScript component API getValue() doesn't exit
+ * @param clientId
+ * @return
+ */
+ private String getValue(String clientId) {
+ return runScript("$('" + clientId + "inplaceValue').value;");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/inplaceSelect/inplaceSelectTest.xhtml";
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,92 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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 InputNumberSpinnerTest extends SeleniumTestBase {
-
- public InputNumberSpinnerTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testInputNumberSpinnerComponent() throws Exception {
- _testInputNumberSpinnerComponent(Templates.SIMPLE);
- //it looks as if the spinner does not work inside rich:dataTable
- _testInputNumberSpinnerComponent(Templates.DATATABLE);
- _testInputNumberSpinnerComponent(Templates.MODALPANEL);
- }
-
- private void _testInputNumberSpinnerComponent(Templates template) {
- renderPage("/faces/pages/inputNumberSpinner/inputNumberSpinnerTest.xhtml", template);
-
- writeStatus("check whether the spinner is invariant with respect to pair of sequential opposite operations");
-
- //start value = 20
- String before = getSpinnerValue();
- clickUp();
- clickDown();
- String after = getSpinnerValue();
- Assert.assertEquals(before, after);
- Assert.assertEquals(after, "20");
-
- writeStatus("check upper bound and cycling");
-
- clickUp(); //+10
- clickUp(); //+10
- clickUp(); //+10
- clickUp(); //+10
- clickUp(); //+10
- Assert.assertEquals(getSpinnerValue(), "10");
-
- writeStatus("check lower bound and cycling");
-
- clickDown(); //-10
- Assert.assertEquals(getSpinnerValue(), "0");
- clickDown(); //-10
- Assert.assertEquals(getSpinnerValue(), "50");
- clickDown(); //-10
- Assert.assertEquals(getSpinnerValue(), "40");
- }
-
- private void clickUp() {
- String id = getParentId() + "_form:" + "spinnerButtons";
- selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[1]/td/input", "mousedown");
- selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[1]/td/input", "mouseup");
- }
-
- private void clickDown() {
- String id = getParentId() + "_form:" + "spinnerButtons";
- selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[2]/td/input", "mousedown");
- selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[2]/td/input", "mouseup");
- }
-
- private String getSpinnerValue() {
- String id = getParentId() + "_form:" + "spinnerEdit";
- return runScript("$('" + id + "').down('input').value");
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InputNumberSpinnerTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,97 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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 InputNumberSpinnerTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public InputNumberSpinnerTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testInputNumberSpinnerComponent() throws Exception {
+ _testInputNumberSpinnerComponent(Templates.SIMPLE);
+ //it looks as if the spinner does not work inside rich:dataTable
+ _testInputNumberSpinnerComponent(Templates.DATATABLE);
+ _testInputNumberSpinnerComponent(Templates.MODALPANEL);
+ }
+
+ private void _testInputNumberSpinnerComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ writeStatus("check whether the spinner is invariant with respect to pair of sequential opposite operations");
+
+ //start value = 20
+ String before = getSpinnerValue();
+ clickUp();
+ clickDown();
+ String after = getSpinnerValue();
+ Assert.assertEquals(before, after);
+ Assert.assertEquals(after, "20");
+
+ writeStatus("check upper bound and cycling");
+
+ clickUp(); //+10
+ clickUp(); //+10
+ clickUp(); //+10
+ clickUp(); //+10
+ clickUp(); //+10
+ Assert.assertEquals(getSpinnerValue(), "10");
+
+ writeStatus("check lower bound and cycling");
+
+ clickDown(); //-10
+ Assert.assertEquals(getSpinnerValue(), "0");
+ clickDown(); //-10
+ Assert.assertEquals(getSpinnerValue(), "50");
+ clickDown(); //-10
+ Assert.assertEquals(getSpinnerValue(), "40");
+ }
+
+ private void clickUp() {
+ String id = getParentId() + "_form:" + "spinnerButtons";
+ selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[1]/td/input", "mousedown");
+ selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[1]/td/input", "mouseup");
+ }
+
+ private void clickDown() {
+ String id = getParentId() + "_form:" + "spinnerButtons";
+ selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[2]/td/input", "mousedown");
+ selenium.fireEvent("xpath=//table[@id='" + id + "']/tbody/tr[2]/td/input", "mouseup");
+ }
+
+ private String getSpinnerValue() {
+ String id = getParentId() + "_form:" + "spinnerEdit";
+ return runScript("$('" + id + "').down('input').value");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/inputNumberSpinner/inputNumberSpinnerTest.xhtml";
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,59 +0,0 @@
-package org.richfaces;
-
-import static org.testng.Assert.assertEquals;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class JSFunctionTest extends SeleniumTestBase {
-
- public JSFunctionTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testJSFunctionComponent() throws Exception {
- _testJSFunctionComponent(Templates.SIMPLE);
- _testJSFunctionComponent(Templates.DATATABLE);
- _testJSFunctionComponent(Templates.MODALPANEL);
- }
-
- private void _testJSFunctionComponent(Templates template) {
- renderPage("/faces/pages/jsFunction/jsFunctionTest.xhtml", template);
-
- String showNameElemId = getParentId() + "showname";
- selenium.mouseOver("alex");
- waitForAjaxCompletion();
- assertEquals(getTextById(showNameElemId), "Alex");
-
- selenium.mouseOver("jonh");
- waitForAjaxCompletion();
- assertEquals(getTextById(showNameElemId), "Jonh");
-
- selenium.mouseOver("roger");
- waitForAjaxCompletion();
- assertEquals(getTextById(showNameElemId), "Roger");
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/JSFunctionTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,65 @@
+package org.richfaces;
+
+import static org.testng.Assert.assertEquals;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class JSFunctionTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public JSFunctionTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testJSFunctionComponent() throws Exception {
+ _testJSFunctionComponent(Templates.SIMPLE);
+ _testJSFunctionComponent(Templates.DATATABLE);
+ _testJSFunctionComponent(Templates.MODALPANEL);
+ }
+
+ private void _testJSFunctionComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String showNameElemId = getParentId() + "showname";
+ selenium.mouseOver("alex");
+ waitForAjaxCompletion();
+ assertEquals(getTextById(showNameElemId), "Alex");
+
+ selenium.mouseOver("jonh");
+ waitForAjaxCompletion();
+ assertEquals(getTextById(showNameElemId), "Jonh");
+
+ selenium.mouseOver("roger");
+ waitForAjaxCompletion();
+ assertEquals(getTextById(showNameElemId), "Roger");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/jsFunction/jsFunctionTest.xhtml";
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,85 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class KeepAliveTest extends SeleniumTestBase {
-
- public KeepAliveTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testKeepAliveComponent() throws Exception {
- _testKeepAliveComponent(Templates.SIMPLE);
- _testKeepAliveComponent(Templates.DATATABLE);
- _testKeepAliveComponent(Templates.MODALPANEL);
- }
-
- private void _testKeepAliveComponent(Templates template) {
- renderPage("/faces/pages/keepAlive/keepAliveTest.xhtml", template);
-
- String parentId = getParentId();
-
- String sumElemId = parentId + "sum";
- AssertValueEquals(sumElemId, "0");
- String addButtonId = parentId + "form:add";
- String addAjaxButtonId = parentId + "form:addAjax";
-
- writeStatus("The sum has to be increased by 5 twice");
-
- clickCommandAndWait(addButtonId);
- clickCommandAndWait(addButtonId);
- AssertValueEquals(sumElemId, "10");
-
- writeStatus("The sum has to be increased by 5 twice again");
-
- clickById(addAjaxButtonId);
- clickById(addAjaxButtonId);
- waitForAjaxCompletion();
- AssertValueEquals(sumElemId, "20");
-
- writeStatus("Test ajax only regime ... ");
-
- String sumAjaxOnlyElemId = parentId + "sumAjaxOnly";
- AssertValueEquals(sumAjaxOnlyElemId, "0");
- addButtonId = parentId + "formAjaxOnly:add";
- addAjaxButtonId = parentId + "formAjaxOnly:addAjax";
-
- writeStatus("State is not saved between full submits. The sum always is 5");
-
- clickCommandAndWait(addButtonId);
- clickCommandAndWait(addButtonId);
- AssertValueNotEquals(sumAjaxOnlyElemId, "10");
-
- writeStatus("Ajax request! The sum has to be increased by 5 twice");
-
-// This test doesn't pass! Bug?!
-
-// clickById(addAjaxButtonId);
-// clickById(addAjaxButtonId);
-// waitForAjaxCompletion();
-// AssertValueEquals(sumAjaxOnlyElemId, "10");
- }
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/KeepAliveTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,90 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class KeepAliveTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public KeepAliveTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testKeepAliveComponent() throws Exception {
+ _testKeepAliveComponent(Templates.SIMPLE);
+ _testKeepAliveComponent(Templates.DATATABLE);
+ _testKeepAliveComponent(Templates.MODALPANEL);
+ }
+
+ private void _testKeepAliveComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId();
+
+ String sumElemId = parentId + "sum";
+ AssertValueEquals(sumElemId, "0");
+ String addButtonId = parentId + "form:add";
+ String addAjaxButtonId = parentId + "form:addAjax";
+
+ writeStatus("The sum has to be increased by 5 twice");
+
+ clickCommandAndWait(addButtonId);
+ clickCommandAndWait(addButtonId);
+ AssertValueEquals(sumElemId, "10");
+
+ writeStatus("The sum has to be increased by 5 twice again");
+
+ clickById(addAjaxButtonId);
+ clickById(addAjaxButtonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(sumElemId, "20");
+
+ writeStatus("Test ajax only regime ... ");
+
+ String sumAjaxOnlyElemId = parentId + "sumAjaxOnly";
+ AssertValueEquals(sumAjaxOnlyElemId, "0");
+ addButtonId = parentId + "formAjaxOnly:add";
+ addAjaxButtonId = parentId + "formAjaxOnly:addAjax";
+
+ writeStatus("State is not saved between full submits. The sum always is 5");
+
+ clickCommandAndWait(addButtonId);
+ clickCommandAndWait(addButtonId);
+ AssertValueNotEquals(sumAjaxOnlyElemId, "10");
+
+ writeStatus("Ajax request! The sum has to be increased by 5 twice");
+
+// This test doesn't pass! Bug?!
+
+// clickById(addAjaxButtonId);
+// clickById(addAjaxButtonId);
+// waitForAjaxCompletion();
+// AssertValueEquals(sumAjaxOnlyElemId, "10");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/keepAlive/keepAliveTest.xhtml";
+ }
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,50 +0,0 @@
-package org.richfaces;
-
-import static org.testng.Assert.assertEquals;
-
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class LoadScriptTest extends SeleniumTestBase {
-
- public LoadScriptTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testLoadScriptComponent() throws Exception {
- _testLoadScriptComponent(Templates.SIMPLE);
- _testLoadScriptComponent(Templates.DATATABLE);
- _testLoadScriptComponent(Templates.MODALPANEL);
- }
-
- private void _testLoadScriptComponent(Templates template) {
- renderPage("/faces/pages/loadScript/loadScriptTest.xhtml", template);
- String jsCall = "summarize(%1$s, %2$s);";
- int opr1 = 1;
- int opr2 = 2;
- String result = runScript(String.format(jsCall, opr1, opr2));
- assertEquals(Integer.parseInt(result), opr1 + opr2);
- }
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadScriptTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,55 @@
+package org.richfaces;
+
+import static org.testng.Assert.assertEquals;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class LoadScriptTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public LoadScriptTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testLoadScriptComponent() throws Exception {
+ _testLoadScriptComponent(Templates.SIMPLE);
+ _testLoadScriptComponent(Templates.DATATABLE);
+ _testLoadScriptComponent(Templates.MODALPANEL);
+ }
+
+ private void _testLoadScriptComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ String jsCall = "summarize(%1$s, %2$s);";
+ int opr1 = 1;
+ int opr2 = 2;
+ String result = runScript(String.format(jsCall, opr1, opr2));
+ assertEquals(Integer.parseInt(result), opr1 + opr2);
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/loadScript/loadScriptTest.xhtml";
+ }
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,48 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.Templates;
-
-import static org.testng.Assert.assertEquals;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class LoadStyleTest extends SeleniumTestBase {
-
- public LoadStyleTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testLoadStyleComponent() throws Exception {
- _testLoadStyleComponent(Templates.SIMPLE);
- _testLoadStyleComponent(Templates.DATATABLE);
- _testLoadStyleComponent(Templates.MODALPANEL);
- }
-
- private void _testLoadStyleComponent(Templates template) {
- renderPage("/faces/pages/loadStyle/loadStyleTest.xhtml", template);
- String divId = getParentId() + "rectangle";
- assertEquals(50, getWidthById(divId));
- assertEquals(100, getHeightById(divId));
- }
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/LoadStyleTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,53 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+
+import static org.testng.Assert.assertEquals;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class LoadStyleTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public LoadStyleTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testLoadStyleComponent() throws Exception {
+ _testLoadStyleComponent(Templates.SIMPLE);
+ _testLoadStyleComponent(Templates.DATATABLE);
+ _testLoadStyleComponent(Templates.MODALPANEL);
+ }
+
+ private void _testLoadStyleComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ String divId = getParentId() + "rectangle";
+ assertEquals(50, getWidthById(divId));
+ assertEquals(100, getHeightById(divId));
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/loadStyle/loadStyleTest.xhtml";
+ }
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,249 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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", "8080");
- }
-
- 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);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterTest
- public void stopSelenium() {
- super.stopSelenium();
- }
-
- @Test
- public void testOrderingListComponent() throws Exception {
- _testOrderingListComponent(Templates.SIMPLE);
- _testOrderingListComponent(Templates.DATATABLE);
- _testOrderingListComponent(Templates.MODALPANEL);
- }
-
- 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);
-
- cleanSelection();
- }
-
- 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);
-
- writeStatus("Click on server link");
- clickCommandAndWait(server);
- AssertTextEquals(actionResultText, "item1");
- AssertTextEquals(selectionText, "item0");
- AssertTextEquals(activeItemText, "Item [item0]");
- checkButtons(true, true, false, false);
-
- cleanSelection();
- }
-
- 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");
-
- cleanSelection();
- }
-
- private void cleanSelection() {
- writeStatus("Unselect element");
- clickById(firstRow);
- selenium.controlKeyDown();
- clickById(firstRow);
- selenium.controlKeyUp();
- checkButtons(true, true, true, true);
-
- writeStatus("Submit empty selection to save it into server bean");
- clickById(ajax);
- waitForAjaxCompletion();
- }
-
- 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";
- }
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,249 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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", "8080");
+ }
+
+ 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);
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ @Test
+ public void testOrderingListComponent() throws Exception {
+ _testOrderingListComponent(Templates.SIMPLE);
+ _testOrderingListComponent(Templates.DATATABLE);
+ _testOrderingListComponent(Templates.MODALPANEL);
+ }
+
+ 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);
+
+ cleanSelection();
+ }
+
+ 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);
+
+ writeStatus("Click on server link");
+ clickCommandAndWait(server);
+ AssertTextEquals(actionResultText, "item1");
+ AssertTextEquals(selectionText, "item0");
+ AssertTextEquals(activeItemText, "Item [item0]");
+ checkButtons(true, true, false, false);
+
+ cleanSelection();
+ }
+
+ 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");
+
+ cleanSelection();
+ }
+
+ private void cleanSelection() {
+ writeStatus("Unselect element");
+ clickById(firstRow);
+ selenium.controlKeyDown();
+ clickById(firstRow);
+ selenium.controlKeyUp();
+ checkButtons(true, true, true, true);
+
+ writeStatus("Submit empty selection to save it into server bean");
+ clickById(ajax);
+ waitForAjaxCompletion();
+ }
+
+ 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";
+ }
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,105 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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", "8080");
- }
-
-
- /**
- * 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 testPanelBarComponent() throws Exception {
- _testPanelBarComponent(Templates.SIMPLE);
- _testPanelBarComponent(Templates.DATATABLE);
- _testPanelBarComponent(Templates.MODALPANEL);
- }
-
- 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";
-
- clickById(label2);
- Assert.assertFalse(isVisibleById(output1));
- Assert.assertTrue(isVisibleById(output2));
- Assert.assertFalse(isVisibleById(output3));
-
- clickCommandAndWait(simpleButton);
- Assert.assertFalse(isVisibleById(output1));
- Assert.assertTrue(isVisibleById(output2));
- Assert.assertFalse(isVisibleById(output3));
-
- clickById(label3);
- Assert.assertFalse(isVisibleById(output1));
- Assert.assertFalse(isVisibleById(output2));
- Assert.assertTrue(isVisibleById(output3));
-
- clickById(ajaxButton);
- waitForAjaxCompletion();
- Assert.assertFalse(isVisibleById(output1));
- Assert.assertFalse(isVisibleById(output2));
- Assert.assertTrue(isVisibleById(output3));
- }
-
- public String getTestUrl() {
- return "/faces/pages/panelBar/panelBarTest.xhtml";
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,105 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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", "8080");
+ }
+
+
+ /**
+ * 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 testPanelBarComponent() throws Exception {
+ _testPanelBarComponent(Templates.SIMPLE);
+ _testPanelBarComponent(Templates.DATATABLE);
+ _testPanelBarComponent(Templates.MODALPANEL);
+ }
+
+ 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";
+
+ clickById(label2);
+ Assert.assertFalse(isVisibleById(output1));
+ Assert.assertTrue(isVisibleById(output2));
+ Assert.assertFalse(isVisibleById(output3));
+
+ clickCommandAndWait(simpleButton);
+ Assert.assertFalse(isVisibleById(output1));
+ Assert.assertTrue(isVisibleById(output2));
+ Assert.assertFalse(isVisibleById(output3));
+
+ clickById(label3);
+ Assert.assertFalse(isVisibleById(output1));
+ Assert.assertFalse(isVisibleById(output2));
+ Assert.assertTrue(isVisibleById(output3));
+
+ clickById(ajaxButton);
+ waitForAjaxCompletion();
+ Assert.assertFalse(isVisibleById(output1));
+ Assert.assertFalse(isVisibleById(output2));
+ Assert.assertTrue(isVisibleById(output3));
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/panelBar/panelBarTest.xhtml";
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,227 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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", "8080");
- }
-
- /**
- * 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 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);
-
- }
-
- private void _testPanelMenuComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
-
- String inputId = parentId + "_value";
- String outputId = parentId + "_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();
- AssertValueEquals(inputId, "pGroup1");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(ajaxItem));
- Assert.assertFalse(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on server group");
- clickCommandAndWait(serverGroup);
- AssertValueEquals(inputId, "pGroup2");
- AssertTextEquals(outputId, "2");
- Assert.assertTrue(isVisibleById(ajaxItem));
- Assert.assertTrue(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on ajax group");
- clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "pGroup1");
- AssertTextEquals(outputId, "3");
- Assert.assertFalse(isVisibleById(ajaxItem));
- Assert.assertTrue(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on server group");
- clickCommandAndWait(serverGroup);
-
- AssertValueEquals(inputId, "pGroup2");
- AssertTextEquals(outputId, "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));
- }
-
- private void _testPanelMenuComponentSingleMode(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
-
- String inputId = parentId + "_value";
- String outputId = parentId + "_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();
- AssertValueEquals(inputId, "pGroup1_single");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(ajaxItem));
- Assert.assertFalse(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on server group");
- clickCommandAndWait(serverGroup);
- AssertValueEquals(inputId, "pGroup2_single");
- AssertTextEquals(outputId, "2");
- Assert.assertFalse(isVisibleById(ajaxItem));
- Assert.assertTrue(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on ajax group");
- clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "pGroup1_single");
- AssertTextEquals(outputId, "3");
- Assert.assertTrue(isVisibleById(ajaxItem));
- Assert.assertFalse(isVisibleById(serverItem));
- Assert.assertFalse(isVisibleById(clientItem));
-
- writeStatus("Click on server group");
- clickCommandAndWait(serverGroup);
- AssertValueEquals(inputId, "pGroup2_single");
- AssertTextEquals(outputId, "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));
- }
-
- private void _testPanelMenuItemAction(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
-
- String inputId = parentId + "_value";
- String outputId = parentId + "_value2";
-
- String group = "tablehide" + parentId + "pGroup1";
- String groupSingle = "tablehide" + parentId + "pGroup1_single";
-
- String item = "tablehide" + parentId + "pItem1";
- String itemSingle = "tablehide" + parentId + "pItem1_single";
-
- writeStatus("Click on ajax group");
- clickById(group);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "pGroup1");
-
- writeStatus("Click on ajax group");
- clickById(groupSingle);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "pGroup1_single");
-
- writeStatus("Click on server group");
- clickCommandAndWait(item);
- AssertValueEquals(inputId, "pItem1");
- AssertTextEquals(outputId, "1");
-
- writeStatus("Click on server group");
- clickCommandAndWait(itemSingle);
- AssertValueEquals(inputId, "pItem1_single");
- AssertTextEquals(outputId, "2");
- }
-
- public String getTestUrl() {
- return "/faces/pages/panelMenu/panelMenuTest.xhtml";
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,227 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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", "8080");
+ }
+
+ /**
+ * 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 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);
+
+ }
+
+ private void _testPanelMenuComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ String parentId = getParentId() + "_form:";
+
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_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();
+ AssertValueEquals(inputId, "pGroup1");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(serverGroup);
+ AssertValueEquals(inputId, "pGroup2");
+ AssertTextEquals(outputId, "2");
+ Assert.assertTrue(isVisibleById(ajaxItem));
+ Assert.assertTrue(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on ajax group");
+ clickById(ajaxGroup);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "pGroup1");
+ AssertTextEquals(outputId, "3");
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertTrue(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(serverGroup);
+
+ AssertValueEquals(inputId, "pGroup2");
+ AssertTextEquals(outputId, "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));
+ }
+
+ private void _testPanelMenuComponentSingleMode(Templates template) {
+ renderPage(getTestUrl(), template);
+ String parentId = getParentId() + "_form:";
+
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_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();
+ AssertValueEquals(inputId, "pGroup1_single");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(serverGroup);
+ AssertValueEquals(inputId, "pGroup2_single");
+ AssertTextEquals(outputId, "2");
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertTrue(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on ajax group");
+ clickById(ajaxGroup);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "pGroup1_single");
+ AssertTextEquals(outputId, "3");
+ Assert.assertTrue(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(serverGroup);
+ AssertValueEquals(inputId, "pGroup2_single");
+ AssertTextEquals(outputId, "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));
+ }
+
+ private void _testPanelMenuItemAction(Templates template) {
+ renderPage(getTestUrl(), template);
+ String parentId = getParentId() + "_form:";
+
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_value2";
+
+ String group = "tablehide" + parentId + "pGroup1";
+ String groupSingle = "tablehide" + parentId + "pGroup1_single";
+
+ String item = "tablehide" + parentId + "pItem1";
+ String itemSingle = "tablehide" + parentId + "pItem1_single";
+
+ writeStatus("Click on ajax group");
+ clickById(group);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "pGroup1");
+
+ writeStatus("Click on ajax group");
+ clickById(groupSingle);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "pGroup1_single");
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(item);
+ AssertValueEquals(inputId, "pItem1");
+ AssertTextEquals(outputId, "1");
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(itemSingle);
+ AssertValueEquals(inputId, "pItem1_single");
+ AssertTextEquals(outputId, "2");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/panelMenu/panelMenuTest.xhtml";
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,98 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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 PickListTest extends SeleniumTestBase {
-
- public PickListTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testPickListComponent() throws Exception {
- _testPickListComponent(Templates.SIMPLE);
- _testPickListComponent(Templates.DATATABLE);
- _testPickListComponent(Templates.MODALPANEL);
- }
-
- private void _testPickListComponent(Templates template) {
- renderPage("/faces/pages/pickList/pickListTest.xhtml", template);
-
- String parentId = getParentId() + "_form:";
- String pickListId = "pickList";
- String copyElemId = parentId + pickListId + "discopy";
- String copyAllElemId = parentId + pickListId + "copyAll";
- String removeElemId = parentId + pickListId + "disremove";
- String removeAllElemId = parentId + pickListId + "removeAll";
-
- writeStatus("Check move controls customized labels");
-
- AssertTextEquals(copyElemId, "MOVE");
- AssertTextEquals(copyAllElemId, "MOVE ALL");
- AssertTextEquals(removeElemId, "TAKE AWAY");
- AssertTextEquals(removeAllElemId, "TAKE ALL AWAY");
-
- String destListId = parentId + pickListId + "tlTbody";
- String srcListId = parentId + pickListId + "tbody";
-
- writeStatus("Check initial disposition");
-
- Assert.assertEquals(getNumberOfChildren(srcListId), 6);
- Assert.assertEquals(getNumberOfChildren(destListId), 2);
-
- writeStatus("Verify initial selected items.");
-
- Assert.assertEquals(selenium.getText("xpath=//tbody[@id='" + destListId + "']/tr[1]"), "ZHURIK");
- Assert.assertEquals(selenium.getText("xpath=//tbody[@id='" + destListId + "']/tr[2]"), "MELESHKO");
-
- writeStatus("Try to select first item and check state thereafter");
-
- selenium.doubleClick("xpath=//tbody[@id='" + srcListId + "']/tr/td");
-
- Assert.assertEquals(getNumberOfChildren(srcListId), 5);
- Assert.assertEquals(getNumberOfChildren(destListId), 3);
- Assert.assertEquals(selenium.getText("xpath=//tbody[@id='" + destListId + "']/tr[3]"), "LEONTIEV");
-
- }
-
- /**
- * Returns number of children for DOM element with given id.
- * @param elemId DOM element id
- * @return number of children
- */
- private int getNumberOfChildren(String elemId) {
- int retVal = -1;
- try {
- retVal = Integer.parseInt(runScript("dom=selenium.browserbot.getCurrentWindow().$('" + elemId
- + "').childElements().size()"));
- } catch (Exception e) {
- Assert.fail(e.getMessage());
- }
-
- return retVal;
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PickListTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,103 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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 PickListTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public PickListTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testPickListComponent() throws Exception {
+ _testPickListComponent(Templates.SIMPLE);
+ _testPickListComponent(Templates.DATATABLE);
+ _testPickListComponent(Templates.MODALPANEL);
+ }
+
+ private void _testPickListComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+ String pickListId = "pickList";
+ String copyElemId = parentId + pickListId + "discopy";
+ String copyAllElemId = parentId + pickListId + "copyAll";
+ String removeElemId = parentId + pickListId + "disremove";
+ String removeAllElemId = parentId + pickListId + "removeAll";
+
+ writeStatus("Check move controls customized labels");
+
+ AssertTextEquals(copyElemId, "MOVE");
+ AssertTextEquals(copyAllElemId, "MOVE ALL");
+ AssertTextEquals(removeElemId, "TAKE AWAY");
+ AssertTextEquals(removeAllElemId, "TAKE ALL AWAY");
+
+ String destListId = parentId + pickListId + "tlTbody";
+ String srcListId = parentId + pickListId + "tbody";
+
+ writeStatus("Check initial disposition");
+
+ Assert.assertEquals(getNumberOfChildren(srcListId), 6);
+ Assert.assertEquals(getNumberOfChildren(destListId), 2);
+
+ writeStatus("Verify initial selected items.");
+
+ Assert.assertEquals(selenium.getText("xpath=//tbody[@id='" + destListId + "']/tr[1]"), "ZHURIK");
+ Assert.assertEquals(selenium.getText("xpath=//tbody[@id='" + destListId + "']/tr[2]"), "MELESHKO");
+
+ writeStatus("Try to select first item and check state thereafter");
+
+ selenium.doubleClick("xpath=//tbody[@id='" + srcListId + "']/tr/td");
+
+ Assert.assertEquals(getNumberOfChildren(srcListId), 5);
+ Assert.assertEquals(getNumberOfChildren(destListId), 3);
+ Assert.assertEquals(selenium.getText("xpath=//tbody[@id='" + destListId + "']/tr[3]"), "LEONTIEV");
+
+ }
+
+ /**
+ * Returns number of children for DOM element with given id.
+ * @param elemId DOM element id
+ * @return number of children
+ */
+ private int getNumberOfChildren(String elemId) {
+ int retVal = -1;
+ try {
+ retVal = Integer.parseInt(runScript("dom=selenium.browserbot.getCurrentWindow().$('" + elemId
+ + "').childElements().size()"));
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+
+ return retVal;
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/pickList/pickListTest.xhtml";
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,139 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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 ProgressBarTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testProgressBarComponent() {
- _testProgressBarComponent(Templates.SIMPLE);
- _testProgressBarComponent(Templates.DATATABLE);
- _testProgressBarComponent(Templates.MODALPANEL);
- }
-
- private void _testProgressBarComponent(Templates template) {
-
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
-
- String progressBarId = parentId + "progressBar1";
- int value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value < 0);
- String text = getTextById(progressBarId);
- writeStatus("Check if process not started");
- Assert.assertTrue(text.startsWith("Process not started"));
-
- 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("%"));
-
- writeStatus("Check value");
- value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value > 0);
-
- writeStatus("Enable polling");
- enableProgressBar(progressBarId, true);
-
- pause(5000, progressBarId);
- writeStatus("Check value");
- Assert.assertTrue((getProgressBarValue(progressBarId).intValue() != value));
-
- writeStatus("Disable polling");
- enableProgressBar(progressBarId, false);
-
- value = getProgressBarValue(progressBarId);
- pause(1500, progressBarId);
- writeStatus("Check value");
- Assert.assertTrue(getProgressBarValue(progressBarId) == value);
-
- clickById(parentId + "_complete");
- waitForAjaxCompletion();
- writeStatus("Check if process completed");
- text = getTextById(progressBarId);
- Assert.assertTrue(text.startsWith("Process completed"));
-
-
- // - Test client mode
-
- writeStatus("Check value");
- progressBarId = parentId + "progressBar2";
- value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value == -5);
-
- text = getTextById(progressBarId);
- writeStatus("Check if process not started");
- Assert.assertTrue(text.startsWith("Process not started"));
-
- setProgressBarValue(progressBarId, 20);
- value = getProgressBarValue(progressBarId);
- writeStatus("Check value");
- Assert.assertTrue(value == 20);
-
- setProgressBarValue(progressBarId, 60);
- value = getProgressBarValue(progressBarId);
- writeStatus("Check value");
- Assert.assertTrue(value == 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";
- }
-
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,139 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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 ProgressBarTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testProgressBarComponent() {
+ _testProgressBarComponent(Templates.SIMPLE);
+ _testProgressBarComponent(Templates.DATATABLE);
+ _testProgressBarComponent(Templates.MODALPANEL);
+ }
+
+ private void _testProgressBarComponent(Templates template) {
+
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+
+ String progressBarId = parentId + "progressBar1";
+ int value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value < 0);
+ String text = getTextById(progressBarId);
+ writeStatus("Check if process not started");
+ Assert.assertTrue(text.startsWith("Process not started"));
+
+ 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("%"));
+
+ writeStatus("Check value");
+ value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value > 0);
+
+ writeStatus("Enable polling");
+ enableProgressBar(progressBarId, true);
+
+ pause(5000, progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue((getProgressBarValue(progressBarId).intValue() != value));
+
+ writeStatus("Disable polling");
+ enableProgressBar(progressBarId, false);
+
+ value = getProgressBarValue(progressBarId);
+ pause(1500, progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue(getProgressBarValue(progressBarId) == value);
+
+ clickById(parentId + "_complete");
+ waitForAjaxCompletion();
+ writeStatus("Check if process completed");
+ text = getTextById(progressBarId);
+ Assert.assertTrue(text.startsWith("Process completed"));
+
+
+ // - Test client mode
+
+ writeStatus("Check value");
+ progressBarId = parentId + "progressBar2";
+ value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value == -5);
+
+ text = getTextById(progressBarId);
+ writeStatus("Check if process not started");
+ Assert.assertTrue(text.startsWith("Process not started"));
+
+ setProgressBarValue(progressBarId, 20);
+ value = getProgressBarValue(progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue(value == 20);
+
+ setProgressBarValue(progressBarId, 60);
+ value = getProgressBarValue(progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue(value == 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";
+ }
+
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,110 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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", "8080");
- }
-
- /**
- * 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 testSimpleTogglePanelComponent() throws Exception {
- _testSimpleTogglePanelComponent(Templates.SIMPLE);
- _testSimpleTogglePanelComponent(Templates.DATATABLE);
- _testSimpleTogglePanelComponent(Templates.MODALPANEL);
- }
-
- private void _testSimpleTogglePanelComponent(Templates template) {
- renderPage(getTestUrl(), 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";
-
- clickById(clientHeader);
- Assert.assertTrue(isVisibleById(clientBody));
- clickById(clientHeader);
- Assert.assertFalse(isVisibleById(clientBody));
-
- clickById(ajaxHeader);
- waitForAjaxCompletion(5000);
- AssertValueEquals(inputId, "panel1");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(ajaxBody));
-
- clickById(ajaxHeader);
- waitForAjaxCompletion(5000);
- AssertValueEquals(inputId, "panel1");
- AssertTextEquals(outputId, "2");
- Assert.assertFalse(isVisibleById(ajaxBody));
-
- clickCommandAndWait(serverHeader);
- AssertValueEquals(inputId, "panel2");
- AssertTextEquals(outputId, "3");
- Assert.assertTrue(isVisibleById(serverBody));
-
- clickCommandAndWait(serverHeader);
- AssertValueEquals(inputId, "panel2");
- AssertTextEquals(outputId, "4");
- Assert.assertFalse(isVisibleById(serverBody));
- }
-
- public String getTestUrl() {
- return "/faces/pages/simpleTogglePanel/simpleTogglePanel.xhtml";
- }
-
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,110 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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", "8080");
+ }
+
+ /**
+ * 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 testSimpleTogglePanelComponent() throws Exception {
+ _testSimpleTogglePanelComponent(Templates.SIMPLE);
+ _testSimpleTogglePanelComponent(Templates.DATATABLE);
+ _testSimpleTogglePanelComponent(Templates.MODALPANEL);
+ }
+
+ private void _testSimpleTogglePanelComponent(Templates template) {
+ renderPage(getTestUrl(), 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";
+
+ clickById(clientHeader);
+ Assert.assertTrue(isVisibleById(clientBody));
+ clickById(clientHeader);
+ Assert.assertFalse(isVisibleById(clientBody));
+
+ clickById(ajaxHeader);
+ waitForAjaxCompletion(5000);
+ AssertValueEquals(inputId, "panel1");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(ajaxBody));
+
+ clickById(ajaxHeader);
+ waitForAjaxCompletion(5000);
+ AssertValueEquals(inputId, "panel1");
+ AssertTextEquals(outputId, "2");
+ Assert.assertFalse(isVisibleById(ajaxBody));
+
+ clickCommandAndWait(serverHeader);
+ AssertValueEquals(inputId, "panel2");
+ AssertTextEquals(outputId, "3");
+ Assert.assertTrue(isVisibleById(serverBody));
+
+ clickCommandAndWait(serverHeader);
+ AssertValueEquals(inputId, "panel2");
+ AssertTextEquals(outputId, "4");
+ Assert.assertFalse(isVisibleById(serverBody));
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/simpleTogglePanel/simpleTogglePanel.xhtml";
+ }
+
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,132 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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;
-
-import com.thoughtworks.selenium.SeleniumException;
-
-public class TabPanelTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public TabPanelTest() {
- super("http", "localhost", "8080");
- }
-
- public TabPanelTest(String protocol, String host, String port) {
- super(protocol, host, port);
- // TODO Auto-generated constructor stub
- }
-
- /**
- * 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 testTabPanelComponent() throws Exception {
- _testRichTabPanelComponent(Templates.SIMPLE);
- _testRichTabPanelComponent(Templates.DATATABLE);
- _testRichTabPanelComponent(Templates.MODALPANEL);
- }
-
- 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";
- String inputId = parentId + "_value";
- String outputId = parentId + "_value2";
-
- writeStatus("Click on tab1");
- clickById(linkId);
- waitForAjaxCompletion();
- AssertValueEquals(inputId, "tab2");
- AssertTextEquals(outputId, "2");
- Assert.assertTrue(isVisibleById(tabId2));
- Assert.assertFalse(isVisibleById(tabId4));
- try {
- 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);
- AssertValueEquals(inputId, "tab1");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(tabId1));
- Assert.assertFalse(isVisibleById(tabId4));
- try {
- 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.");
- } catch (SeleniumException se) {
-
- }
- }
-
- public String getTestUrl() {
- return "/faces/pages/tabPanel/tabPanelTest.xhtml";
- }
-
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,127 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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;
+
+import com.thoughtworks.selenium.SeleniumException;
+
+public class TabPanelTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public TabPanelTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testTabPanelComponent() throws Exception {
+ _testRichTabPanelComponent(Templates.SIMPLE);
+ _testRichTabPanelComponent(Templates.DATATABLE);
+ _testRichTabPanelComponent(Templates.MODALPANEL);
+ }
+
+ 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";
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_value2";
+
+ writeStatus("Click on tab1");
+ clickById(linkId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "tab2");
+ AssertTextEquals(outputId, "2");
+ Assert.assertTrue(isVisibleById(tabId2));
+ Assert.assertFalse(isVisibleById(tabId4));
+ try {
+ 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);
+ AssertValueEquals(inputId, "tab1");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(tabId1));
+ Assert.assertFalse(isVisibleById(tabId4));
+ try {
+ 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.");
+ } catch (SeleniumException se) {
+
+ }
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/tabPanel/tabPanelTest.xhtml";
+ }
+
+
+}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java 2008-05-23 15:10:59 UTC (rev 8733)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -1,194 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces;
-
-import org.ajax4jsf.test.base.RichSeleniumTest;
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.ajax4jsf.test.base.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;
-
-import com.thoughtworks.selenium.SeleniumException;
-
-public class TogglePanelTest extends SeleniumTestBase implements
- RichSeleniumTest {
-
- public TogglePanelTest() {
- super("http", "localhost", "8080");
- }
-
- /**
- * 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 testTogglePanelComponent() throws Exception {
- _testTogglePanelComponent(Templates.SIMPLE);
- _testTogglePanelComponent(Templates.DATATABLE);
- _testTogglePanelComponent(Templates.MODALPANEL);
- }
-
- private void _testTogglePanelComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
-
- String inputId = parentId + "_value";
- String outputId = parentId + "_value2";
-
- String controlNext = parentId + "ajax_next";
- String controlOne = parentId + "ajax_one";
- String controlTwo = parentId + "ajax_two";
-
- String oneFacet = parentId + "ajax_state_one";
- String twoFacet = parentId + "ajax_state_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) {
-
- }
-
- 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 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) {
-
- }
-
- 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 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 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 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) {
-
- }
-
- 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 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));
-
- writeStatus("Click on client controlTwo");
- clickById(controlTwo);
- Assert.assertTrue(isVisibleById(twoFacet));
- Assert.assertFalse(isVisibleById(oneFacet));
- }
-
- public String getTestUrl() {
- return "/faces/pages/togglePanel/togglePanelTest.xhtml";
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java 2008-05-23 16:04:20 UTC (rev 8734)
@@ -0,0 +1,194 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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;
+
+import com.thoughtworks.selenium.SeleniumException;
+
+public class TogglePanelTest extends SeleniumTestBase implements
+ RichSeleniumTest {
+
+ public TogglePanelTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * 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 testTogglePanelComponent() throws Exception {
+ _testTogglePanelComponent(Templates.SIMPLE);
+ _testTogglePanelComponent(Templates.DATATABLE);
+ _testTogglePanelComponent(Templates.MODALPANEL);
+ }
+
+ private void _testTogglePanelComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+ String parentId = getParentId() + "_form:";
+
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_value2";
+
+ String controlNext = parentId + "ajax_next";
+ String controlOne = parentId + "ajax_one";
+ String controlTwo = parentId + "ajax_two";
+
+ String oneFacet = parentId + "ajax_state_one";
+ String twoFacet = parentId + "ajax_state_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) {
+
+ }
+
+ 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 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) {
+
+ }
+
+ 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 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 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 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) {
+
+ }
+
+ 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 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));
+
+ writeStatus("Click on client controlTwo");
+ clickById(controlTwo);
+ Assert.assertTrue(isVisibleById(twoFacet));
+ Assert.assertFalse(isVisibleById(oneFacet));
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/togglePanel/togglePanelTest.xhtml";
+ }
+
+}
16 years, 7 months
JBoss Rich Faces SVN: r8733 - in trunk/test-applications/seleniumTest/src: main/webapp/pages/spacer and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-05-23 11:10:59 -0400 (Fri, 23 May 2008)
New Revision: 8733
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/spacer/
trunk/test-applications/seleniumTest/src/main/webapp/pages/spacer/spacerTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SpacerTest.java
Log:
add spacer test
Added: trunk/test-applications/seleniumTest/src/main/webapp/pages/spacer/spacerTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/pages/spacer/spacerTest.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/pages/spacer/spacerTest.xhtml 2008-05-23 15:10:59 UTC (rev 8733)
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.template}">
+ <ui:define name="component">
+ <style>
+ .sp {
+ color: red;
+ }
+ </style>
+ <rich:spacer id="sp" styleClass="sp" style="border: solid 1px green;" width="1" height="5" title="Here is a spacer..."/>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SpacerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SpacerTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SpacerTest.java 2008-05-23 15:10:59 UTC (rev 8733)
@@ -0,0 +1,123 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.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", "8080");
+ }
+
+ /**
+ * 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 testSimpleTogglePanelComponent() throws Exception {
+ _testSimpleTogglePanelComponent(Templates.SIMPLE);
+ _testSimpleTogglePanelComponent(Templates.DATATABLE);
+ _testSimpleTogglePanelComponent(Templates.MODALPANEL);
+ }
+
+ 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);
+ }
+
+ public String getTestUrl() {
+ 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);
+ }
+}
16 years, 7 months
JBoss Rich Faces SVN: r8732 - trunk/ui/dataFilterSlider/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-23 10:50:39 -0400 (Fri, 23 May 2008)
New Revision: 8732
Modified:
trunk/ui/dataFilterSlider/src/test/java/org/richfaces/component/DataFilterSliderComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-3483
Modified: trunk/ui/dataFilterSlider/src/test/java/org/richfaces/component/DataFilterSliderComponentTest.java
===================================================================
--- trunk/ui/dataFilterSlider/src/test/java/org/richfaces/component/DataFilterSliderComponentTest.java 2008-05-23 14:23:35 UTC (rev 8731)
+++ trunk/ui/dataFilterSlider/src/test/java/org/richfaces/component/DataFilterSliderComponentTest.java 2008-05-23 14:50:39 UTC (rev 8732)
@@ -180,7 +180,7 @@
info.setInput(page.getWebResponse().getContentAsStream());
//image recognizable?
assertTrue(info.check());
- assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
+ assertEquals(ImageInfo.FORMAT_PNG, info.getFormat());
}
}
16 years, 7 months
JBoss Rich Faces SVN: r8731 - in trunk/test-applications/seleniumTest/src/main/webapp: template and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-05-23 10:23:35 -0400 (Fri, 23 May 2008)
New Revision: 8731
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/template/modalPanel.xhtml
Log:
Tests: possibility to select template manually added.
Modified: trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml 2008-05-23 13:46:19 UTC (rev 8730)
+++ trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml 2008-05-23 14:23:35 UTC (rev 8731)
@@ -69,6 +69,13 @@
<br/>
<div>
<ui:insert name="template"/>
+ </div>
+ <div>
+ <h:panelGroup>
+ <h:commandButton value="Load 'simple' template" onclick="loadTemplate('simple'); return false;" />
+ <h:commandButton value="Load 'dataTable' template" onclick="loadTemplate('dataTable'); return false;" />
+ <h:commandButton value="Load 'modalPanel' template" onclick="loadTemplate('modalPanel'); return false;" />
+ </h:panelGroup>
</div>
</h:panelGrid>
<script type="text/javascript">
Modified: trunk/test-applications/seleniumTest/src/main/webapp/template/modalPanel.xhtml
===================================================================
(Binary files differ)
16 years, 7 months