JBoss Portal SVN: r12490 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-01-13 15:50:30 -0500 (Tue, 13 Jan 2009)
New Revision: 12490
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
Log:
dashboard reorder fix
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-01-13 18:07:42 UTC (rev 12489)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-01-13 20:50:30 UTC (rev 12490)
@@ -16,6 +16,8 @@
private static final String LINK_WEATHER_PORTLET = "link=*WeatherPortlet*";
private static final String LINK_PORTL2 = "link=*Who's online portlet*";
private static final String LINK_PORTL1 = "link=*Welcome portlet*";
+ private static final String OPT_PORTL2 = "CurrentUsersPortletWindow";
+ private static final String OPT_PORTL1 = "JSPPortletWindow";
private static final String SEL_CONTENT_TYPE = "//select[contains(@id,'contentTypesForm:instanceId')]";
private static final String SUB_DEL_FROM_CENTER_REGION = "//input[contains(@id,'layoutForm:l_center')]";
private static final String SUB_DOWN_CENTER_REGION = "//input[contains(@id,'layoutForm:d_center')]";
@@ -229,8 +231,8 @@
selenium.click("link="+pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(assertTextOrder("Current;JSP"));
- Assert.assertTrue(assertTextOrder("JSP;Current"));
+ Assert.assertFalse(assertTextOrder("Current;Greetings"));
+ Assert.assertTrue(assertTextOrder("Greetings;Current"));
}
@@ -245,7 +247,7 @@
wait(5000);
selectIfNotSelected(SEL_PAGE,pageName);
- selenium.addSelection(SEL_CENTER_REGION, "label=ExceptionPortletWindow");
+ selenium.addSelection(SEL_CENTER_REGION, OPT_PORTL1);
selenium.click(SUB_DOWN_CENTER_REGION);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -254,8 +256,8 @@
selenium.click("link="+pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(assertTextOrder("Current;Exception"));
- Assert.assertFalse(assertTextOrder("Exception;Current"));
+ Assert.assertFalse(assertTextOrder("Greetings;Current"));
+ Assert.assertTrue(assertTextOrder("Current;Greetings"));
}
@Test(enabled = true, dependsOnMethods = { "testAddPortlet" })
17 years, 3 months
JBoss Portal SVN: r12489 - in modules/portlet/trunk: test/src/test and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-01-13 13:07:42 -0500 (Tue, 13 Jan 2009)
New Revision: 12489
Modified:
modules/portlet/trunk/build/pom.xml
modules/portlet/trunk/test/src/test/build.xml
modules/portlet/trunk/test/src/test/resources/test/servers.xml
Log:
- Make it easier to run tests locally without having to setup many servlet containers.
- Started prefixing Private ANT tasks that cannot/shouldn't be called directly with __.
- Use web 1.2.2.
- Run tests on 4.2.3.
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2009-01-13 15:25:44 UTC (rev 12488)
+++ modules/portlet/trunk/build/pom.xml 2009-01-13 18:07:42 UTC (rev 12489)
@@ -34,7 +34,7 @@
<version.jbossxb>2.0.0.CR8</version.jbossxb>
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
<version.jboss.portal.common>trunk-SNAPSHOT</version.jboss.portal.common>
- <version.jboss.portal.web>1.2.1</version.jboss.portal.web>
+ <version.jboss.portal.web>1.2.2</version.jboss.portal.web>
<version.jboss.unit>1.2.1</version.jboss.unit>
<version.log4j>1.2.14</version.log4j>
<version.apache.commons-logging>1.1.1</version.apache.commons-logging>
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2009-01-13 15:25:44 UTC (rev 12488)
+++ modules/portlet/trunk/test/src/test/build.xml 2009-01-13 18:07:42 UTC (rev 12489)
@@ -5,7 +5,7 @@
<antcall target="__tests"/>
</target>
- <target name="__tests" depends="prepare_env, evaluate_properties" >
+ <target name="__tests" depends="prepare_env, __evaluate_properties.init" >
<echo message="compile classpath: ${compile_classpath}"/>
<echo message="runtime classpath: ${runtime_classpath}"/>
@@ -14,6 +14,7 @@
<!-- <echo message="You can run small subset of tests using -Dtests=local, -Dtests=jboss, -Dtests=tomcat, or -Dtests=jetty"/> -->
<echo message="You can run small subset of tests using -Dtests=local, -Dtests=jboss, or -Dtests=tomcat"/>
+ <echo message="-Dtests=local will only run the tests on your locally installed servlet containers"/>
<antcall target="package-tests"/>
@@ -23,12 +24,14 @@
</target>
<target name="tests.call.all" unless="tests">
+ <antcall target="__evaluate_properties.all"/>
<antcall target="tests.jboss"/>
<antcall target="tests.tomcat"/>
<!-- <antcall target="tests.jetty"/> -->
</target>
<target name="tests.call.single" if="tests">
+ <antcall target="__evaluate_properties.${tests}"/>
<antcall target="tests.${tests}"/>
</target>
@@ -188,8 +191,8 @@
</target>
- <!--Lets make the check in one place so the build fail in the beggining instead of end-->
- <target name="evaluate_properties">
+ <!-- Check which servlet containers are known -->
+ <target name="__evaluate_properties.init">
<property environment="env"/>
@@ -218,14 +221,22 @@
</not>
</and>
</condition>
-<!-- <condition property="JBOSS_5_0_HOME" value="${env.JBOSS_5_0_HOME}">
+ <condition property="JBOSS_4_2_3_HOME" value="${env.JBOSS_4_2_3_HOME}">
<and>
+ <isset property="env.JBOSS_4_2_3_HOME"/>
+ <not>
+ <isset property="JBOSS_4_2_3_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="JBOSS_5_0_HOME" value="${env.JBOSS_5_0_HOME}">
+ <and>
<isset property="env.JBOSS_5_0_HOME"/>
<not>
<isset property="JBOSS_5_0_HOME"/>
</not>
</and>
- </condition> -->
+ </condition>
<condition property="TOMCAT_6_0_HOME" value="${env.TOMCAT_6_0_HOME}">
<and>
<isset property="env.TOMCAT_6_0_HOME"/>
@@ -234,63 +245,88 @@
</not>
</and>
</condition>
-<!-- <condition property="JETTY_6_1_HOME" value="${env.JETTY_6_1_HOME}">
+ <condition property="JETTY_6_1_HOME" value="${env.JETTY_6_1_HOME}">
<and>
<isset property="env.JETTY_6_1_HOME"/>
<not>
<isset property="JETTY_6_1_HOME"/>
</not>
</and>
- </condition> -->
+ </condition>
- <fail message="Please set the environment variable JBOSS_4_2_0_HOME, JBOSS_4_2_1_HOME or JBOSS_4_2_2_HOME">
+ <echo message="JBOSS_4_2_0_HOME: ${JBOSS_4_2_0_HOME}"/>
+ <echo message="JBOSS_4_2_1_HOME: ${JBOSS_4_2_1_HOME}"/>
+ <echo message="JBOSS_4_2_2_HOME: ${JBOSS_4_2_2_HOME}"/>
+ <echo message="JBOSS_4_2_3_HOME: ${JBOSS_4_2_3_HOME}"/>
+ <echo message="JBOSS_5_0_HOME: ${JBOSS_5_0_HOME}"/>
+ <echo message="TOMCAT_6_0_HOME: ${TOMCAT_6_0_HOME}"/>
+ <echo message="JETTY_6_1_HOME: ${JETTY_6_1_HOME}"/>
+ </target>
+
+ <target name="__evaluate_properties.tomcat">
+ <fail message="Please set the environment variable TOMCAT_6_0_HOME">
<condition>
<and>
<not>
- <isset property="JBOSS_4_2_0_HOME"/>
+ <isset property="TOMCAT_6_0_HOME"/>
</not>
- <not>
- <isset property="JBOSS_4_2_1_HOME"/>
- </not>
- <not>
- <isset property="JBOSS_4_2_2_HOME"/>
- </not>
</and>
</condition>
</fail>
+ </target>
-<!-- <fail message="Please set the environment variable JBOSS_5_0_HOME">
+ <target name="__evaluate_properties.jetty">
+ <fail message="Please set the environment variable JETTY_6_1_HOME">
<condition>
<and>
<not>
- <isset property="JBOSS_5_0_HOME"/>
+ <isset property="JETTY_6_1_HOME"/>
</not>
</and>
</condition>
- </fail> -->
+ </fail>
+ </target>
- <fail message="Please set the environment variable TOMCAT_6_0_HOME">
+ <target name="__evaluate_properties.jboss">
+ <fail message="Please set the environment variables JBOSS_4_2_0_HOME, JBOSS_4_2_1_HOME, JBOSS_4_2_2_HOME and JBOSS_4_2_3_HOME">
<condition>
<and>
<not>
- <isset property="TOMCAT_6_0_HOME"/>
+ <isset property="JBOSS_4_2_0_HOME"/>
</not>
+ <not>
+ <isset property="JBOSS_4_2_1_HOME"/>
+ </not>
+ <not>
+ <isset property="JBOSS_4_2_2_HOME"/>
+ </not>
+ <not>
+ <isset property="JBOSS_4_2_3_HOME"/>
+ </not>
</and>
</condition>
</fail>
-
-<!-- <fail message="Please set the environment variable JETTY_6_1_HOME">
+ <!--<fail message="Please set the environment variable JBOSS_5_0_HOME">
<condition>
<and>
<not>
- <isset property="JETTY_6_1_HOME"/>
+ <isset property="JBOSS_5_0_HOME"/>
</not>
</and>
</condition>
- </fail> -->
+ </fail>-->
+ </target>
+ <target name="__evaluate_properties.local">
+ <!-- empty on purpose! -->
</target>
+ <target name="__evaluate_properties.all">
+ <antcall target="__evaluate_properties.jboss"/>
+ <antcall target="__evaluate_properties.jetty"/>
+ <antcall target="__evaluate_properties.tomcat"/>
+ </target>
+
<macrodef name="package-misc-test">
<attribute name="test"/>
<sequential>
@@ -542,7 +578,7 @@
</target>
- <target name="cargo.setup">
+ <target name="__cargo.setup">
<property name="cargo.log.dir" value="${target}/test/cargo"/>
<mkdir dir="${cargo.log.dir}"/>
<taskdef resource="cargo.tasks">
@@ -552,7 +588,7 @@
</taskdef>
</target>
- <target name="cargo.jboss-4.2.start" depends="cargo.setup">
+ <target name="__cargo.jboss-4.2.start" depends="__cargo.setup">
<!-- The lib portal-test-lib.jar must be loaded at the shared level rather than in the war file
otherwise it is somehow inspected and produce a NoClassDefFoundError in the web service integration
layer on the class org/jboss/portal/test/framework/driver/remote/RemoteTestDriver for some unknown
@@ -583,7 +619,7 @@
</cargo>
</target>
- <target name="cargo.jboss-4.2.stop" depends="cargo.setup">
+ <target name="__cargo.jboss-4.2.stop" depends="__cargo.setup">
<cargo
containerId="jboss42x"
home="${test.jboss-4.2.home}"
@@ -596,50 +632,56 @@
</cargo>
</target>
- <target name="tests.jboss-4.2.container-servlet" if="${test.jboss-4.2.home.variable-name}">
+ <target name="__tests.jboss-4.2.container-servlet" if="${test.jboss-4.2.home.variable-name}">
<echo message="Starting JBoss 4.2 container-servlet tests with ${test.jboss-4.2.home}"/>
- <antcall target="cargo.jboss-4.2.start">
+ <antcall target="__cargo.jboss-4.2.start">
<param name="cargo.wait" value="false"/>
<param name="test.spi.server.path" value="${test.archive.path}"/>
</antcall>
- <antcall target="tests.remote">
+ <antcall target="__tests.remote">
<param name="test.server.name" value="${test.jboss-4.2.name}"/>
<param name="test.deploy.name" value="jboss-4.2-container-servlet"/>
</antcall>
- <antcall target="cargo.jboss-4.2.stop">
+ <antcall target="__cargo.jboss-4.2.stop">
</antcall>
</target>
- <target name="tests.jboss-4.2.generic" if="${test.jboss-4.2.home.variable-name}">
+ <target name="__tests.jboss-4.2.generic" if="${test.jboss-4.2.home.variable-name}">
<echo message="Starting JBoss 4.2 generic tests with ${test.jboss-4.2.home}"/>
- <antcall target="cargo.jboss-4.2.start">
+ <antcall target="__cargo.jboss-4.2.start">
<param name="cargo.wait" value="false"/>
<param name="test.spi.server.path" value="${test.archive.path}"/>
</antcall>
- <antcall target="tests.remote">
+ <antcall target="__tests.remote">
<param name="test.server.name" value="${test.jboss-4.2.name}"/>
<param name="test.deploy.name" value="jboss-4.2-generic"/>
</antcall>
- <antcall target="cargo.jboss-4.2.stop">
+ <antcall target="__cargo.jboss-4.2.stop">
</antcall>
</target>
- <target name="tests.jboss-4.2">
- <antcall target="tests.jboss-4.2.container-servlet">
+ <target name="__tests.jboss-4.2.0" if="JBOSS_4_2_0_HOME">
+ <antcall target="__tests.jboss-4.2.container-servlet">
<param name="test.id" value="JBoss-4_2_0-container-servlet"/>
<param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_0"/>
<param name="test.jboss-4.2.home" value="${JBOSS_4_2_0_HOME}"/>
<param name="test.jboss-4.2.home.variable-name" value="JBOSS_4_2_0_HOME"/>
<param name="test.jboss-4.2.tempdir" value="${target}/cargo-tmp/4_2_0"/>
</antcall>
- <antcall target="tests.jboss-4.2.container-servlet">
+ </target>
+
+ <target name="__tests.jboss-4.2.1" if="JBOSS_4_2_1_HOME">
+ <antcall target="__tests.jboss-4.2.container-servlet">
<param name="test.id" value="JBoss-4_2_1-container-servlet"/>
<param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_1"/>
<param name="test.jboss-4.2.home" value="${JBOSS_4_2_1_HOME}"/>
<param name="test.jboss-4.2.home.variable-name" value="JBOSS_4_2_1_HOME"/>
<param name="test.jboss-4.2.tempdir" value="${target}/cargo-tmp/4_2_1"/>
</antcall>
- <antcall target="tests.jboss-4.2.container-servlet">
+ </target>
+
+ <target name="__tests.jboss-4.2.2" if="JBOSS_4_2_2_HOME">
+ <antcall target="__tests.jboss-4.2.container-servlet">
<param name="test.id" value="JBoss-4_2_2-container-servlet"/>
<param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_2"/>
<param name="test.jboss-4.2.home" value="${JBOSS_4_2_2_HOME}"/>
@@ -648,7 +690,24 @@
</antcall>
</target>
- <target name="cargo.jboss-5.0.start" depends="cargo.setup">
+ <target name="__tests.jboss-4.2.3" if="JBOSS_4_2_3_HOME">
+ <antcall target="__tests.jboss-4.2.container-servlet">
+ <param name="test.id" value="JBoss-4_2_3-container-servlet"/>
+ <param name="test.jboss-4.2.name" value="RemoteJBoss_4_2_3"/>
+ <param name="test.jboss-4.2.home" value="${JBOSS_4_2_3_HOME}"/>
+ <param name="test.jboss-4.2.home.variable-name" value="JBOSS_4_2_3_HOME"/>
+ <param name="test.jboss-4.2.tempdir" value="${target}/cargo-tmp/4_2_3"/>
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-4.2">
+ <antcall target="__tests.jboss-4.2.0"/>
+ <antcall target="__tests.jboss-4.2.1"/>
+ <antcall target="__tests.jboss-4.2.2"/>
+ <antcall target="__tests.jboss-4.2.3"/>
+ </target>
+
+ <target name="__cargo.jboss-5.0.start" depends="__cargo.setup">
<!-- The lib portal-test-lib.jar must be loaded at the shared level rather than in the war file
otherwise it is somehow inspected and produce a NoClassDefFoundError in the web service integration
layer on the class org/jboss/portal/test/framework/driver/remote/RemoteTestDriver for some unknown
@@ -682,7 +741,7 @@
</cargo>
</target>
- <target name="cargo.jboss-5.0.stop" depends="cargo.setup">
+ <target name="__cargo.jboss-5.0.stop" depends="__cargo.setup">
<cargo
containerId="jboss5x"
home="${test.jboss-5.0.home}"
@@ -697,33 +756,33 @@
<target name="tests.jboss-5.0.container-servlet" if="${test.jboss-5.0.home.variable-name}">
<echo message="Starting JBoss 5.0 container-servlet tests with ${test.jboss-5.0.home}"/>
- <antcall target="cargo.jboss-5.0.start">
+ <antcall target="__cargo.jboss-5.0.start">
<param name="cargo.wait" value="false"/>
<param name="test.spi.server.path" value="${test.archive.path}"/>
</antcall>
- <antcall target="tests.remote">
+ <antcall target="__tests.remote">
<param name="test.server.name" value="${test.jboss-5.0.name}"/>
<param name="test.deploy.name" value="jboss-5.0-container-servlet"/>
</antcall>
- <antcall target="cargo.jboss-5.0.stop">
+ <antcall target="__cargo.jboss-5.0.stop">
</antcall>
</target>
<target name="tests.jboss-5.0.generic" if="${test.jboss-5.0.home.variable-name}">
<echo message="Starting JBoss 5.0 generic tests with ${test.jboss-5.0.home}"/>
- <antcall target="cargo.jboss-5.0.start">
+ <antcall target="__cargo.jboss-5.0.start">
<param name="cargo.wait" value="false"/>
<param name="test.spi.server.path" value="${test.archive.path}"/>
</antcall>
- <antcall target="tests.remote">
+ <antcall target="__tests.remote">
<param name="test.server.name" value="${test.jboss-5.0.name}"/>
<param name="test.deploy.name" value="jboss-5.0-generic"/>
</antcall>
- <antcall target="cargo.jboss-5.0.stop">
+ <antcall target="__cargo.jboss-5.0.stop">
</antcall>
</target>
- <target name="tests.jboss-5.0">
+ <target name="tests.jboss-5.0" if="JBOSS_5_0_HOME">
<antcall target="tests.jboss-5.0.container-servlet">
<param name="test.id" value="JBoss-5_0-container-servlet"/>
<param name="test.jboss-5.0.name" value="RemoteJBoss_5_0"/>
@@ -738,8 +797,14 @@
<!-- <antcall target="tests.jboss-5.0"/> -->
</target>
- <target name="cargo.tomcat-6.start" depends="cargo.setup">
+ <target name="tests.local">
+ <antcall target="tests.jboss"/>
+ <antcall target="tests.jetty"/>
+ <antcall target="tests.tomcat"/>
+ </target>
+ <target name="__cargo.tomcat-6.start" depends="__cargo.setup">
+
<taskdef resource="cargo.tasks">
<classpath>
<pathelement path="${plugin_classpath}"/>
@@ -768,7 +833,7 @@
</cargo>
</target>
- <target name="cargo.tomcat-6.stop" depends="cargo.setup">
+ <target name="__cargo.tomcat-6.stop" depends="__cargo.setup">
<cargo
containerId="tomcat6x"
home="${test.tomcat-6.home}"
@@ -778,19 +843,19 @@
</cargo>
</target>
- <target name="tests.tomcat-6.container-servlet" if="${test.tomcat-6.home.variable-name}">
+ <target name="__tests.tomcat-6.container-servlet" if="${test.tomcat-6.home.variable-name}">
<echo message="Starting Tomcat 6 container-servlet tests with ${test.tomcat-6.home}"/>
- <antcall target="cargo.tomcat-6.start">
+ <antcall target="__cargo.tomcat-6.start">
<param name="cargo.wait" value="false"/>
</antcall>
- <antcall target="tests.remote">
+ <antcall target="__tests.remote">
<param name="test.server.name" value="RemoteTomcat_6_0"/>
</antcall>
- <antcall target="cargo.tomcat-6.stop"/>
+ <antcall target="__cargo.tomcat-6.stop"/>
</target>
<target name="tests.tomcat-6">
- <antcall target="tests.tomcat-6.container-servlet">
+ <antcall target="__tests.tomcat-6.container-servlet">
<param name="test.id" value="Tomcat-6_0-container-servlet"/>
<param name="test.tomcat-6.name" value="RemoteTomcat_6_0"/>
<param name="test.tomcat-6.home" value="${TOMCAT_6_0_HOME}"/>
@@ -802,7 +867,7 @@
<antcall target="tests.tomcat-6"/>
</target>
- <target name="cargo.jetty-6.start" depends="cargo.setup">
+ <target name="__cargo.jetty-6.start" depends="__cargo.setup">
<taskdef resource="cargo.tasks">
<classpath>
@@ -834,7 +899,7 @@
</cargo>
</target>
- <target name="cargo.jetty-6.stop" depends="cargo.setup">
+ <target name="__cargo.jetty-6.stop" depends="__cargo.setup">
<cargo
containerId="jetty6x"
home="${test.jetty-6.home}"
@@ -846,13 +911,13 @@
<target name="tests.jetty-6.container-servlet" if="${test.jetty-6.home.variable-name}">
<echo message="Starting Jetty 6 container-servlet tests with ${test.jetty-6.home}"/>
- <antcall target="cargo.jetty-6.start">
+ <antcall target="__cargo.jetty-6.start">
<param name="cargo.wait" value="false"/>
</antcall>
- <antcall target="tests.remote">
+ <antcall target="__tests.remote">
<param name="test.server.name" value="RemoteJetty_6_1"/>
</antcall>
- <antcall target="cargo.jetty-6.stop"/>
+ <antcall target="__cargo.jetty-6.stop"/>
</target>
<target name="tests.jetty-6">
@@ -868,7 +933,7 @@
<antcall target="tests.jetty-6"/>
</target>
- <target name="tests.remote">
+ <target name="__tests.remote">
<taskdef name="jboss-unit" classname="org.jboss.unit.tooling.ant.JBossUnitTask" classpath="${plugin_classpath}"/>
Modified: modules/portlet/trunk/test/src/test/resources/test/servers.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/test/servers.xml 2009-01-13 15:25:44 UTC (rev 12488)
+++ modules/portlet/trunk/test/src/test/resources/test/servers.xml 2009-01-13 18:07:42 UTC (rev 12489)
@@ -97,7 +97,25 @@
</deployer>
</node>
</server>
- <server>
+ <server>
+ <server-name>RemoteJBoss_4_2_3</server-name>
+ <node>
+ <node-id>default</node-id>
+ <service>
+ <service-name>TestDriverServer</service-name>
+ <interface>org.jboss.unit.remote.driver.RemoteTestDriver</interface>
+ <uri>socket://localhost:5400</uri>
+ </service>
+ <deployer>
+ <remote>
+ <name>jboss4x</name>
+ <host>localhost</host>
+ <port>8080</port>
+ </remote>
+ </deployer>
+ </node>
+ </server>
+ <server>
<server-name>RemoteJBoss_5_0</server-name>
<node>
<node-id>default</node-id>
17 years, 3 months
JBoss Portal SVN: r12488 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-01-13 10:25:44 -0500 (Tue, 13 Jan 2009)
New Revision: 12488
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
Log:
configure dashboard tweak
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-01-13 14:48:33 UTC (rev 12487)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-01-13 15:25:44 UTC (rev 12488)
@@ -11,6 +11,11 @@
@Test(groups = { "cms_dashboard" }, enabled = true, description = "Dashboard issues test case.")
public class DashboardTestCase extends JBossPortalSeleniumTestCase {
+ private static final String SUB_PAGE_RENAME = "//form[contains(@id,'renameForm')]/input[@type='submit']";
+ private static final String INP_PAGE_RENAME = "//input[contains(@id,'renameForm:newName')]";
+ private static final String LINK_WEATHER_PORTLET = "link=*WeatherPortlet*";
+ private static final String LINK_PORTL2 = "link=*Who's online portlet*";
+ private static final String LINK_PORTL1 = "link=*Welcome portlet*";
private static final String SEL_CONTENT_TYPE = "//select[contains(@id,'contentTypesForm:instanceId')]";
private static final String SUB_DEL_FROM_CENTER_REGION = "//input[contains(@id,'layoutForm:l_center')]";
private static final String SUB_DOWN_CENTER_REGION = "//input[contains(@id,'layoutForm:d_center')]";
@@ -39,31 +44,72 @@
}
+ private void wait(int t){
+ try {
+ Thread.sleep(t);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
@Test(enabled = true)
public void testCreatePage() {
- //selenium.setSpeed("0");
- selenium.setSpeed("6000");
selenium.click(LNK_DASHBOARD);
//selenium.waitForPageToLoad(PAGE_LOAD);
+ wait(5000);
+ selenium.click(LNK_CONFIGURE_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ final String pageName = "DashTestPage";
+ selenium.type(INP_PAGENAME, pageName);
+ clickAndWait(SUB_CREATEPAGE);
+ selenium.click(LNK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isElementPresent("link="+pageName));
+ selenium.click("link="+pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
+ }
+
+ @Test(enabled = true, dependsOnMethods = { "testCreatePage" })
+ public void testRenamePage() {
+
+ // firstly create page
+
+ selenium.click(LNK_DASHBOARD);
+ wait(5000);
+
selenium.click(LNK_CONFIGURE_DASHBOARD);
-
- selenium.setSpeed("0");
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INP_PAGENAME, "DashTestPage");
+ final String pageName = "DashToRenamePage";
+ final String pageNameNew = "DashRenamedPage";
+ selenium.type(INP_PAGENAME, pageName);
clickAndWait(SUB_CREATEPAGE);
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isElementPresent("link=DashTestPage"));
- selenium.click("link=DashTestPage");
+ Assert.assertTrue(selenium.isElementPresent("link="+pageName));
+ selenium.click("link="+pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
+
+ // then rename it
+ selenium.click(LNK_CONFIGURE_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selectIfNotSelected(SEL_PAGE,pageName);
+
+ selenium.type(INP_PAGE_RENAME, pageNameNew);
+ selenium.click(SUB_PAGE_RENAME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
}
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
@@ -73,12 +119,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
//selenium.waitForPageToLoad(PAGE_LOAD);
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ wait(5000);
selectIfNotSelected(SEL_PAGE,"DashTestPage");
@@ -104,12 +145,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
//selenium.waitForPageToLoad(PAGE_LOAD);
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ wait(5000);
selenium.windowMaximize();
selectIfNotSelected(SEL_PAGE,"DashTestPage");
@@ -137,14 +173,9 @@
selenium.click(LNK_CONFIGURE_DASHBOARD);
//selenium.waitForPageToLoad(PAGE_LOAD);
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ wait(5000);
selectIfNotSelected(SEL_PAGE,"DashTestPage");
- selenium.click("link=Who's online portlet");
+ selenium.click(LINK_PORTL2);
selenium.waitForPageToLoad(PAGE_LOAD);
waitForElement("portlet-editor-title");
selenium.click(SUB_ADDCENTER);
@@ -170,12 +201,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
//selenium.waitForPageToLoad(PAGE_LOAD);
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ wait(5000);
selenium.type(INP_PAGENAME, pageName);
selenium.click(SUB_CREATEPAGE);
@@ -187,13 +213,13 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selectIfNotSelected(SEL_PAGE,pageName);
- selenium.click("link=ExceptionPortletInstance");
+ selenium.click(LINK_PORTL1);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
selectIfNotSelected(SEL_PAGE,pageName);
- selenium.click("link=Who's online portlet");
+ selenium.click(LINK_PORTL2);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -203,8 +229,8 @@
selenium.click("link="+pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(assertTextOrder("Current;Exception"));
- Assert.assertTrue(assertTextOrder("Exception;Current"));
+ Assert.assertFalse(assertTextOrder("Current;JSP"));
+ Assert.assertTrue(assertTextOrder("JSP;Current"));
}
@@ -216,12 +242,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
//selenium.waitForPageToLoad(PAGE_LOAD);
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ wait(5000);
selectIfNotSelected(SEL_PAGE,pageName);
selenium.addSelection(SEL_CENTER_REGION, "label=ExceptionPortletWindow");
@@ -244,12 +265,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
//selenium.waitForPageToLoad(PAGE_LOAD);
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ wait(5000);
selectIfNotSelected(SEL_PAGE,"DashTestPage");
@@ -273,12 +289,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
//selenium.waitForPageToLoad(PAGE_LOAD);
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ wait(5000);
selectIfNotSelected(SEL_PAGE,"DashTestPage");
selenium.select(SEL_CONTENT_TYPE, "label=widget/google");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -308,12 +319,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
//selenium.waitForPageToLoad(PAGE_LOAD);
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ wait(5000);
selenium.type(INP_PAGENAME, pageName);
selenium.click(SUB_CREATEPAGE);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -336,7 +342,7 @@
selectIfNotSelected(SEL_PAGE,pageName);
- selenium.click("Link=*Weather Portlet*");
+ selenium.click(LINK_WEATHER_PORTLET);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_ADDLEFT);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -362,17 +368,12 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
//selenium.waitForPageToLoad(PAGE_LOAD);
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ wait(5000);
selectIfNotSelected(SEL_PAGE,pageName);
- selenium.type("renameForm:newName", pageNameNew);
- selenium.click("renameForm:rename-button");
+ selenium.type(INP_PAGE_RENAME, pageNameNew);
+ selenium.click(SUB_PAGE_RENAME);
selenium.waitForPageToLoad(PAGE_LOAD);
// check the portlet again
17 years, 3 months
JBoss Portal SVN: r12487 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-01-13 09:48:33 -0500 (Tue, 13 Jan 2009)
New Revision: 12487
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
Log:
portal admin tweak
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2009-01-13 13:57:31 UTC (rev 12486)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2009-01-13 14:48:33 UTC (rev 12487)
@@ -68,15 +68,16 @@
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
- Assert.assertFalse(selenium.isTextPresent("TestPortal"), "Not created page already exist.");
+ final String portalName = "TestPortal";
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
- selenium.type(INPUT_PORTALNAME, "TestPortal");
+ selenium.type(INPUT_PORTALNAME, portalName);
selenium.click(INPUT_SUBMIT_CREATEPORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("TestPortal"));
+ Assert.assertTrue(selenium.isTextPresent(portalName));
- int r = findTableRow(TABLE_PORTAL_ADMIN, "TestPortal", 0) - 1;
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_MAIN, r)));
Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_SECURITY, r)));
@@ -88,47 +89,84 @@
@Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
public void testPortalRename() {
+ // first create a portal
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
+
+ final String portalName = "TestRenPortal";
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
- Assert.assertTrue(selenium.isTextPresent("TestPortal"));
- Assert.assertFalse(selenium.isTextPresent("AestPortal"), "Not created page already exist.");
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // then rename it
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- int r = findTableRow(TABLE_PORTAL_ADMIN, "TestPortal", 0) - 1;
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ final String portalToRename = "TestRenPortal";
+ Assert.assertTrue(selenium.isTextPresent(portalToRename));
+ final String portalRenamed = "AestPortal";
+ Assert.assertFalse(selenium.isTextPresent(portalRenamed), "Not created page already exist.");
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalToRename, 0) - 1;
+
selenium.click(MessageFormat.format(POR_TL_RENAME, r));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INPUT_RENAME_PORTAL, "AestPortal");
+ selenium.type(INPUT_RENAME_PORTAL, portalRenamed);
selenium.click(SUBMIT_RENAME_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isTextPresent("TestPortal"));
- Assert.assertTrue(selenium.isTextPresent("AestPortal"));
+ Assert.assertFalse(selenium.isTextPresent(portalToRename));
+ Assert.assertTrue(selenium.isTextPresent(portalRenamed));
}
@Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
public void testPortalDelete() {
+ // first create a portal
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
+
+ final String portalName = "TestDelete";
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
- selenium.type(INPUT_PORTALNAME, "TestDelete");
+ selenium.type(INPUT_PORTALNAME, portalName);
selenium.click(INPUT_SUBMIT_CREATEPORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // then delete it
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("TestDelete"));
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
- int r = findTableRow(TABLE_PORTAL_ADMIN, "TestDelete", 0) - 1;
+ final String portalToDelete = "TestDelete";
+ selenium.type(INPUT_PORTALNAME, portalToDelete);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(portalToDelete));
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalToDelete, 0) - 1;
+
selenium.click(MessageFormat.format(POR_TL_DELETE, r));
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("WARNING! You are about to delete the TestDelete portal from the context!"));
+ Assert.assertTrue(selenium.isTextPresent("WARNING! You are about to delete the "+portalToDelete+" portal from the context!"));
Assert.assertTrue(selenium.isTextPresent("Delete portal"));
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this portal?"));
selenium.click(SUBMIT_DELETE_PORTAL_CONF);
@@ -137,22 +175,23 @@
clickIfVisible("link=Admin");
clickIfVisible(TAB_PORTALOBJ_ID);
- Assert.assertFalse(selenium.isTextPresent("TestDelete"));
+ Assert.assertFalse(selenium.isTextPresent(portalToDelete));
}
- @Test(enabled = true)
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
public void testAddPage() {
+ final String portalName = "TestAddPagePortal";
+ final String portalPage = "tToAddPage";
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
- final String portalName = "TestAddPortal";
- final String portalPage = "tPage";
-
+
selenium.type(INPUT_PORTALNAME, portalName);
selenium.click(INPUT_SUBMIT_CREATEPORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -171,17 +210,21 @@
Assert.assertTrue(selenium.isTextPresent(portalPage));
}
- @Test(enabled = true, dependsOnMethods = { "testAddPage" })
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate","testAddPage" })
public void testRemovePage() {
+
+ final String portalName = "TestRemovePagePortal";
+ final String portalPage = "tRemPage";
- final String portalName = "TestAddPortal";
- final String portalPage = "tPage";
-
+ createPortal(portalName);
+ createPage(portalName, portalPage);
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
@@ -199,7 +242,7 @@
}
- @Test(enabled = true)
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate", "testAddPage" })
public void testCreateWindow() {
final String portalName = "toAddWindowPortal";
@@ -250,7 +293,7 @@
}
- @Test(enabled = true, dependsOnMethods={"testPortalCreate"})
+ @Test(enabled = true, dependsOnMethods={"testPortalCreate", "testAddPage"})
public void testPageRename(){
String portalName = "TestPortal";
String pageName = "PageToRename";
17 years, 3 months