JBoss Rich Faces SVN: r17871 - in root/tests/metamer/trunk/ftest: src/test/java/org/richfaces/tests/testapp and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-10 16:50:32 -0400 (Sat, 10 Jul 2010)
New Revision: 17871
Modified:
root/tests/metamer/trunk/ftest/pom.xml
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/AbstractTestappTestCase.java
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java
Log:
type-safe creation of URL to test (using buildUrl)
Modified: root/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:50:06 UTC (rev 17870)
+++ root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:50:32 UTC (rev 17871)
@@ -14,7 +14,7 @@
</parent>
<properties>
- <context.path>/testapp</context.path>
+ <context.path>/testapp/</context.path>
<deployable.version>4.0.0-SNAPSHOT</deployable.version>
<deployable.classifier>tomcat6</deployable.classifier>
<tomcat6x.installer.url.unix>file:/qa/home/lfryc/apache-tomcat-6.0.26--jsf2.zip</tomcat6x.installer.url.unix>
Modified: root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/AbstractTestappTestCase.java
===================================================================
--- root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/AbstractTestappTestCase.java 2010-07-10 20:50:06 UTC (rev 17870)
+++ root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/AbstractTestappTestCase.java 2010-07-10 20:50:32 UTC (rev 17871)
@@ -23,8 +23,8 @@
package org.richfaces.tests.testapp;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import java.net.MalformedURLException;
import java.net.URL;
import org.jboss.test.selenium.AbstractTestCase;
@@ -54,7 +54,7 @@
*
* @return absolute url to the test page to be opened by Selenium
*/
- public abstract String getTestUrl();
+ public abstract URL getTestUrl();
/**
* Data provider for templates.
@@ -68,7 +68,7 @@
return templates;
}
- return new Object[][] {{"plain"}};
+ return new Object[][]{{"plain"}};
}
/**
@@ -104,11 +104,7 @@
if (templates != null && templates.length != 0) {
urlParams = "?templates=" + templates[0];
}
- try {
- selenium.open(new URL(getTestUrl() + urlParams));
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
+ selenium.open(buildUrl(getTestUrl() + urlParams));
}
/**
Modified: root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java
===================================================================
--- root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java 2010-07-10 20:50:06 UTC (rev 17870)
+++ root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java 2010-07-10 20:50:32 UTC (rev 17871)
@@ -26,7 +26,10 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import java.net.URL;
+
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.AttributeLocator;
@@ -50,8 +53,8 @@
private JQueryLocator output3 = jq("#form\\:output3");
@Override
- public String getTestUrl() {
- return contextPath.toString() + "/faces/components/commandButton/simple.xhtml";
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/commandButton/simple.xhtml");
}
@Override
14 years, 6 months
JBoss Rich Faces SVN: r17870 - root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-10 16:50:06 -0400 (Sat, 10 Jul 2010)
New Revision: 17870
Modified:
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java
Log:
added tests to appropriate groups
Modified: root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java
===================================================================
--- root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java 2010-07-10 20:49:42 UTC (rev 17869)
+++ root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java 2010-07-10 20:50:06 UTC (rev 17870)
@@ -60,7 +60,7 @@
super.invalidateSession();
}
- @Test(dataProvider = "templates")
+ @Test(dataProvider = "templates", groups = "client-side-perf")
public void testSimpleClick(String templates) {
selenium.typeKeys(input, "RichFaces 4");
selenium.click(button);
14 years, 6 months
JBoss Rich Faces SVN: r17869 - root/tests/metamer/trunk/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-10 16:49:42 -0400 (Sat, 10 Jul 2010)
New Revision: 17869
Modified:
root/tests/metamer/trunk/ftest/pom.xml
Log:
switched to pom type (needed for inherited projects)
Modified: root/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:49:31 UTC (rev 17868)
+++ root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:49:42 UTC (rev 17869)
@@ -5,7 +5,7 @@
<artifactId>testapp-tests</artifactId>
<version>4.0.0-SNAPSHOT</version>
<name>RichFaces 4.0 TestApp: Functional Test</name>
- <packaging>jar</packaging>
+ <packaging>pom</packaging>
<parent>
<artifactId>functional-test-jboss-ci-template</artifactId>
14 years, 6 months
JBoss Rich Faces SVN: r17868 - root/tests/metamer/trunk/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-10 16:49:31 -0400 (Sat, 10 Jul 2010)
New Revision: 17868
Modified:
root/tests/metamer/trunk/ftest/pom.xml
Log:
given the name to project
Modified: root/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:49:21 UTC (rev 17867)
+++ root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:49:31 UTC (rev 17868)
@@ -4,6 +4,7 @@
<groupId>org.richfaces.tests</groupId>
<artifactId>testapp-tests</artifactId>
<version>4.0.0-SNAPSHOT</version>
+ <name>RichFaces 4.0 TestApp: Functional Test</name>
<packaging>jar</packaging>
<parent>
14 years, 6 months
JBoss Rich Faces SVN: r17867 - root/tests/metamer/trunk/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-10 16:49:21 -0400 (Sat, 10 Jul 2010)
New Revision: 17867
Modified:
root/tests/metamer/trunk/ftest/pom.xml
Log:
preparing for deploy
Modified: root/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:49:04 UTC (rev 17866)
+++ root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:49:21 UTC (rev 17867)
@@ -20,14 +20,6 @@
<container.dir.deflatted>apache-tomcat-6.0.26--jsf2</container.dir.deflatted>
</properties>
- <repositories>
- <repository>
- <id>jboss-public-repository-group</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
- </repository>
- </repositories>
-
<dependencies>
<dependency>
<groupId>org.richfaces.examples</groupId>
@@ -40,7 +32,7 @@
<profiles>
<profile>
- <id>deploy-artifact</id>
+ <id>container-deploy-artifact</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
14 years, 6 months
JBoss Rich Faces SVN: r17866 - root/tests/metamer/trunk/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-10 16:49:04 -0400 (Sat, 10 Jul 2010)
New Revision: 17866
Modified:
root/tests/metamer/trunk/ftest/pom.xml
Log:
generation of test-jar
Modified: root/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:48:53 UTC (rev 17865)
+++ root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:49:04 UTC (rev 17866)
@@ -75,6 +75,18 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>test-jar</id>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
14 years, 6 months
JBoss Rich Faces SVN: r17865 - root/tests/metamer/trunk/ftest/src/test/resources.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-10 16:48:53 -0400 (Sat, 10 Jul 2010)
New Revision: 17865
Modified:
root/tests/metamer/trunk/ftest/src/test/resources/testng.xml
Log:
fixed the template names to correspond with testapp Template enum
Modified: root/tests/metamer/trunk/ftest/src/test/resources/testng.xml
===================================================================
--- root/tests/metamer/trunk/ftest/src/test/resources/testng.xml 2010-07-10 20:48:37 UTC (rev 17864)
+++ root/tests/metamer/trunk/ftest/src/test/resources/testng.xml 2010-07-10 20:48:53 UTC (rev 17865)
@@ -2,7 +2,7 @@
<suite name="seleniumTest">
<test name="SimpleComponents">
- <parameter name="templates" value="plain red_div red_div,blue_div "/>
+ <parameter name="templates" value="plain redDiv redDiv,blueDiv "/>
<packages>
<package name="org.richfaces.tests.testapp.commandButton" />
</packages>
14 years, 6 months
JBoss Rich Faces SVN: r17864 - root/tests/metamer/trunk/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-10 16:48:37 -0400 (Sat, 10 Jul 2010)
New Revision: 17864
Added:
root/tests/metamer/trunk/ftest/cli.sh
Removed:
root/tests/metamer/trunk/ftest/profiles.jboss-qa.xml
root/tests/metamer/trunk/ftest/profiles.xml
Modified:
root/tests/metamer/trunk/ftest/pom.xml
Log:
preparation for hudson integration testing
Added: root/tests/metamer/trunk/ftest/cli.sh
===================================================================
--- root/tests/metamer/trunk/ftest/cli.sh (rev 0)
+++ root/tests/metamer/trunk/ftest/cli.sh 2010-07-10 20:48:37 UTC (rev 17864)
@@ -0,0 +1,2 @@
+#!/bin/bash
+mvn cli:execute-phase
Modified: root/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:48:22 UTC (rev 17863)
+++ root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:48:37 UTC (rev 17864)
@@ -1,71 +1,102 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.tests</groupId>
- <artifactId>testapp</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <packaging>jar</packaging>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.tests</groupId>
+ <artifactId>testapp-tests</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
- <parent>
- <artifactId>functional-test-jboss-ci-template</artifactId>
- <groupId>org.jboss.test.richfaces-selenium</groupId>
- <version>1.5.0-SNAPSHOT</version>
- </parent>
+ <parent>
+ <artifactId>functional-test-jboss-ci-template</artifactId>
+ <groupId>org.jboss.test.richfaces-selenium</groupId>
+ <version>1.5.0-SNAPSHOT</version>
+ </parent>
- <properties>
- <context.path>/testapp</context.path>
- </properties>
+ <properties>
+ <context.path>/testapp</context.path>
+ <deployable.version>4.0.0-SNAPSHOT</deployable.version>
+ <deployable.classifier>tomcat6</deployable.classifier>
+ <tomcat6x.installer.url.unix>file:/qa/home/lfryc/apache-tomcat-6.0.26--jsf2.zip</tomcat6x.installer.url.unix>
+ <container.dir.deflatted>apache-tomcat-6.0.26--jsf2</container.dir.deflatted>
+ </properties>
- <repositories>
- <repository>
- <id>jboss-public-repository-group</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
- </repository>
- </repositories>
+ <repositories>
+ <repository>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ </repository>
+ </repositories>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>functional-test</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <suiteXmlFiles>
- <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
- </suiteXmlFiles>
- <properties>
- <property>
- <name>listener</name>
- <value>org.jboss.test.selenium.listener.ConsoleStatusTestListener</value>
- </property>
- </properties>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>testapp</artifactId>
+ <type>${deployable.type}</type>
+ <version>${deployable.version}</version>
+ <classifier>${deployable.classifier}</classifier>
+ </dependency>
+ </dependencies>
- <dependencies>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>5.10</version>
- <classifier>jdk15</classifier>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test</groupId>
- <artifactId>richfaces-selenium</artifactId>
- <version>1.5.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <profiles>
+ <profile>
+ <id>deploy-artifact</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <configuration>
+ <deployer>
+ <type>installed</type>
+ <deployables>
+ <deployable>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>testapp</artifactId>
+ <classifier>${deployable.classifier}</classifier>
+ <type>${deployable.type}</type>
+ <properties>
+ <context>${context.deploy.path}</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </deployer>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>functional-test</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <suiteXmlFiles>
+ <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.jboss.test.selenium.listener.ConsoleStatusTestListener</value>
+ </property>
+ </properties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
Deleted: root/tests/metamer/trunk/ftest/profiles.jboss-qa.xml
===================================================================
--- root/tests/metamer/trunk/ftest/profiles.jboss-qa.xml 2010-07-10 20:48:22 UTC (rev 17863)
+++ root/tests/metamer/trunk/ftest/profiles.jboss-qa.xml 2010-07-10 20:48:37 UTC (rev 17864)
@@ -1,216 +0,0 @@
-<profilesXml xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
- http://maven.apache.org/xsd/settings-1.0.0.xsd">
-
- <activeProfiles>
- <activeProfile>container-installation</activeProfile>
- </activeProfiles>
-
- <profiles>
- <!-- This is used by JBoss RichFaces QA -->
- <profile>
- <id>profile-test-not-empty</id>
- <activation>
- <property>
- <name>profile.test</name>
- <value>!</value>
- </property>
- </activation>
- <properties>
- <test>${profile.test}</test>
- </properties>
- </profile>
- <profile>
- <id>profile-demo-version-not-empty</id>
- <activation>
- <property>
- <name>profile.demo.version</name>
- <value>!</value>
- </property>
- </activation>
- <properties>
- <demo.version>${profile.demo.version}</demo.version>
- </properties>
- </profile>
- <!-- INTERNET EXPLORER PROFILE -->
- <profile>
- <id>browser-internet-explorer</id>
- <activation>
- <os>
- <family>windows</family>
- </os>
- <property>
- <name>profile.browser</name>
- <value>internet-explorer</value>
- </property>
- </activation>
- <properties>
- <browser>*piiexplore</browser>
- </properties>
- </profile>
- <!-- FIREFOX_VERSION -->
- <profile>
- <id>browser-firefox-2</id>
- <activation>
- <property>
- <name>profile.browser</name>
- <value>firefox-2</value>
- </property>
- </activation>
- <properties>
- <browser.version>2.0.0.20</browser.version>
- <browser>${browser.firefox}</browser>
- </properties>
- </profile>
- <profile>
- <id>browser-firefox-3.0</id>
- <activation>
- <property>
- <name>profile.browser</name>
- <value>firefox-3.0</value>
- </property>
- </activation>
- <properties>
- <browser.version>3.0.14</browser.version>
- <browser>${browser.firefox}</browser>
- </properties>
- </profile>
- <profile>
- <id>browser-firefox-3.5</id>
- <activation>
- <property>
- <name>profile.browser</name>
- <value>firefox-3.5</value>
- </property>
- </activation>
- <properties>
- <browser.version>3.5.3</browser.version>
- <browser>${browser.firefox}</browser>
- </properties>
- </profile>
- <!-- FIREFOX OS DENPENDENT -->
- <profile>
- <id>firefoxes-home-linux</id>
- <activation>
- <os>
- <family>unix</family>
- </os>
- </activation>
- <properties>
- <firefoxes.home>/qa/tools/opt</firefoxes.home>
- <browser.firefox>*firefox ${firefoxes.home}/firefox-${browser.version}/firefox-bin</browser.firefox>
- </properties>
- </profile>
- <profile>
- <id>firefoxes-home-windows</id>
- <activation>
- <os>
- <family>windows</family>
- </os>
- </activation>
- <properties>
- <firefoxes.home>T:\opt\windows</firefoxes.home>
- <browser.firefox>*firefox ${firefoxes.home}\firefox-${browser.version}\firefox.exe</browser.firefox>
- </properties>
- </profile>
- <!-- CONTAINER INSTALLATION -->
- <profile>
- <id>container-installation</id>
- <properties>
- <jboss5x.version>5.1.0.GA</jboss5x.version>
- <jboss5x.installer.url.unix>file:/qa/tools/src/jboss/jboss-${jboss5x.version}.zip</jboss5x.installer.url.unix>
- <jboss5x.installer.url.windows>file:t:\src\jboss\jboss-${jboss5x.version}.GA.zip</jboss5x.installer.url.windows>
- <jboss6x.version>6.0.0.M2</jboss6x.version>
- <jboss6x.unflatted.dir>jboss-${jboss6x.version}</jboss6x.unflatted.dir>
- <jboss6x.installer.url.unix>file:/qa/tools/src/jboss/jboss-${jboss6x.version}.zip</jboss6x.installer.url.unix>
- <jboss6x.installer.url.windows>file:t:\src\jboss\jboss-${jboss6x.version}.zip</jboss6x.installer.url.windows>
- <tomcat6x.version>6.0.24</tomcat6x.version>
- <tomcat6x.installer.url.unix>file:/qa/tools/src/apache/apache-tomcat-${tomcat6x.version}.zip</tomcat6x.installer.url.unix>
- <tomcat6x.installer.url.windows>file:t:\src\apache\apache-tomcat-${tomcat6x.version}.zip</tomcat6x.installer.url.windows>
- </properties>
- </profile>
- <profile>
- <id>container-tomcat6x-installation</id>
- <activation>
- <property>
- <name>containerId</name>
- <value>tomcat6x</value>
- </property>
- </activation>
- <properties>
- <container.version>${tomcat6x.version}</container.version>
- <container.installer.url.unix>${tomcat6x.installer.url.unix}</container.installer.url.unix>
- <container.installer.url.windows>${tomcat6x.installer.url.windows}</container.installer.url.windows>
- </properties>
- </profile>
- <profile>
- <id>container-jboss5x-installation</id>
- <activation>
- <property>
- <name>containerId</name>
- <value>jboss5x</value>
- </property>
- </activation>
- <properties>
- <container.version>${jboss5x.version}</container.version>
- <container.installer.url.unix>${jboss5x.installer.url.unix}</container.installer.url.unix>
- <container.installer.url.windows>${jboss5x.installer.url.windows}</container.installer.url.windows>
- </properties>
- </profile>
- <profile>
- <id>container-jboss6x-installation</id>
- <activation>
- <property>
- <name>containerId</name>
- <value>jboss6x</value>
- </property>
- </activation>
- <properties>
- <container.version>${jboss6x.version}</container.version>
- <container.unflatted.dir>${jboss6x.unflatted.dir}</container.unflatted.dir>
- <container.installer.url.unix>${jboss6x.installer.url.unix}</container.installer.url.unix>
- <container.installer.url.windows>${jboss6x.installer.url.windows}</container.installer.url.windows>
- </properties>
- </profile>
- <profile>
- <id>container-installation-unix</id>
- <activation>
- <os>
- <family>unix</family>
- </os>
- </activation>
- <properties>
- <container.installer.url>${container.installer.url.unix}</container.installer.url>
- </properties>
- </profile>
- <profile>
- <id>container-installation-windows</id>
- <activation>
- <os>
- <family>windows</family>
- </os>
- </activation>
- <properties>
- <container.installer.url>${container.installer.url.windows}</container.installer.url>
- </properties>
- </profile>
- <!-- REPOSITORIES CONFIGURATION -->
- <profile>
- <id>repository-exadel</id>
- <repositories>
- <repository>
- <!-- used for RichFaces release testing -->
- <id>repository.exadel.com</id>
- <url>http://repository.exadel.com</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
- </profile>
- </profiles>
-</profilesXml>
Deleted: root/tests/metamer/trunk/ftest/profiles.xml
===================================================================
--- root/tests/metamer/trunk/ftest/profiles.xml 2010-07-10 20:48:22 UTC (rev 17863)
+++ root/tests/metamer/trunk/ftest/profiles.xml 2010-07-10 20:48:37 UTC (rev 17864)
@@ -1,36 +0,0 @@
-<profilesXml xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
- http://maven.apache.org/xsd/settings-1.0.0.xsd">
- <profiles>
- <profile>
- <id>localEnvironment</id>
- <!-- set local environment specific properties here -->
- <properties>
- <!-- *** browser: the type of web browser (and path to its binary if needed) -->
- <!--<browser>*firefox</browser>-->
- <!--<browser>*firefox /usr/lib/firefox-3.5.2/firefox</browser>-->
- <!--<browser>*chrome</browser>-->
- <!--<browser>*chrome /usr/lib/firefox-3.5.2/firefox</browser>-->
- <!--<browser>*iexplore</browser>-->
- <!--<browser>*iexplore c:\\program files\\internet explorer\\iexplore.exe</browser>-->
- <!--<browser>*konqueror /usr/bin/konqueror</browser>-->
- <!--<browser>*safari</browser>-->
-
- <!--*** context.root: HTTP protocol URL to testing server ***-->
- <!--<context.root>http://localhost:8080/</context.root>-->
-
- <!--*** context.path: Context root of application in context of server ***-->
- <!--<context.path>/richfaces-demo</context.path>-->
-
- <!--*** selenium.port: specifies on which port should run selenium server (default: 8444) ***-->
- <!--<selenium.port>8446</selenium.port>-->
-
- <!--*** firefoxProfileTemplate: specifies path to firefox's profile which should be used as template to create new session -->
- <!--<firefoxProfileTemplate>/home/qa/.mozilla/firefox/87nmklfc.Testing</firefoxProfileTemplate>-->
- </properties>
- </profile>
- </profiles>
- <activeProfiles>
- <activeProfile>localEnvironment</activeProfile>
- </activeProfiles>
-</profilesXml>
14 years, 6 months
JBoss Rich Faces SVN: r17863 - in root/tests/metamer/trunk/ftest: src/test/java/org/richfaces/tests/testapp and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-10 16:48:22 -0400 (Sat, 10 Jul 2010)
New Revision: 17863
Added:
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/AbstractTestappTestCase.java
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java
Removed:
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/CommandLinkTestCase.java
Modified:
root/tests/metamer/trunk/ftest/pom.xml
root/tests/metamer/trunk/ftest/src/test/resources/testng.xml
Log:
https://jira.jboss.org/browse/RFPL-466
* testng.xml refactored
* test case for button finished and moved
* AbstractTestappTestCase refactored
* one property added to pom.xml
* testng upgraded in pom.xml
* added test listener configuration to pom.xml
Modified: root/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:47:45 UTC (rev 17862)
+++ root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:48:22 UTC (rev 17863)
@@ -12,6 +12,10 @@
<version>1.5.0-SNAPSHOT</version>
</parent>
+ <properties>
+ <context.path>/testapp</context.path>
+ </properties>
+
<repositories>
<repository>
<id>jboss-public-repository-group</id>
@@ -36,6 +40,12 @@
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.jboss.test.selenium.listener.ConsoleStatusTestListener</value>
+ </property>
+ </properties>
</configuration>
</execution>
</executions>
@@ -47,7 +57,8 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>5.9</version>
+ <version>5.10</version>
+ <classifier>jdk15</classifier>
<scope>test</scope>
</dependency>
<dependency>
Added: root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/AbstractTestappTestCase.java
===================================================================
--- root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/AbstractTestappTestCase.java (rev 0)
+++ root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/AbstractTestappTestCase.java 2010-07-10 20:48:22 UTC (rev 17863)
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+
+package org.richfaces.tests.testapp;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.jboss.test.selenium.AbstractTestCase;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Optional;
+import org.testng.annotations.Parameters;
+
+/**
+ * Abstract test case used as a basis for majority of test cases.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public abstract class AbstractTestappTestCase extends AbstractTestCase {
+
+ /**
+ * timeout in miliseconds
+ */
+ public static final long TIMEOUT = 5000;
+ private String[][] templates;
+
+ /**
+ * Returns the url to test page to be opened by Selenium
+ *
+ * @return absolute url to the test page to be opened by Selenium
+ */
+ public abstract String getTestUrl();
+
+ /**
+ * Data provider for templates.
+ *
+ * @return array containing templates that should be used (defined in testng.xml) or default array (containing only
+ * plain template) if nothing is defined
+ */
+ @DataProvider(name = "templates")
+ protected Object[][] getTemplates() {
+ if (templates != null && templates.length > 0) {
+ return templates;
+ }
+
+ return new Object[][] {{"plain"}};
+ }
+
+ /**
+ * Loads and parses attribute "templates" from testng.xml.
+ *
+ * @param urlParams
+ */
+ @BeforeClass
+ @Parameters({"templates"})
+ public void initTemplates(@Optional String urlParams) {
+ if (urlParams == null) {
+ return;
+ }
+
+ String[] array = urlParams.split(" ");
+ templates = new String[array.length][];
+
+ for (int i = 0; i < array.length; i++) {
+ templates[i] = new String[1];
+ templates[i][0] = array[i];
+ }
+ }
+
+ /**
+ * Opens the tested page. If templates is not empty nor null, it appends url parameter with templates.
+ *
+ * @param templates
+ * templates that will be used for test, e.g. "red_div"
+ */
+ @BeforeMethod
+ public void loadPage(Object[] templates) {
+ String urlParams = "";
+ if (templates != null && templates.length != 0) {
+ urlParams = "?templates=" + templates[0];
+ }
+ try {
+ selenium.open(new URL(getTestUrl() + urlParams));
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Invalidates session by clicking on a button on tested page.
+ */
+ public void invalidateSession() {
+ JQueryLocator invalidateButton = jq("#form input[value=Invalidate Session]");
+ selenium.click(invalidateButton);
+ selenium.waitForPageToLoad(TIMEOUT);
+ }
+
+ /**
+ * Forces the current thread sleep for given time.
+ *
+ * @param millis
+ * number of miliseconds for which the thread will sleep
+ */
+ @Deprecated
+ protected void waitFor(long millis) {
+ try {
+ Thread.sleep(millis);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+}
Deleted: root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/CommandLinkTestCase.java
===================================================================
--- root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/CommandLinkTestCase.java 2010-07-10 20:47:45 UTC (rev 17862)
+++ root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/CommandLinkTestCase.java 2010-07-10 20:48:22 UTC (rev 17863)
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *******************************************************************************/
-
-package org.richfaces.tests.testapp;
-
-import static org.jboss.test.selenium.locator.LocatorFactory.jq;
-import static org.jboss.test.selenium.locator.LocatorFactory.id;
-import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.*;
-
-import static org.testng.Assert.assertEquals;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.jboss.test.selenium.AbstractTestCase;
-import org.jboss.test.selenium.locator.Attribute;
-import org.jboss.test.selenium.locator.AttributeLocator;
-import org.jboss.test.selenium.locator.IdLocator;
-import org.jboss.test.selenium.locator.JQueryLocator;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-
-public class CommandLinkTestCase extends AbstractTestCase {
-
- private JQueryLocator input = jq("#form\\:input");
- private JQueryLocator button = jq("#form\\:commandButton");
- private IdLocator output1 = id("form:output1");
-// private JQueryLocator output1 = jq("#form\\:output1");
- private JQueryLocator output2 = jq("#form\\:output2");
- private JQueryLocator output3 = jq("#form\\:output3");
-
- private static final long TIMEOUT = 5000;
-
- @BeforeMethod
- public void init() throws MalformedURLException {
- selenium.open(new URL("http://localhost:8080/testapp/faces/components/commandButton/simple.xhtml"));
- }
-
- @AfterMethod
- public void invalidateSession() {
- JQueryLocator invalidateButton = jq("#form input[value=Invalidate Session]");
- selenium.click(invalidateButton);
- selenium.waitForPageToLoad(TIMEOUT);
- }
-
-// @Test
- public void testSimpleClick() {
- selenium.typeKeys(input, "RichFaces 4");
- selenium.click(button);
-
- waitGui.until(textEquals.locator(output1).text("RichFaces 4"));
-
- String output = selenium.getText(output1);
- assertEquals(output, "RichFaces 4", "output1 when 'RichFaces 4' in input");
-
- output = selenium.getText(output2);
- assertEquals(output, "RichFa", "output2 when 'RichFaces 4' in input");
-
- output = selenium.getText(output3);
- assertEquals(output, "RICHFACES 4", "output3 when 'RichFaces 4' in input");
- }
-
-// @Test
- public void testSimpleClickUnicode() {
- selenium.typeKeys(input, "ľščťžýáíéňô");
- selenium.click(button);
-
- waitGui.until(textEquals.locator(output1).text("ľščťžýáíéňô"));
-
- String output = selenium.getText(output1);
- assertEquals(output, "ľščťžýáíéňô", "output1 when 'ľščťžýáíéňô' in input");
-
- output = selenium.getText(output2);
- assertEquals(output, "ľščťžý", "output2 when 'ľščťžýáíéňô' in input");
-
- output = selenium.getText(output3);
- assertEquals(output, "ĽŠČŤŽÝÁÍÉŇÔ", "output3 when 'ľščťžýáíéňô' in input");
- }
-
-// @Test
- public void testAction() {
- JQueryLocator doubleStringAction = jq("#form\\:attributes\\:actionInput\\:0");
- JQueryLocator first6CharsAction = jq("#form\\:attributes\\:actionInput\\:1");
- JQueryLocator toUpperCaseAction = jq("#form\\:attributes\\:actionInput\\:2");
-
- selenium.click(doubleStringAction);
- selenium.waitForPageToLoad(TIMEOUT);
- selenium.typeKeys(input, "RichFaces 4");
- selenium.click(button);
- waitGui.until(textEquals.locator(output1).text("RichFaces 4"));
- String output = selenium.getText(output2);
- assertEquals(output, "RichFaces 4RichFaces 4", "output2 when 'RichFaces 4' in input and doubleStringAction selected");
-
- selenium.click(first6CharsAction);
- selenium.waitForPageToLoad(TIMEOUT);
- selenium.typeKeys(input, "RichFaces 4ň");
- selenium.click(button);
- waitGui.until(textEquals.locator(output1).text("RichFaces 4ň"));
- output = selenium.getText(output2);
- assertEquals(output, "RichFa", "output2 when 'RichFaces 4ň' in input and first6CharsAction selected");
-
- selenium.click(toUpperCaseAction);
- selenium.waitForPageToLoad(TIMEOUT);
- selenium.typeKeys(input, "RichFaces 4ě");
- selenium.click(button);
- waitGui.until(textEquals.locator(output1).text("RichFaces 4ě"));
- output = selenium.getText(output2);
- assertEquals(output, "RICHFACES 4Ě", "output2 when 'RichFaces 4ě' in input and toUpperCaseAction selected");
- }
-
-// @Test
- public void testActionListener() {
- JQueryLocator doubleStringActionListener = jq("input[value=doubleStringActionListener]");
- JQueryLocator first6CharsActionListener = jq("input[value=first6CharsActionListener]");
- JQueryLocator toUpperCaseActionListener = jq("input[value=toUpperCaseActionListener]");
-
- selenium.click(doubleStringActionListener);
- selenium.waitForPageToLoad(TIMEOUT);
- selenium.typeKeys(input, "RichFaces 4");
- selenium.click(button);
- waitGui.until(textEquals.locator(output1).text("RichFaces 4"));
- String output = selenium.getText(output3);
- assertEquals(output, "RichFaces 4RichFaces 4", "output2 when 'RichFaces 4' in input and doubleStringActionListener selected");
-
- selenium.click(first6CharsActionListener);
- selenium.waitForPageToLoad(TIMEOUT);
- selenium.typeKeys(input, "RichFaces 4ň");
- selenium.click(button);
- waitGui.until(textEquals.locator(output1).text("RichFaces 4ň"));
- output = selenium.getText(output3);
- assertEquals(output, "RichFa", "output2 when 'RichFaces 4ň' in input and first6CharsActionListener selected");
-
- selenium.click(toUpperCaseActionListener);
- selenium.waitForPageToLoad(TIMEOUT);
- selenium.typeKeys(input, "RichFaces 4ě");
- selenium.click(button);
- waitGui.until(textEquals.locator(output1).text("RichFaces 4ě"));
- output = selenium.getText(output3);
- assertEquals(output, "RICHFACES 4Ě", "output2 when 'RichFaces 4ě' in input and toUpperCaseActionListener selected");
- }
-
- @Test
- public void testDisabled() {
- JQueryLocator disabledChecbox = jq("#form\\:attributes\\:disabledInput");
- AttributeLocator disabledAttribute = button.getAttribute(new Attribute("disabled"));
-
- selenium.click(disabledChecbox);
- selenium.waitForPageToLoad(TIMEOUT);
-
- String isDisabled = selenium.getAttribute(disabledAttribute);
- assertEquals(isDisabled.toLowerCase(), "disabled", "The value of attribute disabled");
- }
-
- private void waitFor(long millis) {
- try {
- Thread.sleep(millis);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-}
Copied: root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java (from rev 17862, root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/CommandLinkTestCase.java)
===================================================================
--- root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java (rev 0)
+++ root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java 2010-07-10 20:48:22 UTC (rev 17863)
@@ -0,0 +1,262 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+
+package org.richfaces.tests.testapp.commandButton;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.AttributeLocator;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.testapp.AbstractTestappTestCase;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for page /faces/components/commandButton/simple.xhtml
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class CommandButtonTestCase extends AbstractTestappTestCase {
+
+ private JQueryLocator input = jq("#form\\:input");
+ private JQueryLocator button = jq("#form\\:commandButton");
+ private JQueryLocator output1 = jq("#form\\:output1");
+ private JQueryLocator output2 = jq("#form\\:output2");
+ private JQueryLocator output3 = jq("#form\\:output3");
+
+ @Override
+ public String getTestUrl() {
+ return contextPath.toString() + "/faces/components/commandButton/simple.xhtml";
+ }
+
+ @Override
+ @AfterMethod
+ public void invalidateSession() {
+ super.invalidateSession();
+ }
+
+ @Test(dataProvider = "templates")
+ public void testSimpleClick(String templates) {
+ selenium.typeKeys(input, "RichFaces 4");
+ selenium.click(button);
+
+ waitGui.until(textEquals.locator(output1).text("RichFaces 4"));
+
+ String output = selenium.getText(output1);
+ assertEquals(output, "RichFaces 4", "output1 when 'RichFaces 4' in input");
+
+ output = selenium.getText(output2);
+ assertEquals(output, "RichFa", "output2 when 'RichFaces 4' in input");
+
+ output = selenium.getText(output3);
+ assertEquals(output, "RICHFACES 4", "output3 when 'RichFaces 4' in input");
+ }
+
+ @Test(dataProvider = "templates")
+ public void testSimpleClickUnicode(String templates) {
+ selenium.typeKeys(input, "ľščťžýáíéňô");
+ selenium.click(button);
+
+ waitGui.until(textEquals.locator(output1).text("ľščťžýáíéňô"));
+
+ String output = selenium.getText(output1);
+ assertEquals(output, "ľščťžýáíéňô", "output1 when 'ľščťžýáíéňô' in input");
+
+ output = selenium.getText(output2);
+ assertEquals(output, "ľščťžý", "output2 when 'ľščťžýáíéňô' in input");
+
+ output = selenium.getText(output3);
+ assertEquals(output, "ĽŠČŤŽÝÁÍÉŇÔ", "output3 when 'ľščťžýáíéňô' in input");
+ }
+
+ @Test(dataProvider = "templates")
+ public void testAction(String templates) {
+ JQueryLocator doubleStringAction = jq("#form\\:attributes\\:actionInput\\:0");
+ JQueryLocator first6CharsAction = jq("#form\\:attributes\\:actionInput\\:1");
+ JQueryLocator toUpperCaseAction = jq("#form\\:attributes\\:actionInput\\:2");
+
+ selenium.click(doubleStringAction);
+ selenium.waitForPageToLoad(TIMEOUT);
+ selenium.typeKeys(input, "RichFaces 4");
+ selenium.click(button);
+ waitGui.until(textEquals.locator(output1).text("RichFaces 4"));
+ String output = selenium.getText(output2);
+ assertEquals(output, "RichFaces 4RichFaces 4",
+ "output2 when 'RichFaces 4' in input and doubleStringAction selected");
+
+ selenium.click(first6CharsAction);
+ selenium.waitForPageToLoad(TIMEOUT);
+ selenium.typeKeys(input, "RichFaces 4ň");
+ selenium.click(button);
+ waitGui.until(textEquals.locator(output1).text("RichFaces 4ň"));
+ output = selenium.getText(output2);
+ assertEquals(output, "RichFa", "output2 when 'RichFaces 4ň' in input and first6CharsAction selected");
+
+ selenium.click(toUpperCaseAction);
+ selenium.waitForPageToLoad(TIMEOUT);
+ selenium.typeKeys(input, "RichFaces 4ě");
+ selenium.click(button);
+ waitGui.until(textEquals.locator(output1).text("RichFaces 4ě"));
+ output = selenium.getText(output2);
+ assertEquals(output, "RICHFACES 4Ě", "output2 when 'RichFaces 4ě' in input and toUpperCaseAction selected");
+ }
+
+ @Test(dataProvider = "templates")
+ public void testActionListener(String templates) {
+ JQueryLocator doubleStringActionListener = jq("input[value=doubleStringActionListener]");
+ JQueryLocator first6CharsActionListener = jq("input[value=first6CharsActionListener]");
+ JQueryLocator toUpperCaseActionListener = jq("input[value=toUpperCaseActionListener]");
+
+ selenium.click(doubleStringActionListener);
+ selenium.waitForPageToLoad(TIMEOUT);
+ selenium.typeKeys(input, "RichFaces 4");
+ selenium.click(button);
+ waitGui.until(textEquals.locator(output1).text("RichFaces 4"));
+ String output = selenium.getText(output3);
+ assertEquals(output, "RichFaces 4RichFaces 4",
+ "output2 when 'RichFaces 4' in input and doubleStringActionListener selected");
+
+ selenium.click(first6CharsActionListener);
+ selenium.waitForPageToLoad(TIMEOUT);
+ selenium.typeKeys(input, "RichFaces 4ň");
+ selenium.click(button);
+ waitGui.until(textEquals.locator(output1).text("RichFaces 4ň"));
+ output = selenium.getText(output3);
+ assertEquals(output, "RichFa", "output2 when 'RichFaces 4ň' in input and first6CharsActionListener selected");
+
+ selenium.click(toUpperCaseActionListener);
+ selenium.waitForPageToLoad(TIMEOUT);
+ selenium.typeKeys(input, "RichFaces 4ě");
+ selenium.click(button);
+ waitGui.until(textEquals.locator(output1).text("RichFaces 4ě"));
+ output = selenium.getText(output3);
+ assertEquals(output, "RICHFACES 4Ě",
+ "output2 when 'RichFaces 4ě' in input and toUpperCaseActionListener selected");
+ }
+
+ @Test(dataProvider = "templates")
+ public void testDisabled(String templates) {
+ JQueryLocator disabledChecbox = jq("#form\\:attributes\\:disabledInput");
+ AttributeLocator disabledAttribute = button.getAttribute(new Attribute("disabled"));
+
+ selenium.click(disabledChecbox);
+ selenium.waitForPageToLoad(TIMEOUT);
+
+ String isDisabled = selenium.getAttribute(disabledAttribute);
+ assertEquals(isDisabled.toLowerCase(), "disabled", "The value of attribute disabled");
+ }
+
+ @Test(dataProvider = "templates")
+ public void testOnclick(String templates) {
+ JQueryLocator onclickInput = jq("#form\\:attributes\\:onclickInput");
+ final AttributeLocator onclickAttribute = button.getAttribute(new Attribute("onclick"));
+ final String value = "alert('onclick')";
+
+ selenium.type(onclickInput, value);
+ selenium.fireEvent(onclickInput, Event.BLUR);
+
+ selenium.waitForPageToLoad(TIMEOUT);
+ assertEquals(selenium.getAttribute(onclickAttribute), value, "onclick attribute did not change correctly");
+ }
+
+ @Test(dataProvider = "templates")
+ public void testStyleClass(String templates) {
+ JQueryLocator blue = jq("table#form\\:attributes\\:styleClassInput input[value=blue]");
+ JQueryLocator red = jq("table#form\\:attributes\\:styleClassInput input[value=red]");
+ JQueryLocator wide = jq("table#form\\:attributes\\:styleClassInput input[value=wide]");
+ JQueryLocator big = jq("table#form\\:attributes\\:styleClassInput input[value=big]");
+ JQueryLocator none = jq("table#form\\:attributes\\:styleClassInput input[value=]");
+
+ final AttributeLocator classAttribute = button.getAttribute(new Attribute("class"));
+
+ selenium.click(blue);
+ selenium.waitForPageToLoad(TIMEOUT);
+ assertTrue(selenium.belongsClass(button, "blue"), "Button's class was not changed to 'blue'");
+
+ selenium.click(red);
+ selenium.waitForPageToLoad(TIMEOUT);
+ assertTrue(selenium.belongsClass(button, "red"), "Button's class was not changed to 'red'");
+
+ selenium.click(wide);
+ selenium.waitForPageToLoad(TIMEOUT);
+ assertTrue(selenium.belongsClass(button, "wide"), "Button's class was not changed to 'wide'");
+
+ selenium.click(big);
+ selenium.waitForPageToLoad(TIMEOUT);
+ assertTrue(selenium.belongsClass(button, "big"), "Button's class was not changed to 'big'");
+
+ selenium.click(none);
+ selenium.waitForPageToLoad(TIMEOUT);
+ assertFalse(selenium.isAttributePresent(classAttribute), "Button's class was not removed.");
+ }
+
+ @Test(dataProvider = "templates")
+ public void testStyle(String templates) {
+ JQueryLocator styleInput = jq("#form\\:attributes\\:styleInput");
+ final AttributeLocator attribute = button.getAttribute(new Attribute("style"));
+ final String value = "font-size: 20px;";
+
+ selenium.type(styleInput, value);
+ selenium.fireEvent(styleInput, Event.BLUR);
+
+ selenium.waitForPageToLoad(TIMEOUT);
+ assertEquals(selenium.getAttribute(attribute), value, "Style of the button did not change");
+ }
+
+ @Test(dataProvider = "templates")
+ public void testValue(String templates) {
+ JQueryLocator valueInput = jq("#form\\:attributes\\:valueInput");
+ final AttributeLocator attribute = button.getAttribute(new Attribute("value"));
+ final String value = "new label";
+
+ selenium.type(valueInput, value);
+ selenium.fireEvent(valueInput, Event.BLUR);
+
+ selenium.waitForPageToLoad(TIMEOUT);
+ assertEquals(selenium.getAttribute(attribute), value, "Value of the button did not change");
+ }
+
+ // functionality probably not implemented yet
+ // @Test(dataProvider = "templates")
+ public void testRender(String templates) {
+ JQueryLocator renderInput = jq("#form\\:attributes\\:renderInput");
+
+ selenium.typeKeys(renderInput, "output1");
+ selenium.fireEvent(renderInput, Event.BLUR);
+ selenium.waitForPageToLoad(TIMEOUT);
+ selenium.typeKeys(input, "aaa");
+ selenium.click(button);
+
+ waitGui.until(textEquals.locator(output1).text("aaa"));
+
+ assertTrue(selenium.isElementPresent(output1), "output1 should be visible");
+ assertFalse(selenium.isElementPresent(output2), "output2 should not be visible");
+ assertFalse(selenium.isElementPresent(output3), "output3 should not be visible");
+ }
+
+}
Modified: root/tests/metamer/trunk/ftest/src/test/resources/testng.xml
===================================================================
--- root/tests/metamer/trunk/ftest/src/test/resources/testng.xml 2010-07-10 20:47:45 UTC (rev 17862)
+++ root/tests/metamer/trunk/ftest/src/test/resources/testng.xml 2010-07-10 20:48:22 UTC (rev 17863)
@@ -1,9 +1,10 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="seleniumTest">
- <test name="CommandLinkTestCase">
+ <test name="SimpleComponents">
+ <parameter name="templates" value="plain red_div red_div,blue_div "/>
<packages>
- <package name="org.richfaces.tests.testapp" />
+ <package name="org.richfaces.tests.testapp.commandButton" />
</packages>
</test>
14 years, 6 months
JBoss Rich Faces SVN: r17859 - root/tests/metamer/trunk/src/main/webapp/components/a4jPush.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-07-10 15:38:11 -0400 (Sat, 10 Jul 2010)
New Revision: 17859
Modified:
root/tests/metamer/trunk/src/main/webapp/components/a4jPush/simple.xhtml
Log:
extended output for a4j:push - time since epoch + client side output
Modified: root/tests/metamer/trunk/src/main/webapp/components/a4jPush/simple.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/components/a4jPush/simple.xhtml 2010-07-10 19:37:46 UTC (rev 17858)
+++ root/tests/metamer/trunk/src/main/webapp/components/a4jPush/simple.xhtml 2010-07-10 19:38:11 UTC (rev 17859)
@@ -12,17 +12,35 @@
</f:viewParam>
</f:metadata>
<h:outputStylesheet library="css" name="a4jPush.css"/>
+ <h:outputScript library="script" name="date-format.js" />
</ui:define>
<ui:define name="outOfTemplateBefore">
</ui:define>
<ui:define name="component">
+
+ <h:panelGroup id="time">
+ <h:outputText value="Server: " />
+ <h:outputText id="serverDate" value="#{a4jPushBean.date}" title="#{a4jPushBean.date.time}">
+ <f:convertDateTime pattern="dd.MM.yyyy HH:mm:ss.SSS" />
+ </h:outputText>
+ ***
+ <h:outputText value="Client: " />
+ <h:outputText id="clientDate" value="" title="" />
+ <script type="text/javascript">
+ //<![CDATA[
+ var now = new Date();
+ jQuery("div.content span[id$=clientDate]")
+ .text(now.format("dd.mm.yyyy HH:MM:ss.l", false))
+ .attr("title", now.getTime());
+ //]]>
+ </script>
+ ***
+ <h:outputText value="Counter: " />
+ <h:outputText id="outputCounter" value="#{a4jPushBean.counter}"/>
+ </h:panelGroup>
- <h:outputText id="outputDate" value="#{a4jPushBean.date}"/>
- ***
- <h:outputText id="outputCounter" value="#{a4jPushBean.counter}"/>
-
<a4j:push id="push"
action="#{a4jPushBean.attributes.action}"
actionListener="#{a4jPushBean.attributes.actionListener}"
@@ -39,7 +57,7 @@
rendered="#{a4jPushBean.attributes['rendered'].value}"
value="#{a4jPushBean.attributes['value'].value}"
>
- <a4j:ajax render="outputDate, outputCounter" />
+ <a4j:ajax render="time" />
<f:param name="testParam" value="testValue" />
<f:param name="testParam1" value="testValue1" />
</a4j:push>
14 years, 6 months