Author: vrockai
Date: 2009-03-31 11:58:16 -0400 (Tue, 31 Mar 2009)
New Revision: 13103
Added:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/run.sh
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesFullTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardPerfTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalAjaxSamplesTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSelenium.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSeleniumTestListener.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/testng.xml
Log:
selenium - newest version of tests
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml 2009-03-30
13:02:10 UTC (rev 13102)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml 2009-03-31
15:58:16 UTC (rev 13103)
@@ -1,175 +1,225 @@
+
<project name="Tests" default="compile" basedir="."
xmlns:server="http://jboss.org/ns/test/ant/server">
- <property environment="env" />
+ <property environment="env" />
- <property name="workspace" location="build.xml" />
- <property name="java.home" location="${env.JAVA_HOME}" />
+ <property name="workspace" location="build.xml" />
+ <property name="java.home" location="${env.JAVA_HOME}" />
- <property name="suitename" location="testng-files" />
- <property name="testname" location="testng-files" />
+ <property name="suitename" location="testng-files" />
+ <property name="testname" location="testng-files" />
- <property name="testng.dir" location="testng-files" />
- <property name="testng.output.dir" location="test-output" />
- <property name="test.build.dir" location="output/classes" />
- <property name="test.src.dir" location="src" />
- <property name="lib.dir" location="lib" />
- <property name="hudson.lib.dir" location="/qa/tools/opt/" />
- <property name="jboss-test.jar"
location="${hudson.lib.dir}/jboss-test.jar" />
- <available file="${jboss-test.jar}"
property="jboss-test.jar.present" />
- <property name="junit.report.dir" location="test-report" />
+ <property name="testng.dir" location="testng-files" />
+ <property name="testng.output.dir" location="test-output"
/>
+ <property name="testng.debug.dir" location="debug" />
+ <property name="test.build.dir" location="output/classes"
/>
+ <property name="test.src.dir" location="src" />
+ <property name="lib.dir" location="lib" />
+ <property name="hudson.lib.dir" location="/qa/tools/opt/"
/>
+ <property name="jboss-test.jar"
location="${hudson.lib.dir}/jboss-test.jar" />
+ <available file="${jboss-test.jar}"
property="jboss-test.jar.present" />
+ <property name="junit.report.dir" location="test-report"
/>
- <property name="selsrv.dir" location="selenium-rc-server" />
- <property name="node0" value="localhost" />
- <property name="jboss.test.home" value="${env.JBOSS_TEST_HOME}"
/>
- <property name="jboss.home" value="${env.JBOSS_HOME}" />
- <property name="jboss.test.jar"
value="../../tools/lib/jboss-test.jar" />
- <property name="jboss.portal.dir"
value="${env.JBOSS_UNZIPED_DIR}" />
- <property name="portal_archive" value="${env.JBOSS_ARCHIVE}"
/>
- <property name="portal.instance" value="default" />
+ <property name="selsrv.dir" location="selenium-rc-server"
/>
+ <property name="node0" value="localhost" />
+ <property name="jboss.test.home"
value="${env.JBOSS_TEST_HOME}" />
+ <property name="jboss.home" value="${env.JBOSS_HOME}" />
+ <property name="jboss.test.jar" value="lib/jboss-test.jar"
/>
+ <property name="jboss.portal.dir"
value="${env.JBOSS_UNZIPED_DIR}" />
+ <property name="portal_archive" value="${env.JBOSS_ARCHIVE}"
/>
+ <property name="portal.instance" value="default" />
- <path id="jboss.test.classpath">
- <pathelement path="${jboss.test.jar}" />
- </path>
+ <property name="test.suite" value="testng.xml" />
+ <property name="usecase.suite" value="end2end.xml" />
- <path id="libraries.cp">
- <fileset dir="${lib.dir}">
- <include name="*.jar" />
- </fileset>
+ <path id="jboss.test.classpath">
+ <pathelement path="${jboss.test.jar}" />
+ </path>
- </path>
+ <path id="libraries.cp">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar" />
+ </fileset>
- <path id="test.cp">
- <pathelement location="${test.build.dir}" />
- <path refid="libraries.cp" />
- </path>
+ </path>
- <taskdef name="testng" classpathref="libraries.cp"
classname="org.testng.TestNGAntTask" />
- <taskdef name="config"
classname="org.jboss.ant.taskdefs.server.ConfigManagerTask"
uri="http://jboss.org/ns/test/ant/server"
loaderref="server.loader">
- <classpath id="server.taskdef.classpath">
- <path refid="jboss.test.classpath" />
- </classpath>
- </taskdef>
- <taskdef name="start"
classname="org.jboss.ant.taskdefs.server.StartServerTask"
uri="http://jboss.org/ns/test/ant/server"
loaderref="server.loader">
- <classpath refid="server.taskdef.classpath" />
- </taskdef>
- <taskdef name="stop"
classname="org.jboss.ant.taskdefs.server.StopServerTask"
uri="http://jboss.org/ns/test/ant/server"
loaderref="server.loader">
- <classpath refid="server.taskdef.classpath" />
- </taskdef>
+ <path id="test.cp">
+ <pathelement location="${test.build.dir}" />
+ <path refid="libraries.cp" />
+ </path>
- <target name="init">
- <echo message="Browser : ${browser}" />
- <echo message="Screenshot : ${screenshot}" />
- <echo message="Deleting testng report directory" />
- <delete dir="${testng.output.dir}" />
- </target>
+ <taskdef name="testng" classpathref="libraries.cp"
classname="org.testng.TestNGAntTask" />
+ <taskdef name="config"
classname="org.jboss.ant.taskdefs.server.ConfigManagerTask"
uri="http://jboss.org/ns/test/ant/server"
loaderref="server.loader">
+ <classpath id="server.taskdef.classpath">
+ <path refid="jboss.test.classpath" />
+ </classpath>
+ </taskdef>
+ <taskdef name="start"
classname="org.jboss.ant.taskdefs.server.StartServerTask"
uri="http://jboss.org/ns/test/ant/server"
loaderref="server.loader">
+ <classpath refid="server.taskdef.classpath" />
+ </taskdef>
+ <taskdef name="stop"
classname="org.jboss.ant.taskdefs.server.StopServerTask"
uri="http://jboss.org/ns/test/ant/server"
loaderref="server.loader">
+ <classpath refid="server.taskdef.classpath" />
+ </taskdef>
+ <target name="init">
+ <echo message="Browser : ${browser}" />
+ <echo message="Screenshot : ${screenshot}" />
+ <echo message="Deleting testng report directory" />
+ <delete dir="${testng.output.dir}" />
+ <delete dir="${testng.debug.dir}" />
+ </target>
- <target name="compile" depends="">
- <echo message="Compiling testsuite" />
- <mkdir dir="${test.build.dir}" />
- <javac srcdir="${test.src.dir}" destdir="${test.build.dir}"
classpathref="libraries.cp" debug="on" />
- </target>
- <target name="run-src">
- <echo message="Starting Selenium Remote Control" />
- <java jar="${selsrv.dir}/selenium-server.jar" fork="true"
spawn="true">
- <arg value="-multiWindow" />
- <arg value="-port" />
- <arg value="44444" />
- <arg value="-log" />
- <arg value="selenium.log" />
- <arg value="-debug" />
- <arg value="-userExtensions" />
- <arg value="${selsrv.dir}/user-extensions.js" />
- </java>
- </target>
+ <target name="compile" depends="">
+ <echo message="Compiling testsuite" />
+ <mkdir dir="${test.build.dir}" />
+ <javac srcdir="${test.src.dir}"
destdir="${test.build.dir}" classpathref="libraries.cp"
debug="on" />
+ <copy
file="${test.src.dir}/org/jboss/portal/test/selenium/locator.properties"
todir="${test.build.dir}/org/jboss/portal/test/selenium/"/>
+ </target>
- <target name="stop-src">
- <get taskname="selenium-shutdown"
src="http://localhost:44444/selenium-server/driver/?cmd=shutDown"
dest="result.txt" ignoreerrors="true" />
- <echo taskname="selenium-shutdown" message="DGF Errors during
shutdown are expected" />
- </target>
+ <target name="run-src">
+ <echo message="Starting Selenium Remote Control" />
+ <java jar="${selsrv.dir}/selenium-server.jar" fork="true"
spawn="true">
+ <arg value="-multiWindow" />
+ <arg value="-port" />
+ <arg value="44444" />
+ <arg value="-log" />
+ <arg value="selenium.log" />
+ <arg value="-debug" />
+ <arg value="-userExtensions" />
+ <arg value="${selsrv.dir}/user-extensions.js" />
+ </java>
+ <sleep seconds="20" />
+ </target>
- <target name="copyApps">
- <echo message="Copying userInterceptor portlet into the ${portal.instance}
server" />
- <copy file="apps/userDetail-portlet.war"
tofile="${jboss.home}/server/${portal.instance}/deploy/userDetail-portlet.war"
/>
- </target>
+ <target name="stop-src">
+ <get taskname="selenium-shutdown"
src="http://localhost:44444/selenium-server/driver/?cmd=shutDown"
dest="result.txt" ignoreerrors="true" />
+ <echo taskname="selenium-shutdown" message="DGF Errors during
shutdown are expected" />
+ </target>
- <target name="clean">
- <echo message="Going to delete directory ${test.build.dir}" />
- <delete dir="${test.build.dir}" />
- </target>
+ <target name="copyApps">
+ <echo message="Copying userInterceptor portlet into the
${portal.instance} server" />
+ <copy file="apps/userDetail-portlet.war"
tofile="${jboss.home}/server/${portal.instance}/deploy/userDetail-portlet.war"
/>
+ </target>
- <server:config javaHome="${java.home}"
jbossHome="${jboss.home}">
- <server name="${portal.instance}" host="${node0}">
+ <target name="clean">
+ <echo message="Going to delete directory ${test.build.dir}" />
+ <delete dir="${test.build.dir}" />
+ </target>
+
+ <server:config javaHome="${java.home}"
jbossHome="${jboss.home}">
+ <server name="${portal.instance}" host="${node0}">
<!-- jvmarg value="${jpda.cmdline}" / -->
- <jvmarg value="-Xmx512m" />
- <jvmarg value="-XX:MaxPermSize=128m" />
- <sysproperty key="java.endorsed.dirs"
value="${jboss.home}/lib/endorsed" />
- </server>
- </server:config>
+ <jvmarg value="-Xmx512m" />
+ <jvmarg value="-XX:MaxPermSize=128m" />
+ <sysproperty key="java.endorsed.dirs"
value="${jboss.home}/lib/endorsed" />
+ </server>
+ </server:config>
- <target name="cleanup">
- <echo message="Cleaning up..." />
- <antcall target="stop-src" />
+ <target name="cleanup">
+ <echo message="Cleaning up..." />
+ <antcall target="stop-src" />
- </target>
+ </target>
- <target name="run-and-build" depends="init, compile,
run-src">
- <echo message="Starting portal instance : ${portal.instance}" />
- <server:start name="${portal.instance}" />
+ <target name="run-and-build" depends="init, compile,
run-src">
+ <echo message="Starting portal instance : ${portal.instance}" />
+ <server:start name="${portal.instance}" />
- <echo message="Runing TestNG" />
- <mkdir dir="test-output" />
- <testng classpathref="test.cp" sourcedir="${test.src.dir}"
outputdir="test-output"
listeners="org.testng.reporters.JUnitXMLReporter"
suitename="SeleniumSuite">
+ <echo message="Runing TestNG" />
+ <mkdir dir="test-output" />
+ <testng classpathref="test.cp" sourcedir="${test.src.dir}"
outputdir="test-output"
listeners="org.testng.reporters.JUnitXMLReporter"
suitename="SeleniumSuite">
- <xmlfileset dir="." includes="testng.xml" />
+ <xmlfileset dir="." includes="${testng.suite}" />
+ <sysproperty key="browser" value="${browser}" />
+ <sysproperty key="screenshot" value="${screenshot}"
/>
+ <sysproperty key="workspace" value="${workspace}"
/>
+ <sysproperty key="userCount" value="${userCount}"
/>
+ <sysproperty key="html-src" value="${html-src}" />
+ <sysproperty key="output-dir"
value="${testng.output.dir}" />
+ <jvmarg value="-ea" />
- <!--classfileset dir="${test.build.dir}"
- includes="org/jboss/portal/test/selenium/*Test.class" / -->
- <sysproperty key="browser" value="${browser}" />
- <sysproperty key="screenshot" value="${screenshot}" />
- <jvmarg value="-ea" />
+ </testng>
+ <echo message="Stoping portal instance : ${portal.instance}" />
+ <server:stop name="${portal.instance}" />
+ <antcall target="cleanup" />
+ </target>
- </testng>
- <echo message="Stoping portal instance : ${portal.instance}" />
- <server:stop name="${portal.instance}" />
- <antcall target="cleanup" />
- </target>
+ <target name="single-test" depends="init, compile, run-src,
copyApps">
+ <echo message="Runing TestNG" />
- <target name="single-test" depends="init, compile, run-src,
copyApps">
- <echo message="Runing TestNG" />
+ <mkdir dir="test-output" />
+ <mkdir dir="debug" />
+ <testng classpathref="test.cp" sourcedir="${test.src.dir}"
outputdir="${testng.output.dir}"
listeners="org.jboss.portal.test.selenium.JBossSeleniumTestListener"
suitename="SeleniumSingleTest" verbose="2">
- <mkdir dir="test-output" />
- <testng classpathref="test.cp" sourcedir="${test.src.dir}"
outputdir="${testng.output.dir}" suitename="SeleniumSingleTest">
+ <classfileset dir="${test.build.dir}"
includes="${testname}" />
+ <sysproperty key="browser" value="${browser}" />
+ <sysproperty key="screenshot" value="${screenshot}"
/>
+ <sysproperty key="debug" value="${debug}" />
+ <sysproperty key="workspace" value="${workspace}"
/>
+ <sysproperty key="userCount" value="${userCount}"
/>
+ <sysproperty key="html-src" value="${html-src}" />
+ <sysproperty key="output-dir"
value="${testng.output.dir}" />
+ <jvmarg value="-ea" />
+ </testng>
+ <antcall target="cleanup" />
- <classfileset dir="${test.build.dir}" includes="${testname}"
/>
- <sysproperty key="browser" value="${browser}" />
- <sysproperty key="screenshot" value="${screenshot}" />
- <sysproperty key="workspace" value="${workspace}" />
+ </target>
- <jvmarg value="-ea" />
- </testng>
+ <target name="selenium-test" depends="init, compile, run-src,
copyApps">
+ <echo message="Runing TestNG" />
- </target>
+ <mkdir dir="test-output" />
+ <mkdir dir="debug" />
+ <testng classpathref="test.cp" sourcedir="${test.src.dir}"
outputdir="${testng.output.dir}" suitename="SeleniumSuite">
- <target name="selenium-test" depends="init, compile, run-src,
copyApps">
- <echo message="Runing TestNG" />
+ <xmlfileset dir="." includes="${test.suite}" />
- <mkdir dir="test-output" />
- <testng classpathref="test.cp" sourcedir="${test.src.dir}"
outputdir="${testng.output.dir}" suitename="SeleniumSuite">
+ <sysproperty key="browser" value="${browser}" />
+ <sysproperty key="screenshot" value="${screenshot}"
/>
+ <sysproperty key="debug" value="${debug}" />
+ <sysproperty key="workspace" value="${workspace}"
/>
+ <sysproperty key="userCount" value="${userCount}"
/>
+ <sysproperty key="html-src" value="${html-src}" />
+ <sysproperty key="output-dir"
value="${testng.output.dir}" />
+
- <xmlfileset dir="." includes="testng.xml" />
+ <jvmarg value="-ea" />
- <sysproperty key="browser" value="${browser}" />
- <sysproperty key="screenshot" value="${screenshot}" />
- <sysproperty key="workspace" value="${workspace}" />
+ </testng>
+ <antcall target="cleanup" />
+ </target>
- <jvmarg value="-ea" />
+ <target name="selenium-usecase" depends="init, compile, run-src,
copyApps">
+ <echo message="Runing TestNG" />
- </testng>
- <antcall target="cleanup" />
- </target>
+ <mkdir dir="test-output" />
+ <mkdir dir="debug" />
+
+ <testng classpathref="test.cp" sourcedir="${test.src.dir}"
outputdir="${testng.output.dir}" suitename="SeleniumSuite">
+ <xmlfileset dir="." includes="${usecase.suite}" />
+
+ <sysproperty key="browser" value="${browser}" />
+ <sysproperty key="screenshot" value="${screenshot}"
/>
+ <sysproperty key="debug" value="${debug}" />
+ <sysproperty key="workspace" value="${workspace}"
/>
+ <sysproperty key="userCount" value="${userCount}"
/>
+ <sysproperty key="html-src" value="${html-src}" />
+ <sysproperty key="output-dir"
value="${testng.output.dir}" />
+ <jvmarg value="-ea" />
+
+ </testng>
+ <antcall target="cleanup" />
+ </target>
+
+ <target name="archive" >
+ <!--<touch file="touchme.txt"/>-->
+ <echo file="touchme.txt" message="pipik2"/>
+ <genkey alias="apache-group" storepass="secret"
dname="CN=Ant Group, OU=Jakarta Division,
O=Apache.org, C=US"/>
+ <echo message=""/>
+ </target>
+
</project>
Added: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/run.sh
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/run.sh
(rev 0)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/run.sh 2009-03-31 15:58:16
UTC (rev 13103)
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+export HELPMODE=0
+
+#if [ ! -n "${1+x}" ]; then
+ #export HELPMODE=1
+#elif [ $1 = "help" ]; then
+ #export HELPMODE=1
+#fi
+
+if [ -z "$1" -o "$1" = "help" ]; then
+ echo "Usage: "
+ echo " run.sh MODE FF_LOCATION [TESTCLASS_NAME]"
+ echo
+ echo "Description:"
+ echo " Command used to run selenium test of JBoss Portal. Enviroment variables
JBOSS_HOME, JAVA_HOME must be set before running the script. JBoss portal must run on the
same machine where the script is being run (\"http://localhost:8080/portal/\")
."
+ echo
+ echo "FF_LOCATION - the location of firefox binary file (not the firefox running
script - the binary is ussually located in \"/usr/lib*/firefox*/\" directory
)"
+ echo
+ echo "MODE - one of available modes:"
+ echo " help : prints out this helpscreen"
+ echo " test : runnnig the selenium test suite defined in testng.xml"
+ echo " end2end : runnnig the selenium test suite defined in testng.xml"
+ echo " selenium : run the selenium server only (no tests are executed)"
+ echo " single : run single selenium testcase of specified class (TESTCLASS_NAME
must be specified)"
+ echo
+ echo "TESTCLASS_NAME - the class specifiing single testcase (must be set when
running \"single\" mode)"
+ echo
+ echo "Examples:"
+ echo " running the testsuite:"
+ echo " run.sh test /home/vrockai/opt/firefox3/firefox-bin"
+ echo
+ echo " running single testcase:"
+ echo " run.sh single /home/vrockai/opt/firefox3/firefox-bin
org/jboss/portal/test/selenium/DashboardTestCase.class"
+else
+ if [ $1 != "help" ]; then
+ ant clean
+ echo "Action: $1"
+ echo "Firefox bin location: $2"
+ echo "Testclass name: $3"
+ fi
+
+ if [ $1 = "test" ]; then
+ if [ -z "$2" -o ! -f "$2" ]; then
+ echo
+ echo "ERROR: Firefox location not set";
+ exit 0;
+ fi
+ ant -f build.xml copyApps
+ ant -f build.xml selenium-test -Dbrowser="*firefox $2"
-Dworkspace="/home/vrockai/workspace/ui-tests/" -Dscreenshot="true"
-Dhtml-src="true" -Ddebug="true"
+ elif [ $1 = "end2end" ]; then
+ if [ -z "$2" -o ! -f "$2" ]; then
+ echo
+ echo "ERROR: Firefox location not set";
+ exit 0;
+ fi
+ ant -f build.xml copyApps
+ ant -f build.xml selenium-usecase -Dbrowser="*firefox $2"
-Dworkspace="/home/vrockai/workspace/ui-tests/" -Dscreenshot="true"
-Dhtml-src="true" -Ddebug="true"
+ elif [ $1 = "perf" ]; then
+ if [ -z "$2" -o ! -f "$2" ]; then
+ echo
+ echo "ERROR: Firefox location not set";
+ exit 0;
+ fi
+ ant -f build.xml copyApps
+ ant -f build.xml selenium-test -Dbrowser="*firefox $2"
-Dworkspace="/home/vrockai/workspace/ui-tests/" -Dscreenshot="true"
-Dhtml-src="true" -Ddebug="true"
+ elif [ $1 = "selenium" ]; then
+ ant -f build.xml run-src
+ elif [ $1 = "single" ]; then
+ if [ -z "$2" -o ! -f "$2" ]; then
+ echo
+ echo "ERROR: Firefox location not set";
+ exit 0;
+ fi
+ if [ -z "$3" ]; then
+ echo
+ echo "ERROR: Testclasss not set";
+ exit 0;
+ fi
+ ant -f build.xml single-test -Dbrowser="*firefox $2"
-Dtestname="$3" -Dscreenshot="true" -Dhtml-src="true"
-Ddebug="true"
+ fi
+fi
Property changes on: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/run.sh
___________________________________________________________________
Name: svn:executable
+ *
Added:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesFullTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesFullTestCase.java
(rev 0)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesFullTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -0,0 +1,1752 @@
+package org.jboss.portal.test.selenium;
+
+import java.text.MessageFormat;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
+
+@Test(groups = { "coordination_samples" }, enabled = true)
+public class CoordinationSamplesFullTestCase extends JBossPortalSeleniumTestCase {
+
+
+ // Parameter test-cases properties
+ private final String PAR_L1_SUB = "//input[@value='Update']";
+ private final String PAR_L2_SUB =
"//div[@id='regionA']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[5]/td/input";
+ private final String PAR_R1_SUB =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[5]/td/input";
+ private final String PAR_R2_SUB =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[5]/td/input";
+ private final String PAR_R3_SUB =
"//div[@id='regionB']/div[3]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td/input";
+
+ private final String PAR_R3_PVAL = "value";
+ private final String PAR_R3_PNAM = "name";
+ private final String PAR_R2_BAR2 =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[4]/td[2]/input";
+ private final String PAR_R2_BAR2_R =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[4]/td[2]/a";
+ private final String PAR_R2_DAA2 =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td[2]/input";
+ private final String PAR_R2_DAA2_R =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td[2]/a";
+ private final String PAR_R2_FOO2 =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/input";
+ private final String PAR_R2_FOO2_R =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a";
+ private final String PAR_R2_JUU2 =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input";
+ private final String PAR_R2_JUU2_R =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/a";
+ private final String PAR_R1_FOO1 =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[4]/td[2]/input";
+ private final String PAR_R1_FOO1_R =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[4]/td[2]/a";
+ private final String PAR_R1_JUU1 =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td[2]/input";
+ private final String PAR_R1_JUU1_R =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td[2]/a";
+ private final String PAR_R1_BAR1 =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/input";
+ private final String PAR_R1_BAR1_R =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a";
+ private final String PAR_R1_DAA1 =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input";
+ private final String PAR_R1_DAA1_R =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/a";
+ private final String PAR_L2_BAR2 = "bar2";
+ private final String PAR_L2_BAR2_R =
"//body/div[2]/div/div/div[2]/div/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[4]/td[2]/a";
+ private final String PAR_L2_DAA2 = "daa2";
+ private final String PAR_L2_DAA2_R =
"//body/div[2]/div/div/div[2]/div/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td[2]/a";
+ private final String PAR_L2_FOO2 = "foo2";
+ private final String PAR_L2_FOO2_R =
"//body/div[2]/div/div/div[2]/div/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a";
+ private final String PAR_L2_JUU2 = "juu2";
+ private final String PAR_L2_JUU2_R =
"//body/div[2]/div/div/div[2]/div/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr/td[2]/a";
+ private final String PAR_L1_FOO1 = "foo1";
+ private final String PAR_L1_FOO1_R =
"//body/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[4]/td[2]/a";
+ private final String PAR_L1_JUU1 = "juu1";
+ private final String PAR_L1_JUU1_R =
"//body/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td[2]/a";
+ private final String PAR_L1_BAR1 = "bar1";
+ private final String PAR_L1_BAR1_R =
"//body/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a";
+ private final String PAR_L1_DAA1 = "daa1";
+ private final String PAR_L1_DAA1_R =
"//body/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr/td[2]/a";
+
+ // Event test-cases properties
+
+ private final String EVT_L1_TAB =
"//body/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/table";
+ private final String EVT_L2_TAB =
"//body/div[2]/div/div/div[2]/div/div[2]/table/tbody/tr[2]/td[2]/div/table";
+ private final String EVT_L3_TAB =
"//body/div[2]/div/div/div[2]/div/div[3]/table/tbody/tr[2]/td[2]/div/table";
+ private final String EVT_R1_TAB =
"//body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table";
+ private final String EVT_R2_TAB =
"//body/div[2]/div/div/div[2]/div[2]/div[2]/table/tbody/tr[2]/td[2]/div/table";
+ private final String EVT_R3_TAB =
"//body/div[2]/div/div/div[2]/div[2]/div[3]/table/tbody/tr[2]/td[2]/div/table";
+
+ private final String EVT_L_LNK =
"//body/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/table/tbody/tr[{0}]/td[3]/a";
+ private final String EVT_R_LNK =
"//body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table/tbody/tr[{0}]/td[3]/a";
+
+ private final String EVT_L_C1 = "Tent";
+ private final String EVT_L_C2 = "Skateboard";
+ private final String EVT_L_C3 = "Sneakers";
+
+ private final String EVT_R_C1 = "Surfboard";
+ private final String EVT_R_C2 = "Bike";
+ private final String EVT_R_C3 = "Backpack";
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ selenium.open("/portal/portal/default/default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+
+ }
+
+ @Test(enabled = true)
+ public void defaultCoordinationTest() {
+ selenium.open("/portal/portal/default/Coordination+Samples");
+ selenium.click("link=Coordination Samples");
+ selenium.waitForPageToLoad("30000");
+ selenium.open("http://localhost:8080/portal/portal/default/Coordination+Samples?zip=78759");
+ selenium.waitForPageToLoad("30000");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):78759"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):78759"));
+
+ selenium.type("name", "xyz");
+ selenium.type("value", "123");
+ selenium.click("//input[@value='Update']");
+ selenium.waitForPageToLoad("30000");
+
+ Assert.assertTrue(selenium.getLocation().endsWith("/portal/portal/default/Coordination+Samples?xyz=123"));
+ }
+
+ @Test(enabled = true)
+ public void eventsExplicitTest() {
+ selenium.click("link=Events - Explicit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = -1;
+
+ r = findTableRow(EVT_L1_TAB, EVT_L_C1, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_L1_TAB, EVT_L_C2, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_L1_TAB, EVT_L_C3, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C3, 0) > 0);
+
+ Assert.assertFalse(selenium.isElementPresent(EVT_R2_TAB));
+ Assert.assertFalse(selenium.isElementPresent(EVT_R3_TAB));
+
+ r = findTableRow(EVT_R1_TAB, EVT_R_C1, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_R1_TAB, EVT_R_C2, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_R1_TAB, EVT_R_C3, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C3, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C3, 0) > 0);
+ }
+
+ @Test(enabled = true)
+ public void eventsFallbackTest() {
+ selenium.click("link=Events - Fallback");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = -1;
+
+ r = findTableRow(EVT_L1_TAB, EVT_L_C1, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_L1_TAB, EVT_L_C2, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_L1_TAB, EVT_L_C3, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C3, 0) > 0);
+
+ Assert.assertFalse(selenium.isElementPresent(EVT_R2_TAB));
+ Assert.assertFalse(selenium.isElementPresent(EVT_R3_TAB));
+
+ r = findTableRow(EVT_R1_TAB, EVT_R_C1, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_R1_TAB, EVT_R_C2, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_R1_TAB, EVT_R_C3, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C3, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C3, 0) > 0);
+ }
+
+ @Test(enabled = true)
+ public void eventsImplicitTest() {
+ selenium.click("link=Events - Implicit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = -1;
+
+ r = findTableRow(EVT_L1_TAB, EVT_L_C1, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_L1_TAB, EVT_L_C2, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_L1_TAB, EVT_L_C3, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C3, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_L_C3, 0) > 0);
+
+ r = findTableRow(EVT_R1_TAB, EVT_R_C1, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_R1_TAB, EVT_R_C2, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_R1_TAB, EVT_R_C3, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C3, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_L_C3, 0) > 0);
+ //--------------------------------------------------------//
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_R_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_R_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_R_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_R_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_R_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_R_C3, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C3, 0) > 0);
+ }
+
+ @Test(enabled = true)
+ public void parameterAliasTest() {
+ selenium.click("link=Parameters - Alias");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(PAR_L1_DAA1, "l1daa1");
+ selenium.type(PAR_L1_BAR1, "l1bar1");
+ selenium.type(PAR_L1_JUU1, "l1juu1");
+ selenium.type(PAR_L1_FOO1, "l1foo1");
+ selenium.click(PAR_L1_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "l1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "l1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "l1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "l1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_L2_JUU2, "l2juu2");
+ selenium.type(PAR_L2_FOO2, "l2foo2");
+ selenium.type(PAR_L2_DAA2, "l2daa2");
+ selenium.type(PAR_L2_BAR2, "l2bar2");
+ selenium.click(PAR_L2_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "l2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "l2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "l2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "l2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R1_DAA1, "r1daa1");
+ selenium.type(PAR_R1_BAR1, "r1bar1");
+ selenium.type(PAR_R1_JUU1, "r1juu1");
+ selenium.type(PAR_R1_FOO1, "r1foo1");
+ selenium.click(PAR_R1_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R2_JUU2, "r2juu2");
+ selenium.type(PAR_R2_FOO2, "r2foo2");
+ selenium.type(PAR_R2_DAA2, "r2daa2");
+ selenium.type(PAR_R2_BAR2, "r2bar2");
+ selenium.click(PAR_R2_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+ /*
+ selenium.type(PAR_R3_PNAM, "r3pnam");
+ selenium.type(PAR_R3_PVAL, "r3pval");
+ selenium.click(PAR_R3_SUB);
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ */
+
+ // deleting
+
+ selenium.click(PAR_L1_DAA1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L1_BAR1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L1_JUU1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L1_FOO1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L2_BAR2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_R1_DAA1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_R2_BAR2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R3_PNAM, "binding1");
+ selenium.type(PAR_R3_PVAL, "viliam");
+ selenium.click(PAR_R3_SUB);
+ selenium.waitForPageToLoad("30000");
+ Assert.assertTrue(selenium.getLocation().endsWith("portal/portal/default/Coordination+Samples/Parameters+-+Alias?binding1=viliam"));
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "viliam");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "viliam");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "viliam");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "viliam");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+ }
+
+ @Test(enabled = true)
+ public void parameterExplicitTest() {
+ selenium.click("link=Parameters - Explicit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(PAR_L1_DAA1, "l1daa1");
+ selenium.type(PAR_L1_BAR1, "l1bar1");
+ selenium.type(PAR_L1_JUU1, "l1juu1");
+ selenium.type(PAR_L1_FOO1, "l1foo1");
+ selenium.click(PAR_L1_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "l1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "l1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l1bar1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "l1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_L2_JUU2, "l2juu2");
+ selenium.type(PAR_L2_FOO2, "l2foo2");
+ selenium.type(PAR_L2_DAA2, "l2daa2");
+ selenium.type(PAR_L2_BAR2, "l2bar2");
+ selenium.click(PAR_L2_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "l2bar2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "l2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "l2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "l2bar2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "l2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "l2bar2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R1_DAA1, "r1daa1");
+ selenium.type(PAR_R1_BAR1, "r1bar1");
+ selenium.type(PAR_R1_JUU1, "r1juu1");
+ selenium.type(PAR_R1_FOO1, "r1foo1");
+ selenium.click(PAR_R1_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "r1daa1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R2_JUU2, "r2juu2");
+ selenium.type(PAR_R2_FOO2, "r2foo2");
+ selenium.type(PAR_R2_DAA2, "r2daa2");
+ selenium.type(PAR_R2_BAR2, "r2bar2");
+ selenium.click(PAR_R2_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "r2daa2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ /*
+ selenium.type(PAR_R3_PNAM, "r3pnam");
+ selenium.type(PAR_R3_PVAL, "r3pval");
+ selenium.click(PAR_R3_SUB);
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ */
+
+ // deleting
+
+ selenium.click(PAR_L1_DAA1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "r2daa2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L1_BAR1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L1_JUU1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L1_FOO1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L2_BAR2_R);
+ waitFor(AJAX_LOAD);
+
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.click(PAR_R1_BAR1_R);
+ waitFor(AJAX_LOAD);
+
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.click(PAR_R1_JUU1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.click(PAR_L2_JUU2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.click(PAR_L2_DAA2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.click(PAR_R2_JUU2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.click(PAR_R2_FOO2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R3_PNAM, "binding1");
+ selenium.type(PAR_R3_PVAL, "viliam");
+ selenium.click(PAR_R3_SUB);
+ selenium.waitForPageToLoad("30000");
+ Assert.assertTrue(selenium.getLocation().endsWith("?binding1=viliam"));
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "viliam");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "viliam");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "viliam");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+ }
+
+ @Test(enabled = true)
+ public void parameterExplicitAliasTest() {
+ selenium.click("link=Parameters - Explicit+Alias");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(PAR_L1_DAA1, "l1daa1");
+ selenium.type(PAR_L1_BAR1, "l1bar1");
+ selenium.type(PAR_L1_JUU1, "l1juu1");
+ selenium.type(PAR_L1_FOO1, "l1foo1");
+ selenium.click(PAR_L1_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "l1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "l1foo1");
+
+ selenium.type(PAR_L2_JUU2, "l2juu2");
+ selenium.type(PAR_L2_FOO2, "l2foo2");
+ selenium.type(PAR_L2_DAA2, "l2daa2");
+ selenium.type(PAR_L2_BAR2, "l2bar2");
+ selenium.click(PAR_L2_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "l1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "l2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "l1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "l2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "l2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R1_DAA1, "r1daa1");
+ selenium.type(PAR_R1_BAR1, "r1bar1");
+ selenium.type(PAR_R1_JUU1, "r1juu1");
+ selenium.type(PAR_R1_FOO1, "r1foo1");
+ selenium.click(PAR_R1_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r1bar1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R2_JUU2, "r2juu2");
+ selenium.type(PAR_R2_FOO2, "r2foo2");
+ selenium.type(PAR_R2_DAA2, "r2daa2");
+ selenium.type(PAR_R2_BAR2, "r2bar2");
+ selenium.click(PAR_R2_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r1bar1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ /*
+ selenium.type(PAR_R3_PNAM, "r3pnam");
+ selenium.type(PAR_R3_PVAL, "r3pval");
+ selenium.click(PAR_R3_SUB);
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ */
+
+ // deleting
+
+ selenium.click(PAR_L1_DAA1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r1bar1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L1_BAR1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r1bar1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L1_JUU1_R);
+ waitFor(AJAX_LOAD);
+
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r1bar1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L1_FOO1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L2_BAR2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_R1_DAA1_R);
+ waitFor(AJAX_LOAD);
+
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L2_JUU2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L2_FOO2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L2_DAA2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_R1_JUU1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_R2_JUU2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_R2_DAA2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_R2_BAR2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R3_PNAM, "binding1");
+ selenium.type(PAR_R3_PVAL, "viliam");
+ selenium.click(PAR_R3_SUB);
+ selenium.waitForPageToLoad("30000");
+ Assert.assertTrue(selenium.getLocation().endsWith("?binding1=viliam"));
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "viliam");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "viliam");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+ }
+
+ @Test(enabled = true)
+ public void parameterImplicitTest() {
+ selenium.click("link=Parameters - Implicit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(PAR_L1_DAA1, "l1daa1");
+ selenium.type(PAR_L1_BAR1, "l1bar1");
+ selenium.type(PAR_L1_JUU1, "l1juu1");
+ selenium.type(PAR_L1_FOO1, "l1foo1");
+ selenium.click(PAR_L1_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "l1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "l1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "l1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "l1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "l1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_L2_JUU2, "l2juu2");
+ selenium.type(PAR_L2_FOO2, "l2foo2");
+ selenium.type(PAR_L2_DAA2, "l2daa2");
+ selenium.type(PAR_L2_BAR2, "l2bar2");
+ selenium.click(PAR_L2_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "l2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "l2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "l1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "l1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "l2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "l2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "l2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "l2bar2");
+
+ selenium.type(PAR_R1_DAA1, "r1daa1");
+ selenium.type(PAR_R1_BAR1, "r1bar1");
+ selenium.type(PAR_R1_JUU1, "r1juu1");
+ selenium.type(PAR_R1_FOO1, "r1foo1");
+ selenium.click(PAR_R1_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "l2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r1foo1");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r1juu1");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r1foo1");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "l2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "l2bar2");
+
+ selenium.type(PAR_R2_JUU2, "r2juu2");
+ selenium.type(PAR_R2_FOO2, "r2foo2");
+ selenium.type(PAR_R2_DAA2, "r2daa2");
+ selenium.type(PAR_R2_BAR2, "r2bar2");
+ selenium.click(PAR_R2_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "r2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "r1daa1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ /*
+ selenium.type(PAR_R3_PNAM, "r3pnam");
+ selenium.type(PAR_R3_PVAL, "r3pval");
+ selenium.click(PAR_R3_SUB);
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ */
+
+ // deleting
+
+ selenium.click(PAR_L1_DAA1_R);
+ waitFor(AJAX_LOAD);
+
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "r2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "r1bar1");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L1_BAR1_R);
+ waitFor(AJAX_LOAD);
+
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "r2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "r2juu2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L1_JUU1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "r2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "r2foo2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "r2foo2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L1_FOO1_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "r2bar2");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "r2bar2");
+
+ selenium.click(PAR_L2_BAR2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "r2daa2");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.click(PAR_L2_DAA2_R);
+ waitFor(AJAX_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R3_PNAM, "binding1");
+ selenium.type(PAR_R3_PVAL, "viliam");
+ selenium.click(PAR_R3_SUB);
+ selenium.waitForPageToLoad("30000");
+ Assert.assertTrue(selenium.getLocation().endsWith("?binding1=viliam"));
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ }
+
+}
Added:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesTestCase.java
(rev 0)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -0,0 +1,681 @@
+package org.jboss.portal.test.selenium;
+
+import java.text.MessageFormat;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
+
+@Test(groups = { "coordination_samples" }, enabled = true)
+public class CoordinationSamplesTestCase extends JBossPortalSeleniumTestCase {
+
+ // Parameter test-cases properties
+ private final String PAR_L1_SUB = "//input[@value='Update']";
+ private final String PAR_L2_SUB =
"//div[@id='regionA']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[5]/td/input";
+ private final String PAR_R1_SUB =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[5]/td/input";
+ private final String PAR_R2_SUB =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[5]/td/input";
+ private final String PAR_R3_SUB =
"//div[@id='regionB']/div[3]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td/input";
+
+ private final String PAR_R3_PVAL = "value";
+ private final String PAR_R3_PNAM = "name";
+ private final String PAR_R2_BAR2 =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[4]/td[2]/input";
+ private final String PAR_R2_BAR2_R =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[4]/td[2]/a";
+ private final String PAR_R2_DAA2 =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td[2]/input";
+ private final String PAR_R2_DAA2_R =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td[2]/a";
+ private final String PAR_R2_FOO2 =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/input";
+ private final String PAR_R2_FOO2_R =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a";
+ private final String PAR_R2_JUU2 =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input";
+ private final String PAR_R2_JUU2_R =
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/a";
+ private final String PAR_R1_FOO1 =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[4]/td[2]/input";
+ private final String PAR_R1_FOO1_R =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[4]/td[2]/a";
+ private final String PAR_R1_JUU1 =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td[2]/input";
+ private final String PAR_R1_JUU1_R =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td[2]/a";
+ private final String PAR_R1_BAR1 =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/input";
+ private final String PAR_R1_BAR1_R =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a";
+ private final String PAR_R1_DAA1 =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input";
+ private final String PAR_R1_DAA1_R =
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/a";
+ private final String PAR_L2_BAR2 = "bar2";
+ private final String PAR_L2_BAR2_R =
"//body/div[2]/div/div/div[2]/div/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[4]/td[2]/a";
+ private final String PAR_L2_DAA2 = "daa2";
+ private final String PAR_L2_DAA2_R =
"//body/div[2]/div/div/div[2]/div/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td[2]/a";
+ private final String PAR_L2_FOO2 = "foo2";
+ private final String PAR_L2_FOO2_R =
"//body/div[2]/div/div/div[2]/div/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a";
+ private final String PAR_L2_JUU2 = "juu2";
+ private final String PAR_L2_JUU2_R =
"//body/div[2]/div/div/div[2]/div/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr/td[2]/a";
+ private final String PAR_L1_FOO1 = "foo1";
+ private final String PAR_L1_FOO1_R =
"//body/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[4]/td[2]/a";
+ private final String PAR_L1_JUU1 = "juu1";
+ private final String PAR_L1_JUU1_R =
"//body/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td[2]/a";
+ private final String PAR_L1_BAR1 = "bar1";
+ private final String PAR_L1_BAR1_R =
"//body/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a";
+ private final String PAR_L1_DAA1 = "daa1";
+ private final String PAR_L1_DAA1_R =
"//body/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr/td[2]/a";
+
+ // Event test-cases properties
+
+ private final String EVT_L1_TAB =
"//body/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/table";
+ private final String EVT_L2_TAB =
"//body/div[2]/div/div/div[2]/div/div[2]/table/tbody/tr[2]/td[2]/div/table";
+ private final String EVT_L3_TAB =
"//body/div[2]/div/div/div[2]/div/div[3]/table/tbody/tr[2]/td[2]/div/table";
+ private final String EVT_R1_TAB =
"//body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table";
+ private final String EVT_R2_TAB =
"//body/div[2]/div/div/div[2]/div[2]/div[2]/table/tbody/tr[2]/td[2]/div/table";
+ private final String EVT_R3_TAB =
"//body/div[2]/div/div/div[2]/div[2]/div[3]/table/tbody/tr[2]/td[2]/div/table";
+
+ private final String EVT_L_LNK =
"//body/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/table/tbody/tr[{0}]/td[3]/a";
+ private final String EVT_R_LNK =
"//body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table/tbody/tr[{0}]/td[3]/a";
+
+ private final String EVT_L_C1 = "Tent";
+ private final String EVT_L_C2 = "Skateboard";
+ private final String EVT_L_C3 = "Sneakers";
+
+ private final String EVT_R_C1 = "Surfboard";
+ private final String EVT_R_C2 = "Bike";
+ private final String EVT_R_C3 = "Backpack";
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ selenium.open("/portal/portal/default/default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+
+ }
+
+ @Test(enabled = true)
+ public void defaultCoordinationTest() {
+ selenium.open("/portal/portal/default/Coordination+Samples");
+ selenium.click("link=Coordination Samples");
+ selenium.waitForPageToLoad("30000");
+ selenium.open("http://localhost:8080/portal/portal/default/Coordination+Samples?zip=78759");
+ selenium.waitForPageToLoad("30000");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):78759"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):78759"));
+
+ selenium.type("name", "xyz");
+ selenium.type("value", "123");
+ selenium.click("//input[@value='Update']");
+ selenium.waitForPageToLoad("30000");
+
+ Assert.assertTrue(selenium.getLocation().endsWith("/portal/portal/default/Coordination+Samples?xyz=123"));
+ }
+
+ @Test(enabled = true)
+ public void eventsExplicitTest() {
+ selenium.click("link=Events - Explicit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = -1;
+
+ r = findTableRow(EVT_L1_TAB, EVT_L_C1, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_L1_TAB, EVT_L_C2, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_L1_TAB, EVT_L_C3, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C3, 0) > 0);
+
+ Assert.assertFalse(selenium.isElementPresent(EVT_R2_TAB));
+ Assert.assertFalse(selenium.isElementPresent(EVT_R3_TAB));
+
+ r = findTableRow(EVT_R1_TAB, EVT_R_C1, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_R1_TAB, EVT_R_C2, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_R1_TAB, EVT_R_C3, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C3, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C3, 0) > 0);
+ }
+
+ @Test(enabled = true)
+ public void eventsFallbackTest() {
+ selenium.click("link=Events - Fallback");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = -1;
+
+ r = findTableRow(EVT_L1_TAB, EVT_L_C1, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_L1_TAB, EVT_L_C2, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_L1_TAB, EVT_L_C3, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C3, 0) > 0);
+
+ Assert.assertFalse(selenium.isElementPresent(EVT_R2_TAB));
+ Assert.assertFalse(selenium.isElementPresent(EVT_R3_TAB));
+
+ r = findTableRow(EVT_R1_TAB, EVT_R_C1, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_R1_TAB, EVT_R_C2, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_R1_TAB, EVT_R_C3, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C3, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C3, 0) > 0);
+ }
+
+ @Test(enabled = true)
+ public void eventsImplicitTest() {
+ selenium.click("link=Events - Implicit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = -1;
+
+ r = findTableRow(EVT_L1_TAB, EVT_L_C1, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_L1_TAB, EVT_L_C2, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_L1_TAB, EVT_L_C3, 0);
+ selenium.click(MessageFormat.format(EVT_L_LNK, r));
+ waitFor(AJAX_LOAD);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C3, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_L_C3, 0) > 0);
+
+ r = findTableRow(EVT_R1_TAB, EVT_R_C1, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_R1_TAB, EVT_R_C2, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+ r = findTableRow(EVT_R1_TAB, EVT_R_C3, 0);
+ selenium.click(MessageFormat.format(EVT_R_LNK, r));
+ waitFor(AJAX_LOAD);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_L_C3, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_L_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_L_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_L_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_L_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_L_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_L_C3, 0) > 0);
+ // --------------------------------------------------------//
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_R_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_R_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_R_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_R_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_L2_TAB, EVT_R_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_L3_TAB, EVT_R_C3, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C1, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C1, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C2, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C2, 0) > 0);
+
+ Assert.assertTrue(findTableRow(EVT_R2_TAB, EVT_R_C3, 0) > 0);
+ Assert.assertTrue(findTableRow(EVT_R3_TAB, EVT_R_C3, 0) > 0);
+ }
+
+ @Test(enabled = true)
+ public void parameterAliasTest() {
+ selenium.click("link=Parameters - Alias");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ openAndWait("/portal/portal/default/Coordination+Samples/Parameters+-+Alias?binding1=Viliam");
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "Viliam");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "Viliam");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "Viliam");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "Viliam");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ openAndWait("/portal/portal/default/Coordination+Samples/Parameters+-+Alias?binding2=Prabhat");
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "Prabhat");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "Prabhat");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "Prabhat");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "Prabhat");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_L1_FOO1, "footest");
+ clickAndWait(PAR_L1_SUB);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "footest");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "footest");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "footest");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "footest");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ clickAndWait(PAR_R2_FOO2_R);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R3_PNAM, "xyz");
+ selenium.type(PAR_R3_PVAL, "123");
+ selenium.click(PAR_R3_SUB);
+ selenium.waitForPageToLoad("30000");
+ Assert.assertTrue(selenium.getLocation().endsWith("Parameters+-+Alias?xyz=123"));
+
+ }
+
+ @Test(enabled = true)
+ public void parameterExplicitTest() {
+ selenium.click("link=Parameters - Explicit+Alias");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ openAndWait("/portal/portal/default/Coordination+Samples/Parameters+-+Explicit?binding1=Viliam");
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "Viliam");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "Viliam");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "Viliam");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ clickAndWait(PAR_R1_FOO1_R);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ openAndWait("/portal/portal/default/Coordination+Samples/Parameters+-+Explicit?binding2=Nepal");
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "Nepal");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "Nepal");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "Nepal");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "Nepal");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R3_PNAM, "xyz");
+ selenium.type(PAR_R3_PVAL, "123");
+ selenium.click(PAR_R3_SUB);
+ selenium.waitForPageToLoad("30000");
+ Assert.assertTrue(selenium.getLocation().endsWith("Parameters+-+Explicit?xyz=123"));
+ }
+
+ @Test(enabled = true)
+ public void parameterExplicitAliasTest() {
+ selenium.click("link=Parameters - Explicit+Alias");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ openAndWait("/portal/portal/default/Coordination+Samples/Parameters+-+Explicit%2BAlias?binding1=Prabhat");
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "Prabhat");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "Prabhat");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ clickAndWait(PAR_R1_BAR1_R);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ openAndWait("/portal/portal/default/Coordination+Samples/Parameters+-+Explicit%2BAlias?binding2=Thomas");
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "Thomas");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "Thomas");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "Thomas");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R3_PNAM, "xyz");
+ selenium.type(PAR_R3_PVAL, "123");
+ selenium.click(PAR_R3_SUB);
+ selenium.waitForPageToLoad("30000");
+ Assert.assertTrue(selenium.getLocation().endsWith("/portal/portal/default/Coordination+Samples/Parameters+-+Explicit%2BAlias?xyz=123"));
+ }
+
+ @Test(enabled = true)
+ public void parameterImplicitTest() {
+ selenium.click("link=Parameters - Implicit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(PAR_L1_FOO1, "footest");
+ selenium.click(PAR_L1_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "footest");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "footest");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "footest");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "footest");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ clickAndWait(PAR_L1_FOO1_R);
+
+ Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_L1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_L2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_L2_BAR2), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R1_DAA1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_BAR1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_JUU1), "");
+ Assert.assertEquals(selenium.getValue(PAR_R1_FOO1), "");
+
+ Assert.assertEquals(selenium.getValue(PAR_R2_JUU2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
+ Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
+
+ selenium.type(PAR_R3_PNAM, "xyz");
+ selenium.type(PAR_R3_PVAL, "123");
+ selenium.click(PAR_R3_SUB);
+ selenium.waitForPageToLoad("30000");
+ Assert.assertTrue(selenium.getLocation().endsWith("Parameters+-+Implicit?xyz=123"));
+
+ }
+
+}
Added:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardPerfTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardPerfTestCase.java
(rev 0)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardPerfTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -0,0 +1,173 @@
+package org.jboss.portal.test.selenium;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.util.Date;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+
+public class DashboardPerfTestCase extends JBossPortalSeleniumTestCase {
+
+ private static final String LINK_PORTL1 = "link=*Cart Portlet*";
+ private static final String LINK_PORTL2 = "link=*Who's online portlet*";
+ // private static final String LINK_PORTL3 =
+ // "link=*PortletContentEditorInstance*";
+ // private static final String OPT_PORTL2 = "CurrentUsersPortletWindow";
+ private static final String SEL_CONTENT_TYPE =
"//select[contains(@id,'windowForm:instanceId')]";
+ private static final String SUB_ADDCENTER =
"//input[contains(@id,'layoutForm:a_center')]";
+ private static final String LNK_CONFIGURE_DASHBOARD = "link=Configure
dashboard";
+ private static final String LNK_DASHBOARD = "link=Dashboard";
+ private static final int USER_COUNT;
+
+ private static final int WAITING_TIMEOUT = 60;
+
+ private static String benchmarkFileName = "dashboardBenchmark.txt";
+ private static PrintWriter out;
+ static {
+ String nu = System.getProperty("userCount");
+ int n = 10;
+ if (nu != null)
+ n = Integer.decode(nu);
+
+ USER_COUNT = n;
+
+ String bf = System.getProperty("benchmarkFile");
+ if (bf != null)
+ benchmarkFileName = bf;
+
+ }
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() throws FileNotFoundException {
+ OutputStream fos = new FileOutputStream(new File(benchmarkFileName));
+ out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(fos)));
+ out.println("#" + new Date());
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+ out.close();
+ }
+
+ @Test(enabled = true)
+ public void testPageLoadPerformance() throws FileNotFoundException {
+ final String loginPrefix = "user0";
+ final String password = "user";
+
+ for (int i = 1; i < USER_COUNT; i++) {
+
+ long sTime = System.currentTimeMillis();
+ login(loginPrefix + i, password);
+ selenium.click(LNK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ waitForText("Current users");
+ waitForText("Cart is empty");
+ logout();
+ long eTime = System.currentTimeMillis();
+ long dashTime = eTime - sTime;
+ out.println(i+"\t"+dashTime);
+ // we don't want to loose are measures if process fails
+ out.close();
+ OutputStream fos = new FileOutputStream(new File(benchmarkFileName), true);
+ out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(fos)));
+
+ }
+ }
+
+ @Test(enabled = false)
+ public void testDashboardPerformance() throws FileNotFoundException {
+
+ final String loginPrefix = "user0";
+ final String password = "user";
+
+ for (int i = 1; i < USER_COUNT; i++) {
+ long sTime = System.currentTimeMillis();
+ login(loginPrefix + i, password);
+
+ selenium.click(LNK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(LNK_CONFIGURE_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ // wait(10000);
+
+ // hack
+ selenium.select(SEL_CONTENT_TYPE, "label=cms");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_CONTENT_TYPE, "label=portlet");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // selenium.setSpeed("1000");
+ selenium.click(LINK_PORTL1);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ waitForElement("portlet-editor-title");
+ selenium.click(SUB_ADDCENTER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click(LINK_PORTL2);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ waitForElement("portlet-editor-title");
+ selenium.click(SUB_ADDCENTER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ /*
+ * selenium.click(LINK_PORTL3);
+ * selenium.waitForPageToLoad(PAGE_LOAD);
+ * waitForElement("portlet-editor-title");
+ * selenium.click(SUB_ADDCENTER);
+ * selenium.waitForPageToLoad(PAGE_LOAD);
+ */
+ // selenium.setSpeed("0");
+ logout();
+ long eTime = System.currentTimeMillis();
+ long actTime = eTime - sTime;
+
+ login(loginPrefix + i, password);
+ sTime = System.currentTimeMillis();
+ selenium.click(LNK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ waitForText("Current users");
+ waitForText("Cart is empty");
+ eTime = System.currentTimeMillis();
+ long dashTime = eTime - sTime;
+ logout();
+
+ // we don't want to loose are measures if process fails
+ out.close();
+ OutputStream fos = new FileOutputStream(new File(benchmarkFileName), true);
+ out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(fos)));
+ }
+ }
+
+ @Override
+ public void waitForText(String text) {
+ boolean repeat = false;
+
+ for (int second = 0;; second++) {
+ if (second >= (WAITING_TIMEOUT*10)) {
+ if (repeat)
+ Assert.fail("Text '" + text + "' not found.");
+ repeat = true;
+ second = 0;
+ selenium.refresh();
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+ try {
+ if (selenium.isTextPresent(text)){
+ break;
+ }
+ } catch (Exception e) {
+ }
+ waitFor(100);
+ }
+ }
+
+}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -11,31 +11,35 @@
@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 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')]";
- private static final String SUB_UP_CENTER_REGION =
"//input[contains(@id,'layoutForm:u_center')]";
- private static final String SEL_CENTER_REGION =
"//select[contains(@id,'layoutForm:selectMany_center')]";
- private static final String SUB_ADDCENTER =
"//input[contains(@id,'layoutForm:a_center')]";
- private static final String SUB_ADDLEFT =
"//input[contains(@id,'layoutForm:a_left')]";
- private static final String LNK_CONFIGURE_DASHBOARD = "link=Configure
dashboard";
- private static final String LNK_DASHBOARD = "link=Dashboard";
- private static final String SEL_PAGE =
"//select[contains(@id,'pageNameSelector')]";
- private static final String INP_PAGENAME =
"//input[contains(@id,':pageName')]";
- private static final String SUB_CREATEPAGE =
"//form[contains(@id,'j_id3')]/input[@type='submit']";
- private static final String SEL_LAYOUT =
"//select[contains(@id,'dashboardLayoutForm:layoutSelector')]";
- private static final String SUB_LAYOUTSEL =
"//form[contains(@id,'dashboardLayoutForm')]/input[@type='submit']";
- private static final String SEL_THEME =
"//select[contains(@id,'dashboardThemeForm:themeSelector')]";
- private static final String SUB_THEMESEL =
"//form[contains(@id,'dashboardThemeForm')]/input[@type='submit']";
- private static final String SUB_UPDATE_LAYOUT =
"//form[contains(@id,'dashboardLayoutForm')]/input[@type='submit']";
+ private static final String POWERED_BY_JBOSS_PORTAL = "Powered by JBoss Enterprise
Portal Platform";
+
+ public String casePfx = "dash.";
+
+ private final String LNK_POR_WEA_EDIT = getProp(casePfx + "lnk.por.wea.edit",
"//body/div[2]/div/div/div[2]/div/div/div/div/div/div/table/tbody/tr/td[2]/div/div/div[2]/span/a");
+ private final String SUB_LAYOUT_UPDATE = getProp(casePfx +
"sub.layout.update",
"//input[contains(@name,'dashboardLayoutForm:j_id12')]");
+ private final String SUB_PAGE_RENAME = getProp(casePfx + "sub.page.rename",
"//form[contains(@id,'renameForm')]/input[@type='submit']");
+ private final String INP_PAGE_RENAME = getProp(casePfx + "inp.page.rename",
"//input[contains(@id,'renameForm:newName')]");
+ private final String LINK_WEATHER_PORTLET = getProp(casePfx +
"link.weather.portlet", "link=*WeatherPortlet*");
+ private final String LINK_PORTL2 = getProp(casePfx + "link.portl2",
"link=*Who's online portlet*");
+ private final String LINK_PORTL1 = getProp(casePfx + "link.portl1",
"link=*Welcome portlet*");
+ private final String OPT_PORTL1 = getProp(casePfx + "opt.portl1",
"JSPPortletWindow");
+ private final String SEL_CONTENT_TYPE = getProp(casePfx + "sel.content.type",
"//select[contains(@id,'contentTypesForm:instanceId')]");
+ private final String SUB_DEL_FROM_CENTER_REGION = getProp(casePfx +
"sub.del.from.center.region",
"//input[contains(@id,'layoutForm:l_center')]");
+ private final String SUB_DOWN_CENTER_REGION = getProp(casePfx +
"sub.down.center.region",
"//input[contains(@id,'layoutForm:d_center')]");
+ private final String SUB_UP_CENTER_REGION = getProp(casePfx +
"sub.up.center.region",
"//input[contains(@id,'layoutForm:u_center')]");
+ private final String SEL_CENTER_REGION = getProp(casePfx +
"sel.center.region",
"//select[contains(@id,'layoutForm:selectMany_center')]");
+ private final String SUB_ADDCENTER = getProp(casePfx + "sub.addcenter",
"//input[contains(@id,'layoutForm:a_center')]");
+ private final String SUB_ADDLEFT = getProp(casePfx + "sub.addleft",
"//input[contains(@id,'layoutForm:a_left')]");
+ private final String LNK_CONFIGURE_DASHBOARD = getProp(casePfx +
"lnk.configure.dashboard", "link=Configure dashboard");
+ private final String LNK_DASHBOARD = getProp(casePfx + "lnk.dashboard",
"link=Dashboard");
+ private final String SEL_PAGE = getProp(casePfx + "sel.page",
"//select[contains(@id,'pageNameSelector')]");
+ private final String INP_PAGENAME = getProp(casePfx + "inp.pagename",
"//input[contains(@id,':pageName')]");
+ private final String SUB_CREATEPAGE = getProp(casePfx + "sub.createpage",
"//form[contains(@id,'j_id3')]/input[@type='submit']");
+ private final String SEL_LAYOUT = getProp(casePfx + "sel.layout",
"//select[contains(@id,'dashboardLayoutForm:layoutSelector')]");
+ private final String SEL_THEME = getProp(casePfx + "sel.theme",
"//select[contains(@id,'dashboardThemeForm:themeSelector')]");
+ private final String SUB_THEMESEL = getProp(casePfx + "sub.themesel",
"//form[contains(@id,'dashboardThemeForm')]/input[@type='submit']");
+
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
logoutIfPossible();
@@ -47,7 +51,7 @@
}
- private void wait(int t){
+ private void wait(int t) {
try {
Thread.sleep(t);
} catch (InterruptedException e) {
@@ -55,222 +59,220 @@
e.printStackTrace();
}
}
-
+
@Test(enabled = true)
public void testCreatePage() {
selenium.click(LNK_DASHBOARD);
-
- //selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // 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);
-
+
+ clickAndWait(SUB_CREATEPAGE);
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isElementPresent("link="+pageName));
- selenium.click("link="+pageName);
+ Assert.assertTrue(selenium.isElementPresent("link=" + pageName));
+ selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Powered by JBoss"), "default
footer message missing");
+ 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.waitForPageToLoad(PAGE_LOAD);
final String pageName = "DashToRenamePage";
final String pageNameNew = "DashRenamedPage";
selenium.type(INP_PAGENAME, pageName);
-
- clickAndWait(SUB_CREATEPAGE);
-
+
+ clickAndWait(SUB_CREATEPAGE);
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isElementPresent("link="+pageName));
- selenium.click("link="+pageName);
+ Assert.assertTrue(selenium.isElementPresent("link=" + pageName));
+ selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Powered by JBoss"),"default
footer text is missing");
-
+ Assert.assertTrue(selenium.isTextPresent(POWERED_BY_JBOSS_PORTAL));
+
// then rename it
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selectIfNotSelected(SEL_PAGE,pageName);
+ selectIfNotSelected(SEL_PAGE, pageName);
+
selenium.type(INP_PAGE_RENAME, pageNameNew);
selenium.click(SUB_PAGE_RENAME);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
}
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testUpdateTheme() {
- //selenium.setSpeed("10000");
+ // selenium.setSpeed("10000");
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.select(SEL_THEME, "label=renaissance");
-
+
selenium.click(SUB_THEMESEL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
Assert.assertEquals(selenium.getSelectedLabel(SEL_THEME), "renaissance",
"Previously selected theme other then expected.");
}
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testUpdateLayout() {
- //selenium.setSpeed("10000");
+ // selenium.setSpeed("10000");
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
selenium.windowMaximize();
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.select(SEL_LAYOUT, "label=generic");
-
- selenium.click(SUB_UPDATE_LAYOUT);
+
+ selenium.click(SUB_LAYOUT_UPDATE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
-
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
+
Assert.assertEquals(selenium.getSelectedLabel(SEL_LAYOUT), "generic",
"Previously selected layout other then expected.");
}
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testAddPortlet() {
- //selenium.setSpeed("10000");
+ // selenium.setSpeed("10000");
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
-
-
+
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.click(LINK_PORTL2);
selenium.waitForPageToLoad(PAGE_LOAD);
waitForElement("portlet-editor-title");
selenium.click(SUB_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=DashTestPage");
selenium.waitForPageToLoad(PAGE_LOAD);
-
-
+
Assert.assertTrue(selenium.isTextPresent("Current users"));
Assert.assertTrue(selenium.isTextPresent("Among them: * logged-in"));
Assert.assertTrue(selenium.isTextPresent("[admin]"));
- //selenium.setSpeed("0");
+ // selenium.setSpeed("0");
}
- @Test(enabled = true, dependsOnMethods = {
"testCreatePage","testAddPortlet" })
+ @Test(enabled = true, dependsOnMethods = { "testCreatePage",
"testAddPortlet" })
public void testMovePortlet() {
final String pageName = "DashMovePage";
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
-
+
selenium.type(INP_PAGENAME, pageName);
selenium.click(SUB_CREATEPAGE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selectIfNotSelected(SEL_PAGE,pageName);
+
+ selectIfNotSelected(SEL_PAGE, pageName);
selenium.click(LINK_PORTL1);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selectIfNotSelected(SEL_PAGE,pageName);
+
+ selectIfNotSelected(SEL_PAGE, pageName);
selenium.click(LINK_PORTL2);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link="+pageName);
+ selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(assertTextOrder("Current;Greetings"));
Assert.assertTrue(assertTextOrder("Greetings;Current"));
-
+
}
-
- @Test(enabled = true, dependsOnMethods = { "testCreatePage" ,
"testMovePortlet"})
+
+ @Test(enabled = true, dependsOnMethods = { "testCreatePage",
"testMovePortlet" })
public void testReorder() {
final String pageName = "DashMovePage";
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
- selectIfNotSelected(SEL_PAGE,pageName);
-
+ selectIfNotSelected(SEL_PAGE, pageName);
+
selenium.addSelection(SEL_CENTER_REGION, OPT_PORTL1);
selenium.click(SUB_DOWN_CENTER_REGION);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link="+pageName);
+ selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(assertTextOrder("Greetings;Current"));
Assert.assertTrue(assertTextOrder("Current;Greetings"));
}
-
+
@Test(enabled = true, dependsOnMethods = { "testAddPortlet" })
public void testDeletePortlet() {
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.addSelection(SEL_CENTER_REGION, "label=CurrentUsersPortletWindow");
selenium.click(SUB_DEL_FROM_CENTER_REGION);
@@ -291,9 +293,9 @@
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.select(SEL_CONTENT_TYPE, "label=widget/google");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Band Culinaria");
@@ -311,7 +313,7 @@
//
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=143023
//
https://jira.jboss.org/jira/browse/JBPORTAL-2177
- @Test(enabled = false)
+ @Test(enabled = true)
public void testBugResetPortletSetting() {
final String pageName = "page1";
final String pageNameNew = "page1a";
@@ -322,7 +324,7 @@
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
selenium.type(INP_PAGENAME, pageName);
selenium.click(SUB_CREATEPAGE);
@@ -334,7 +336,7 @@
selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
+ Assert.assertTrue(selenium.isTextPresent(POWERED_BY_JBOSS_PORTAL));
// add weather portlet
selenium.open("/portal/");
@@ -344,7 +346,7 @@
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selectIfNotSelected(SEL_PAGE,pageName);
+ selectIfNotSelected(SEL_PAGE, pageName);
selenium.click(LINK_WEATHER_PORTLET);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -358,7 +360,7 @@
Assert.assertTrue(selenium.isTextPresent("Miami, FL, US"));
// change the properties
- selenium.click("//div[@id='dashboard:YWRtaW4=.cGFnZTE=.V2VhdGhlclBvcnRsZXRXaW5kb3c=']/div/table/tbody/tr[1]/td[2]/div/div/div[2]/span[1]/a");
+ selenium.click(LNK_POR_WEA_EDIT);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.type("newzip", "41001");
selenium.click("submit");
@@ -371,10 +373,10 @@
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
- selectIfNotSelected(SEL_PAGE,pageName);
+ selectIfNotSelected(SEL_PAGE, pageName);
selenium.type(INP_PAGE_RENAME, pageNameNew);
selenium.click(SUB_PAGE_RENAME);
Added:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java
(rev 0)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -0,0 +1,241 @@
+package org.jboss.portal.test.selenium;
+
+import java.text.MessageFormat;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
+ */
+@Test(groups = {"end2end"}, enabled = true, description = "Creating of new
portal with content.")
+public class EndToEndBeaPortlet extends JBossPortalSeleniumTestCase {
+
+ public static String casePfx = "e2e.wsrp.";
+
+ private final String SUB_VIEW_PORTLETS =
"//input[contains(@id,'definition-form:view-portlets')]";
+ public final String SEL_CONS_TYPE =
"//select[contains(@id,'definition-form:menu')]";
+
+ private final String ADR_HOME =
getProp(casePfx+"adr.home","portal/auth/portal/default");
+ private final String INP_CONSUMER_NAME =
getProp(casePfx+"inp.consumer.name","//input[contains(@id,'edit-cons-form:id')]");
+ private final String SUBMIT_REFRESH_CANCEL =
getProp(casePfx+"submit.refresh.cancel","//a[contains(@id,'edit-cons-form:list-cons-link')]");
+ private final String SUBMIT_PROD_SAVE =
getProp(casePfx+"submit.prod.save","//input[contains(@id,'producer-form:save-producer')]");
+ private final String SUBMIT_CONSDEL_CONF =
getProp(casePfx+"submit.consdel.conf","//a[contains(@id,'confirm-delete-form:destroy-link')]");
+
+ private final String SUBMIT_CONS_REGVAL =
getProp(casePfx+"submit.cons.regval","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+ private final String SUBMIT_REFRESHFINAL =
getProp(casePfx+"submit.refreshfinal","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+
+ private final String INPUT_CONS_REGVALUE =
getProp(casePfx+"input.cons.regvalue","//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]");
+ private final String SUBMIT_REFRESHSAVE =
getProp(casePfx+"submit.refreshsave","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+ private final String INPUT_CONSWSDL =
getProp(casePfx+"input.conswsdl","//input[contains(@id,'edit-cons-form:wsdl')]");
+ private final String INPUT_CACHEEXP =
getProp(casePfx+"input.cacheexp","//input[contains(@id,'edit-cons-form:cache')]");
+ private final String SUBMIT_ADDPROP_INIT =
getProp(casePfx+"submit.addprop.init","//a[contains(@id,'producer-form:add-reg-prop')]");
+ private final String SUBMIT_ADDPROP =
getProp(casePfx+"submit.addprop","//a[contains(@id,'producer-form:add-reg-prop')]");
+ private final String INPUT_PROPHINT =
getProp(casePfx+"input.prophint","//input[contains(@id,'producer-form:reg-properties:0:hint')]");
+ private final String INPUT_PROPLABEL =
getProp(casePfx+"input.proplabel","//input[contains(@id,'producer-form:reg-properties:0:label')]");
+ private final String INPUT_PROPNAME =
getProp(casePfx+"input.propname","//input[contains(@id,'producer-form:reg-properties:0:name')]");
+ private final String SUBMIT_CREATECONS =
getProp(casePfx+"submit.createcons","//input[contains(@id,'createConsumer:createConsumerButton')]");
+ private final String INPUT_CREATECONS =
getProp(casePfx+"input.createcons","//input[contains(@id,'createConsumer:consumerName')]");
+ private final String ID_LINK_PRODCONF =
getProp(casePfx+"id.link.prodconf","//a[contains(@id,'cons-temp-form:producer-link')]");
+ private final String ID_LINK_CONSCONF =
getProp(casePfx+"id.link.consconf","//a[contains(@id,'producer-temp-form:consumersTab')]");
+ private final String LINK_CONSUMER_HOME
=getProp(casePfx+"link.consumer.home","//a[contains(@id,'cons-temp-form1:list-cons-link')]");
+
+ private final String
LINK_T_CONS_CON=getProp(casePfx+"link.t.cons.con","//a[contains(@id,''consumer-list-form:consumersList:{0}:configure'')]");
+ private final String
LINK_T_CONS_REF=getProp(casePfx+"link.t.cons.ref","//a[contains(@id,''consumer-list-form:consumersList:{0}:refresh'')]");
+ private final String
LINK_T_CONS_ACT=getProp(casePfx+"link.t.cons.act","//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]");
+ private final String
LINK_T_CONS_DEA=getProp(casePfx+"link.t.cons.dea","//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]");
+ private final String
LINK_T_CONS_REG=getProp(casePfx+"link.t.cons.reg","//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]");
+ private final String
LINK_T_CONS_DER=getProp(casePfx+"link.t.cons.der","//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]");
+ private final String
LINK_T_CONS_DEL=getProp(casePfx+"link.t.cons.del","//a[contains(@id,''consumer-list-form:consumersList:{0}:delete'')]");
+
+ ///
+
+ public final String SEL_PORTLET_TYPE =
getProp(casePfx+"sel.portlet.type","//select[contains(@id,'windowForm:instanceId')]");
+ private final String SUB_LAYOUT_ADD_CENTER =
getProp(casePfx+"sub.layout.add.center","//input[contains(@id,'layoutForm:a_center')]");
+ private final String INP_WINDOW_NAME =
getProp(casePfx+"inp.window.name","//input[contains(@id,'windowForm:windowName')]");
+ private final String SUB_RENAME_PORTAL =
getProp(casePfx+"sub.rename.portal","//input[contains(@id,'renameForm:rename')]");
+ private final String INP_RENAME_PORTAL =
getProp(casePfx+"inp.rename.portal","//input[contains(@id,'renameForm:newName')]");
+ private final String SUB_DELETE_PORTAL_CONF =
getProp(casePfx+"sub.delete.portal.conf","//input[contains(@id,'delete-view:confirm-form:delete')]");
+ private final String INP_SUBMIT_PAGECREATE =
getProp(casePfx+"inp.submit.pagecreate","//input[contains(@id,'create-page-form:create-page')]");
+ private final String INP_PAGENAME =
getProp(casePfx+"inp.pagename","//input[contains(@id,'create-page-form:pageName')]");
+ private final String INP_PORTALNAME =
getProp(casePfx+"inp.portalname","//input[contains(@id,'create-portal-form:name')]");
+ private final String INP_SUBMIT_CREATEPORTAL =
getProp(casePfx+"inp.submit.createportal","//input[contains(@id,'create-portal-form:create-portal')]");
+ private final String TAB_PORTALOBJ_ID =
getProp(casePfx+"tab.portalobj.id","Link=Admin");
+ private final String LNK_PORTALS_ID =
getProp(casePfx+"lnk.portals.id","link=*Portal Objects*");
+ private final String LNK_PORTAL_HOME =
getProp(casePfx+"lnk.portal.home","//a[contains(@id,'obj-temp-form:object-link-0')]");
+ private final String TBL_PORTAL_ADMIN =
getProp(casePfx+"tbl.portal.admin","//table[contains(@id,'obj-nav-form:portal-datatable')]");
+ private final String POR_TL_MAIN =
getProp(casePfx+"por.tl.main","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]");
+ private final String POR_TL_SECURITY =
getProp(casePfx+"por.tl.security","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]");
+ private final String POR_TL_PROPERTIES =
getProp(casePfx+"por.tl.properties","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]");
+ private final String POR_TL_THEME =
getProp(casePfx+"por.tl.theme","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]");
+ private final String POR_TL_RENAME =
getProp(casePfx+"por.tl.rename","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]");
+ private final String POR_TL_DELETE =
getProp(casePfx+"por.tl.delete","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]");
+ private final String POR_TL_MAKEDEF =
getProp(casePfx+"por.tl.makedef","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]");
+ private final String TBL_PORTALPAGE_ADMIN =
getProp(casePfx+"tbl.portalpage.admin","//table[contains(@id,'obj-nav-form:pages-datatable')]");
+ private final String PAG_TL_MAIN =
getProp(casePfx+"pag.tl.main","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]");
+ private final String PAG_TL_LAYOUT =
getProp(casePfx+"pag.tl.layout","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]");
+ private final String PAG_TL_SECURITY =
getProp(casePfx+"pag.tl.security","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]");
+ private final String PAG_TL_PROPERTIES =
getProp(casePfx+"pag.tl.properties","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]");
+ private final String PAG_TL_THEME =
getProp(casePfx+"pag.tl.theme","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]");
+ private final String PAG_TL_RENAME =
getProp(casePfx+"pag.tl.rename","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]");
+ private final String PAG_TL_DISPLAY =
getProp(casePfx+"pag.tl.display","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]");
+ private final String PAG_TL_DELETE =
getProp(casePfx+"pag.tl.delete","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]");
+ private final String PAG_TL_MAKEDEF =
getProp(casePfx+"pag.tl.makedef","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]");
+
+
+ /// def
+
+ private final String T_LINK_PREF =
"//a[contains(@id,''def-list:portlet-pref-{0}'')]";
+ private final String SUBMIT_CREATE_INST =
"//input[contains(@name,'add_instance_form:j_id19')]";
+ private final String INPUT_INSTANCE_NAME =
"//input[contains(@id,'add_instance_form:instanceId')]";
+ private final String T_LINK_CREATE =
"//a[contains(@id,''def-list:create-instance-{0}'')]";
+ private final String SUBMIT_PROVIDER_VIEW =
"//input[contains(@id,'definition-form:view-portlets')]";
+ private final String SELECT_PROVIDER =
"//select[contains(@id,'definition-form:menu')]";
+ private final String TABLE_PORTLET =
"//form[contains(@id,'def-list')]/table";
+ private final String LINK_NAME_ADMIN_PORT =
"//a[contains(@id,'common-show-portlet-detail-form:field1:select')]";
+ private final String LINK_ADMIN_PORT =
"//a[contains(@id,'def-list:portlet-def-0')]";
+ private final String LINK_ADMIN = "link=Admin";
+ private final String LINK_TAB_PD =
"//a[contains(@id,'admin-subtab-form:portlet-def-link')]";
+ private final String LINK_PD_MAIN =
"//a[contains(@id,'man-form:def-link')]";
+
+ public static String WSRP_CONSUMER_TABLE =
"//table[contains(@id,':consumer-list-form:consumersList')]";
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ logoutIfPossible();
+ login("admin", "admin");
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+ //logout();
+ }
+
+ private String PORTLET = "";
+
+ @Test(enabled = true, description = "Creating a standard BEA portlet.")
+ public void testEnd2EndBeaPortlet(){
+
+ String consName = "BeaE2E";
+ String portalName = "default";
+ String pageName = "default";
+ String defName= "BEA: Hello World";
+ String insName = "1BeaPor";
+
+ createConsumer(consName);
+ createInstance(defName, consName, insName);
+ addPortlet(portalName, pageName, insName, "portlet");
+
+ selenium.open(ADR_HOME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent("1BeaPorWindow"));
+ Assert.assertTrue(selenium.isTextPresent("Welcome to WebLogic Portal WSRP
Demo."));
+
+ }
+
+ private void createConsumer(String consumerName){
+ selenium.open(ADR_HOME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=WSRP");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ clickIfVisible(ID_LINK_CONSCONF);
+
+ selenium.type(INPUT_CREATECONS, consumerName);
+
+ selenium.click(SUBMIT_CREATECONS);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INPUT_CACHEEXP, "600");
+
+ selenium.type(INPUT_CONSWSDL,
"http://wsrp.bea.com:7001/producer/producer?WSDL");
+ selenium.click(SUBMIT_REFRESHSAVE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Refresh failed (probably because the
registration information was not valid)."));
+ Assert.assertTrue(selenium.isTextPresent("Missing value"));
+
+ selenium.type(INPUT_CONS_REGVALUE, "public");
+ selenium.click(SUBMIT_CONS_REGVAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Refresh was successful."));
+ selenium.click(SUBMIT_REFRESHFINAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(consumerName));
+ }
+
+ private void createInstance(String defName, String type, String insName){
+ selenium.open(ADR_HOME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(LINK_ADMIN);
+ clickIfVisible(LINK_ADMIN);
+ clickIfVisible(LINK_TAB_PD);
+ clickIfVisible(LINK_PD_MAIN);
+
+ selenium.select(SEL_CONS_TYPE, "label="+type);
+ selenium.click(SUB_VIEW_PORTLETS);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = findTableRow(TABLE_PORTLET, defName, 0);
+
+ selenium.click(MessageFormat.format(T_LINK_CREATE,r-1));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ //selenium.setSpeed("5555");
+ selenium.type(INPUT_INSTANCE_NAME, insName);
+ selenium.click(SUBMIT_CREATE_INST);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(insName + " portlet details"));
+ }
+
+ private void addPortlet(String portalName, String pageName, String portletName, String
type) {
+ selenium.open(ADR_HOME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
+
+ int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TBL_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ // click on the page layout
+ selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
+
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ //hack
+ selenium.select(SEL_PORTLET_TYPE, "label=" + "cms");
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ selenium.select(SEL_PORTLET_TYPE, "label=" + type);
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ selenium.click("link=*"+portletName+"*");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click(SUB_LAYOUT_ADD_CENTER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ }
+}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -14,75 +14,86 @@
@Test(groups = { "admin_ui" }, enabled = true)
public class IdentityAdminTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUB_EDIT_PROF =
"//input[contains(@id,'profile-form:submit')]";
- private static final String SUB_EDIT_USER_EMAIL_CANCEL =
"//input[contains(@id,'profile-form:cancel')]";
- private static final String INP_EDIT_USER_EMAIL =
"//input[contains(@id,'profile-form:email')]";
- private static final String SUB_ROLE_SEARCH_USER =
"//input[contains(@id,'search-user-form:search') and
@type='submit']";
- private static final String INP_ROLE_SEARCH_USER =
"//input[contains(@id,'search-user-form:searchString')]";
- private static final String SUB_EDIT_ROLE_SUBMIT =
"//input[contains(@id,'edit-role-link:submit')]";
- private static final String SUB_EDIT_ROLE_CANCEL =
"//input[contains(@id,'edit-role-link:cancel')]";
- private static final String INP_EDIT_ROLE_NAME =
"//input[contains(@id,'edit-role-link:display-name')]";
- private static final String SUB_PASS_CHANGE_SUBMIT =
"//input[contains(@name,'change-pwd-form:j_id31')]";
- private static final String SUB_PASS_CHANGE_CANCEL =
"//input[contains(@id,'change-pwd-form:cancel')]";
- private static final String INPUT_PASS_CHANGE_P2 =
"//input[contains(@id,':change-pwd-form:passwordCheck')]";
- private static final String INPUT_PASS_CHANGE_P1 =
"//input[contains(@id,':change-pwd-form:password')]";
- private static final String LINK_CHANGE_PASS =
"//a[contains(@id,':profile-form:change-pwd-adm-link')]";
- public static final String TABLE_USERLIST =
"//table[contains(@id,'search-user-form1:userlist')]";
- public static final String LINK_T_USRLIST_DEL =
"//a[contains(@id,''search-user-form1:userlist:{0}:delete-user-link'')]";
- public static final String LINK_T_USRLIST_ROLES =
"//a[contains(@id,''search-user-form1:userlist:{0}:assign-role-link'')]";
- public static final String LINK_T_USRLIST_DIS =
"//a[contains(@id,''search-user-form1:userlist:{0}:enable-user-link'')]";
- public static final String LINK_T_USRLIST_EDIT =
"//a[contains(@id,''search-user-form1:userlist:{0}:rename-link'')]";
-
- public static final String TABLE_ROLELIST =
"//table[contains(@id,':roles-form:userlist')]";
-
- public static final String LINK_T_ROLLIST_DEL =
"//a[contains(@id,''roles-form:userlist:{0}:delete-role-link'')]";
- public static final String LINK_T_ROLLIST_MEMBERS =
"//a[contains(@id,''roles-form:userlist:{0}:view-role-link'')]";
- public static final String LINK_T_ROLLIST_EDIT =
"//a[contains(@id,''roles-form:userlist:{0}:edit-role-link'')]";
-
- public static final String TABLE_ROLEMEMBERS =
"//table[contains(@id,'role-members-form:role-data-table')]";
-
- public static final String ID_SUBMIT_CONF_CREATE_USER =
"//input[contains(@id,'confirm-form:admin')]";
- public static final String ID_SUBMIT_DELETE_ROLE =
"//input[contains(@id,'delete-role-form:confirm')]";
- public static final String ID_SUBMIT_ROLE_CREATE =
"//input[contains(@id,':create-role-form:submit')]";
- public static final String ID_INPUT_ROLEDISNAME =
"//input[contains(@id,':create-role-form:roledisplayname')]";
- public static final String ID_INPUT_ROLENAME =
"//input[contains(@id,':create-role-form:rolename')]";
-
- public static final String ID_BUT_ROLE_CREATE = "//a[contains(@id,
'create-role-form:create-role-link')]";
-
- public static final String ID_BUT_SUBMIT_DEL_USER =
"//input[contains(@id,'delete-user-form:submit')]";
- public static final String ID_SUBMIT_ASSIGN_ROLE =
"//input[contains(@id,'assign-roles-form:submit')]";
- public static final String ID_SUBMIT_USER_ROLE =
"//input[contains(@id,'register-role-form:submit')]";
- public static final String ID_SUBMIT_CREATE_USER =
"//input[contains(@id,'register-form:submit')]";
- public static final String ID_INPUT_PASSWORD_CHK =
"//input[contains(@id,'register-form:passwordCheck')]";
- public static final String ID_INPUT_PASSWORD =
"//input[contains(@id,'register-form:password')]";
- public static final String ID_INPUT_USEREMAIL =
"//input[contains(@id,'register-form:email')]";
- public static final String ID_INPUT_USERNAME =
"//input[contains(@id,'register-form:username')]";
- public static final String ID_SUBMIT_SEARCH_USER =
"//input[contains(@id,'search-user-form:search')]";
- public static final String ID_INPUT_SEARCH_USER =
"//input[contains(@id,'search-user-form:searchString')]";
- public static final String LINK_SEARCH_USER =
"//a[contains(@id,'user-form:search-user-link')]";
- public static final String ID_LINK_USERTAB =
"//a[contains(@id,'role-temp-form:manage-users')]";
- public static final String ID_LINK_USERMAIN =
"//a[contains(@id,'user-temp-form1:user-adm-link')]";
-
- public static final String ID_LINK_ROLETAB =
"//a[contains(@id,':user-temp-form:role-mgm-link')]";
-
- public static final String ID_LINK_ROLEMAIN = "//a[contains(@id,
':role-temp-form1:role-admin-link')]";
- public static final String LINK_USERMANG_MAIN =
"//a[contains(@id,'user-temp-form1:assign-role-link')]";
- public static final String LINK_USERMANG_MAIN2 =
"//a[contains(@id,'user-temp-form1:user-mgm-link')]";
- public static final String ID_LINK_CREATE_USER =
"//a[contains(@id,':user-form:create-user-link')]";
- public static final String ID_CHECK_ROLE =
"//input[contains(@name,''assign-roles-form:roles'') and
@value=''{0}'']";
-
+ public String casePfx = "iden.man.";
+ private final String INP_USER_SEARCH_PREV = getProp(casePfx +
"inp.user.search.prev",
"//input[contains(@id,'search-user-form1:prev-page')]");
+ private final String INP_USER_SEARCH_NEXT = getProp(casePfx +
"inp.user.search.next",
"//input[contains(@id,'search-user-form1:next-page')]");
+
+ private final String SEL_SEARCHUSER_LIMIT = getProp(casePfx +
"sel.searchuser.limit",
"//select[contains(@id,'search-user-form:limit')]");
+ private final String SUB_EDIT_PROF = getProp(casePfx + "sub.edit.prof",
"//input[contains(@id,'profile-form:submit')]");
+
+ private final String SUB_PAGIN_LEFT = getProp(casePfx + "sub.pagin.left",
INP_USER_SEARCH_PREV);
+ private final String SUB_PAGIN_RIGHT = getProp(casePfx + "sub.pagin.right",
INP_USER_SEARCH_NEXT);
+
+ private final String SUB_EDIT_USER_EMAIL_CANCEL = getProp(casePfx +
"sub.edit.user.email.cancel",
"//input[contains(@id,'profile-form:cancel')]");
+ private final String INP_EDIT_USER_EMAIL = getProp(casePfx +
"inp.edit.user.email",
"//input[contains(@id,'profile-form:email')]");
+ private final String SUB_ROLE_SEARCH_USER = getProp(casePfx +
"sub.role.search.user",
"//input[contains(@id,'search-user-form:search') and
@type='submit']");
+ private final String INP_ROLE_SEARCH_USER = getProp(casePfx +
"inp.role.search.user",
"//input[contains(@id,'search-user-form:searchString')]");
+ private final String SUB_EDIT_ROLE_SUBMIT = getProp(casePfx +
"sub.edit.role.submit",
"//input[contains(@id,'edit-role-link:submit')]");
+ private final String SUB_EDIT_ROLE_CANCEL = getProp(casePfx +
"sub.edit.role.cancel",
"//input[contains(@id,'edit-role-link:cancel')]");
+ private final String INP_EDIT_ROLE_NAME = getProp(casePfx +
"inp.edit.role.name",
"//input[contains(@id,'edit-role-link:display-name')]");
+ private final String SUB_PASS_CHANGE_SUBMIT = getProp(casePfx +
"sub.pass.change.submit",
"//input[contains(@name,'change-pwd-form:j_id31')]");
+ private final String SUB_PASS_CHANGE_CANCEL = getProp(casePfx +
"sub.pass.change.cancel",
"//input[contains(@id,'change-pwd-form:cancel')]");
+ private final String INP_PASS_CHANGE_P2 = getProp(casePfx +
"inp.pass.change.p2",
"//input[contains(@id,':change-pwd-form:passwordCheck')]");
+ private final String INP_PASS_CHANGE_P1 = getProp(casePfx +
"inp.pass.change.p1",
"//input[contains(@id,':change-pwd-form:password')]");
+ private final String LNK_CHANGE_PASS = getProp(casePfx + "lnk.change.pass",
"//a[contains(@id,':profile-form:change-pwd-adm-link')]");
+ public final String TBL_USERLIST = getProp(casePfx + "tbl.userlist",
"//table[contains(@id,'search-user-form1:userlist')]");
+ public final String LNK_T_USRLIST_DEL = getProp(casePfx + "lnk.t.usrlist.del",
"//a[contains(@id,''search-user-form1:userlist:{0}:delete-user-link'')]");
+ public final String LNK_T_USRLIST_ROLES = getProp(casePfx +
"lnk.t.usrlist.roles",
"//a[contains(@id,''search-user-form1:userlist:{0}:assign-role-link'')]");
+ public final String LNK_T_USRLIST_DIS = getProp(casePfx + "lnk.t.usrlist.dis",
"//a[contains(@id,''search-user-form1:userlist:{0}:enable-user-link'')]");
+ public final String LNK_T_USRLIST_EDIT = getProp(casePfx +
"lnk.t.usrlist.edit",
"//a[contains(@id,''search-user-form1:userlist:{0}:rename-link'')]");
+
+ public final String TBL_ROLELIST = getProp(casePfx + "tbl.rolelist",
"//table[contains(@id,'roles-form:userlist')]");
+
+ public final String LNK_T_ROLLIST_DEL = getProp(casePfx + "lnk.t.rollist.del",
"//a[contains(@id,''roles-form:userlist:{0}:delete-role-link'')]");
+ public final String LNK_T_ROLLIST_MEMBERS = getProp(casePfx +
"lnk.t.rollist.members",
"//a[contains(@id,''roles-form:userlist:{0}:view-role-link'')]");
+ public final String LNK_T_ROLLIST_EDIT = getProp(casePfx +
"lnk.t.rollist.edit",
"//a[contains(@id,''roles-form:userlist:{0}:edit-role-link'')]");
+
+ public final String TBL_ROLEMEMBERS = getProp(casePfx + "tbl.rolemembers",
"//table[contains(@id,'role-members-form:role-data-table')]");
+
+ public final String SUB_CONF_CREATE_USER = getProp(casePfx +
"sub.conf.create.user",
"//input[contains(@id,'confirm-form:admin')]");
+ public final String SUB_DELETE_ROLE = getProp(casePfx + "sub.delete.role",
"//input[contains(@id,'delete-role-form:confirm')]");
+ public final String SUB_ROLE_CREATE = getProp(casePfx + "sub.role.create",
"//input[contains(@id,'create-role-form:submit')]");
+ public final String INP_ROLEDISNAME = getProp(casePfx + "inp.roledisname",
"//input[contains(@id,'create-role-form:roledisplayname')]");
+ public final String INP_ROLENAME = getProp(casePfx + "inp.rolename",
"//input[contains(@id,'create-role-form:rolename')]");
+
+ public final String LNK_ROLE_CREATE = getProp(casePfx + "lnk.role.create",
"//a[contains(@id, 'create-role-form:create-role-link')]");
+ public final String SUB_DEL_USER = getProp(casePfx + "sub.del.user",
"//input[contains(@id,'delete-user-form:submit')]");
+ public final String SUB_ASSIGN_ROLE = getProp(casePfx + "sub.assign.role",
"//input[contains(@id,'assign-roles-form:submit')]");
+ public final String SUB_USER_ROLE = getProp(casePfx + "sub.user.role",
"//input[contains(@id,'register-role-form:submit')]");
+ public final String SUB_CREATE_USER = getProp(casePfx + "sub.create.user",
"//input[contains(@id,'register-form:submit')]");
+ public final String INP_PASSWORD_CHK = getProp(casePfx + "inp.password.chk",
"//input[contains(@id,'register-form:passwordCheck')]");
+ public final String INP_PASSWORD = getProp(casePfx + "inp.password",
"//input[contains(@id,'register-form:password')]");
+ public final String INP_USEREMAIL = getProp(casePfx + "inp.useremail",
"//input[contains(@id,'register-form:email')]");
+ public final String INP_USERNAME = getProp(casePfx + "inp.username",
"//input[contains(@id,'register-form:username')]");
+ public final String SUB_SEARCH_USER = getProp(casePfx + "sub.search.user",
"//input[contains(@id,'search-user-form:search') and
@type='submit']");
+ public final String INP_SEARCH_USER = getProp(casePfx + "inp.search.user",
"//input[contains(@id,'search-user-form:searchString')]");
+ public final String LNK_SEARCH_USER = getProp(casePfx + "lnk.search.user",
"//a[contains(@id,'user-form:search-user-link')]");
+ public final String LNK_USERTAB = getProp(casePfx + "lnk.usertab",
"//a[contains(@id,'role-temp-form:manage-users')]");
+ public final String LNK_USERMAIN = getProp(casePfx + "lnk.usermain",
"//a[contains(@id,'user-temp-form1:user-adm-link')]");
+
+ public final String LNK_ROLETAB = getProp(casePfx + "lnk.roletab",
"//a[contains(@id,'user-temp-form:role-mgm-link')]");
+
+ public final String LNK_ROLEMAIN = getProp(casePfx + "lnk.rolemain",
"//a[contains(@id, 'role-temp-form1:role-admin-link')]");
+ public final String LNK_USERMANG_MAIN = getProp(casePfx + "lnk.usermang.main",
"//a[contains(@id,'user-temp-form1:assign-role-link')]");
+ public final String LNK_USERMANG_MAIN2 = getProp(casePfx +
"lnk.usermang.main2",
"//a[contains(@id,'user-temp-form1:user-mgm-link')]");
+ public final String LNK_CREATE_USER = getProp(casePfx + "lnk.create.user",
"//a[contains(@id,':user-form:create-user-link')]");
+
+ public final String CHK_ROLE = getProp(casePfx + "chk.role",
"//input[contains(@name,''assign-roles-form:roles'') and
@value=''{0}'']");
+
+ public final long SEARCH_TIMEOUT = 10000;
+
private String butDelUsr_id(String userName) {
- String table = TABLE_USERLIST;
+ String table = TBL_USERLIST;
int r = findTableRow(table, userName, 0);
- return MessageFormat.format(LINK_T_USRLIST_DEL, r - 1);
+ return MessageFormat.format(LNK_T_USRLIST_DEL, r - 1);
}
private String butUsrRol_id(String userName) {
- String table = TABLE_USERLIST;
+ String table = TBL_USERLIST;
int r = findTableRow(table, userName, 0);
- return MessageFormat.format(LINK_T_USRLIST_ROLES, r - 1);
+ return MessageFormat.format(LNK_T_USRLIST_ROLES, r - 1);
}
@BeforeMethod(groups = { "log" })
@@ -93,21 +104,20 @@
@AfterMethod(groups = { "log" })
public void logoutAfterTest() {
-
- }
-/*
- // For this mode to be functional, the user which is logged in must be
"admin" after each test
- @BeforeClass(groups = { "single" })
- public void loginBefore() {
- login("admin", "admin");
}
- @AfterClass(groups = { "single" })
- public void logoutAfter() {
- logout();
- }
-*/
+ /*
+ * // For this mode to be functional, the user which is logged in must be
+ * "admin" after each test
+ *
+ * @BeforeClass(groups = { "single" }) public void loginBefore() {
+ * login("admin", "admin"); }
+ *
+ * @AfterClass(groups = { "single" }) public void logoutAfter() { logout();
+ * }
+ */
+
@Test(enabled = true, description = "Creation of new user.")
public void testCreateUser() {
createUser("tempUser", "tempPassword",
"tempUser(a)redhat.com");
@@ -129,360 +139,367 @@
createRole(role, "tempRoleDisplay");
deleteRole(role);
}
-
+
@Test(enabled = true, description = "Creating and deteling a user.")
public void testDeleteUser() {
createUser("deleteMe", "deleterPass",
"disableMe(a)redhat.com");
deleteUser("deleteMe", "disableMe(a)redhat.com");
}
-
+
@Test(enabled = true, description = "Creating and disabling a user.")
public void testDisableUser() {
- createUser("disableMe", "disablePass",
"disableMe(a)redhat.com");
-
+ final String userName = "disableMe";
+ final String userPass = "disablePass";
+ final String userMail = "disableMe(a)redhat.com";
+
+ createUser(userName, userPass, userMail);
+
logout();
- login("disableMe", "disablePass");
+ login(userName, userPass);
logout();
- login("admin","admin");
-
- searchUser("disableMe", "disableMe(a)redhat.com");
- int r = findTableRow(TABLE_USERLIST, "disableMe", 0);
-
- selenium.click(MessageFormat.format(LINK_T_USRLIST_DIS, r - 1 ));
-
+ login("admin", "admin");
+
+ searchUser(userName, userMail);
+ int r = findTableRow(TBL_USERLIST, userName, 0);
+
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_DIS, r - 1));
+
logout();
-
- //trying to log in with disabled account
+
+ // trying to log in with disabled account
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LINK_LOGIN);
selenium.selectFrame(FRAME_LOGIN_CONTENT);
-
+
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
- selenium.type(INPUT_USERNAME, "disableMe");
- selenium.type(INPUT_PASSWORD, "disablePass");
+
+ selenium.type(INPUT_USERNAME, userName);
+ selenium.type(INPUT_PASSWORD, userPass);
selenium.click(SUBMIT_LOGIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Your account is disabled"));
+ Assert.assertTrue(selenium.isTextPresent("Your account is disabled"),
"Message telling that account is disabled is other then expected or missing.");
// we should be unable to login with disabled account
// logging as user to end the test correctly
-
- login("admin","admin");
-
- deleteUser("disableMe", "disableMe(a)redhat.com");
+
+ login("admin", "admin");
+
+ deleteUser(userName, userMail);
}
-
- @Test(enabled = true, dependsOnMethods = {"testDisableUser"},description =
"Enabling disabled user.")
+
+ @Test(enabled = true, dependsOnMethods = { "testDisableUser" }, description =
"Enabling disabled user.")
public void testEnableUser() {
- createUser("enableMe", "enableMe",
"enableMe(a)redhat.com");
- searchUser("enableMe", "enableMe(a)redhat.com");
-
- int r = findTableRow(TABLE_USERLIST, "Enable", 5);
- Assert.assertTrue(r<0,"No user should be disabled.");
- r = findTableRow(TABLE_USERLIST, "enableMe", 0);
-
- selenium.click(MessageFormat.format(LINK_T_USRLIST_DIS, r - 1 ));
+ final String userName = "enableMe";
+ final String userPass = "enableMe";
+ final String userMail = "enableMe(a)redhat.com";
+ createUser(userName, userPass, userMail);
+ searchUser(userName, userMail);
+
+ int r = findTableRow(TBL_USERLIST, "Enable", 5);
+ Assert.assertTrue(r < 0, "No user should be disabled.");
+ r = findTableRow(TBL_USERLIST, userName, 0);
+
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_DIS, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
-
- searchUser("enableMe", "enableMe(a)redhat.com");
- r = findTableRow(TABLE_USERLIST, "Enable", 5);
- Assert.assertFalse(r<0,"One user should have been disabled.");
- r = findTableRow(TABLE_USERLIST, "enableMe", 0);
- selenium.click(MessageFormat.format(LINK_T_USRLIST_DIS, r - 1 ));
+ searchUser(userName, userMail);
+ r = findTableRow(TBL_USERLIST, "Enable", 5);
+ Assert.assertFalse(r < 0, "One user should have been disabled.");
+
+ r = findTableRow(TBL_USERLIST, userName, 0);
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_DIS, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
-
- searchUser("enableMe", "enableMe(a)redhat.com");
- r = findTableRow(TABLE_USERLIST, "Enable", 5);
- Assert.assertTrue(r<0,"No user should be disabled.");
-
- deleteUser("enableMe", "enableMe(a)redhat.com");
+
+ searchUser(userName, userMail);
+ r = findTableRow(TBL_USERLIST, "Enable", 5);
+ Assert.assertTrue(r < 0, "No user should be disabled.");
+
+ deleteUser(userName, userMail);
}
-
+
@Test(enabled = true, description = "Editing a user.")
public void testEditUser() {
- createUser("editMe", "editPass", "editMe(a)redhat.com");
-
+ final String userName = "editMe";
+ final String userPass = "editPass";
+ final String userMail = "editMe(a)redhat.com";
+
+ createUser(userName, userPass, userMail);
+
// canceling the edit form
- searchUser("editMe", "editMe(a)redhat.com");
-
- int r = findTableRow(TABLE_USERLIST, "editMe", 0);
- selenium.click(MessageFormat.format(LINK_T_USRLIST_EDIT, r - 1));
+ searchUser(userName, userMail);
+
+ int r = findTableRow(TBL_USERLIST, userName, 0);
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_EDIT, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.type(INP_EDIT_USER_EMAIL, "editMe2(a)redhat.com");
selenium.click(SUB_EDIT_USER_EMAIL_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("editMe(a)redhat.com"));
-
+ Assert.assertTrue(selenium.isTextPresent(userMail), "User not visible after
cancelling editing.");
+
// filling out the edit page
- searchUser("editMe", "editMe(a)redhat.com");
-
- r = findTableRow(TABLE_USERLIST, "editMe", 0);
- selenium.click(MessageFormat.format(LINK_T_USRLIST_EDIT, r - 1));
- selenium.waitForPageToLoad(PAGE_LOAD);
-
+ searchUser(userName, userMail);
+
+ r = findTableRow(TBL_USERLIST, userName, 0);
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_EDIT, r - 1));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
selenium.type(INP_EDIT_USER_EMAIL, "editMe2(a)redhat.com");
/*
- selenium.select("profile-form:timezone", "label=(GMT -12:00 hours)
Eniwetok, Kwajalein");
- selenium.select("profile-form:theme", "label=portal.industrial");
- selenium.select("profile-form:locale", "label=Albanian");
- selenium.type("profile-form:givenname", "Edit");
- selenium.type("profile-form:lastname", "Meme");
- selenium.type("profile-form:location", "Editoland");
- selenium.type("profile-form:skype", "editor");
- selenium.type("profile-form:icq", "112113114");
- selenium.type("profile-form:aim", "83838495");
- selenium.type("profile-form:msnm", "u8u8i9o0");
- selenium.type("profile-form:yim", "99384875");
- selenium.type("profile-form:xmmp", "10309128");
- selenium.type("profile-form:homepage", "http://www.edit.com");
- selenium.type("profile-form:occupation", "editor");
- selenium.type("profile-form:interests", "editing");
- selenium.type("profile-form:signature", "----\n\ni like to edit");
- selenium.type("profile-form:extra", "me edit good");
- */
+ * selenium.select("profile-form:timezone",
+ * "label=(GMT -12:00 hours) Eniwetok, Kwajalein");
+ * selenium.select("profile-form:theme",
"label=portal.industrial");
+ * selenium.select("profile-form:locale", "label=Albanian");
+ * selenium.type("profile-form:givenname", "Edit");
+ * selenium.type("profile-form:lastname", "Meme");
+ * selenium.type("profile-form:location", "Editoland");
+ * selenium.type("profile-form:skype", "editor");
+ * selenium.type("profile-form:icq", "112113114");
+ * selenium.type("profile-form:aim", "83838495");
+ * selenium.type("profile-form:msnm", "u8u8i9o0");
+ * selenium.type("profile-form:yim", "99384875");
+ * selenium.type("profile-form:xmmp", "10309128");
+ * selenium.type("profile-form:homepage", "http://www.edit.com");
+ * selenium.type("profile-form:occupation", "editor");
+ * selenium.type("profile-form:interests", "editing");
+ * selenium.type("profile-form:signature", "----\n\ni like to
edit");
+ * selenium.type("profile-form:extra", "me edit good");
+ */
selenium.click(SUB_EDIT_PROF);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("editMe2(a)redhat.com"));
- Assert.assertTrue(selenium.isTextPresent("Edit"));
-
- deleteUser("editMe", "editMe2(a)redhat.com");
-
+ Assert.assertTrue(selenium.isTextPresent("editMe2(a)redhat.com"), "Edited
e-mail adress not visible.");
+
+ deleteUser(userName, "editMe2(a)redhat.com");
+
}
-
+
@Test(enabled = true, description = "Editing a user - changing of password.")
public void testEditUserChangePassword() {
- createUser("changePass", "changePassPass",
"changePass(a)redhat.com");
-
+ final String userName = "changePass";
+ final String userPass = "changePassPass";
+ final String userPass2 = "changePass2";
+ final String userMail = "changePass(a)redhat.com";
+
+ createUser(userName, userPass, userMail);
+
logout();
- login("changePass","changePassPass");
+ login(userName, userPass);
logout();
- login("admin","admin");
-
- /*
- * Canceling of change at the first approach
- */
-
- searchUser("changePass", "changePass(a)redhat.com");
-
-
- int r = findTableRow(TABLE_USERLIST, "changePass", 0);
- selenium.click(MessageFormat.format(LINK_T_USRLIST_EDIT, r - 1));
+ login("admin", "admin");
+
+ // Canceling of change at the first approach
+
+ searchUser(userName, userMail);
+
+ int r = findTableRow(TBL_USERLIST, userName, 0);
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_EDIT, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(LINK_CHANGE_PASS);
+ selenium.click(LNK_CHANGE_PASS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INPUT_PASS_CHANGE_P1, "changePass2");
- selenium.type(INPUT_PASS_CHANGE_P2, "changePass2");
+ selenium.type(INP_PASS_CHANGE_P1, userPass2);
+ selenium.type(INP_PASS_CHANGE_P2, userPass2);
selenium.click(SUB_PASS_CHANGE_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertFalse(selenium.isTextPresent("Password has been updated."));
-
+
+ Assert.assertFalse(selenium.isTextPresent("Password has been updated."),
"Message telling that password has changed appeared after cancel.");
+
logout();
- login("changePass","changePassPass");
+ login(userName, userPass);
logout();
- login("admin","admin");
-
- /*
- * In the second approach really change the password
- */
-
- searchUser("changePass", "changePass(a)redhat.com");
-
- r = findTableRow(TABLE_USERLIST, "changePass", 0);
- selenium.click(MessageFormat.format(LINK_T_USRLIST_EDIT, r - 1));
+ login("admin", "admin");
+
+ // In the second approach really change the password
+
+ searchUser(userName, userMail);
+
+ r = findTableRow(TBL_USERLIST, userName, 0);
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_EDIT, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(LINK_CHANGE_PASS);
+ selenium.click(LNK_CHANGE_PASS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INPUT_PASS_CHANGE_P1, "changePass2");
- selenium.type(INPUT_PASS_CHANGE_P2, "changePass2");
+ selenium.type(INP_PASS_CHANGE_P1, userPass2);
+ selenium.type(INP_PASS_CHANGE_P2, userPass2);
selenium.click(SUB_PASS_CHANGE_SUBMIT);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertTrue(selenium.isTextPresent("Password has been updated."));
-
+
+ Assert.assertTrue(selenium.isTextPresent("Password has been updated."),
"Message telling that password has changed other then expected or missing.");
+
logout();
- login("changePass","changePass2");
+ login(userName, userPass2);
logout();
- login("admin","admin");
-
- deleteUser("changePass","changePass(a)redhat.com");
+ login("admin", "admin");
+
+ deleteUser(userName, userMail);
}
-
+
@Test(enabled = true, description = "Managing members of role.")
public void testRoleMembers() {
- createRole("membersRole", "membersRoleDisplay");
- createUser("newRoleMember" , "newRoleMember",
"newRoleMem(a)redhatqa.com");
- assignRole("newRoleMember", "newRoleMem(a)redhatqa.com",
"membersRole", "membersRoleDisplay");
-
+ final String roleName = "membersRole";
+ final String roleDisplayName = "membersRoleDisplay";
+ final String userName = "newRoleMember";
+ final String userMail = "newRoleMem(a)redhatqa.com";
+ final String invalidMember = "newRoleNonMember";
+
+ createRole(roleName, roleDisplayName);
+ createUser(userName, userName, userMail);
+ assignRole(userName, userMail, roleName, roleDisplayName);
+
clickUntilMembers();
- clickIfVisible(ID_LINK_ROLETAB);
- clickIfVisible(ID_LINK_ROLEMAIN);
-
- int r = findTableRow(TABLE_ROLELIST, "membersRole", 0);
- selenium.click(MessageFormat.format(LINK_T_ROLLIST_MEMBERS, r-1));
+ clickIfVisible(LNK_ROLETAB);
+ clickIfVisible(LNK_ROLEMAIN);
+
+ int r = findTableRow(TBL_ROLELIST, roleName, 0);
+ selenium.click(MessageFormat.format(LNK_T_ROLLIST_MEMBERS, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
-
- //search for the real member of current role
- selenium.type(INP_ROLE_SEARCH_USER, "newRoleMember");
+
+ // search for the real member of current role
+ selenium.type(INP_ROLE_SEARCH_USER, userName);
selenium.click(SUB_ROLE_SEARCH_USER);
waitFor(10000);
-
- r = findTableRow(TABLE_ROLEMEMBERS, "newRoleMember", 0);
- Assert.assertTrue(r>0, "Assigned member not found in the role members
table.");
-
- //search for the non-member user of current role
- selenium.type(INP_ROLE_SEARCH_USER, "newRoleNonMember");
+
+ r = findTableRow(TBL_ROLEMEMBERS, userName, 0);
+ Assert.assertTrue(r > 0, "Assigned member not found in the role members
table.");
+
+ // search for the non-member user of current role
+ selenium.type(INP_ROLE_SEARCH_USER, invalidMember);
selenium.click(SUB_ROLE_SEARCH_USER);
waitFor(10000);
-
- Assert.assertFalse(selenium.isElementPresent(TABLE_ROLEMEMBERS), "Not assigned
member found in the role members table.");
-
- deleteRole("membersRole");
- deleteUser("newRoleMember" , "newRoleMem(a)redhatqa.com");
+
+ Assert.assertFalse(selenium.isElementPresent(TBL_ROLEMEMBERS), "Not assigned
member found in the role members table.");
+
+ deleteRole(roleName);
+ deleteUser(userName, userMail);
}
-
+
@Test(enabled = true, description = "Creation of new role.")
public void testRoleEdit() {
-
- createRole("editRole", "editRoleDisplay");
-
+ final String roleName = "editRole";
+ final String roleDisplayName = "editRoleDisplay";
+ final String roleDisplayNameEditet = "editedRoleDisplay";
+
+ createRole(roleName, roleDisplayName);
+
clickUntilMembers();
- clickIfVisible(ID_LINK_ROLETAB);
- clickIfVisible(ID_LINK_ROLEMAIN);
-
- int r = findTableRow(TABLE_ROLELIST, "editRoleDisplay", 1);
- Assert.assertTrue(r>=0,"Renamed display name found in table");
-
- r = findTableRow(TABLE_ROLELIST, "editedRoleDisplay", 1);
- Assert.assertFalse(r>=0,"Not created role display name found in table");
-
- //canceling of renaming of displayname for the first time
- r = findTableRow(TABLE_ROLELIST, "editRole", 0);
-
- selenium.click(MessageFormat.format(LINK_T_ROLLIST_EDIT, r -1));
+ clickIfVisible(LNK_ROLETAB);
+ clickIfVisible(LNK_ROLEMAIN);
+
+ int r = findTableRow(TBL_ROLELIST, roleDisplayName, 1);
+ Assert.assertTrue(r >= 0, "Renamed display name found in table");
+
+ r = findTableRow(TBL_ROLELIST, roleDisplayNameEditet, 1);
+ Assert.assertFalse(r >= 0, "Not created role display name found in
table");
+
+ // canceling of renaming of displayname for the first time
+ r = findTableRow(TBL_ROLELIST, roleName, 0);
+
+ selenium.click(MessageFormat.format(LNK_T_ROLLIST_EDIT, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selenium.type(INP_EDIT_ROLE_NAME, "editedRoleDisplay");
+
+ selenium.type(INP_EDIT_ROLE_NAME, roleDisplayNameEditet);
selenium.click(SUB_EDIT_ROLE_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- r = findTableRow(TABLE_ROLELIST, "editRoleDisplay", 1);
- Assert.assertTrue(r>=0,"Renamed display name found in table");
-
- r = findTableRow(TABLE_ROLELIST, "editedRoleDisplay", 1);
- Assert.assertFalse(r>=0,"Not created role display name found in table");
-
+
+ r = findTableRow(TBL_ROLELIST, roleDisplayName, 1);
+ Assert.assertTrue(r >= 0, "Renamed display name found in table");
+
+ r = findTableRow(TBL_ROLELIST, roleDisplayNameEditet, 1);
+ Assert.assertFalse(r >= 0, "Not created role display name found in
table");
+
// real renaming
- r = findTableRow(TABLE_ROLELIST, "editRole", 0);
- selenium.click(MessageFormat.format(LINK_T_ROLLIST_EDIT, r-1));
+ r = findTableRow(TBL_ROLELIST, roleName, 0);
+ selenium.click(MessageFormat.format(LNK_T_ROLLIST_EDIT, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selenium.type(INP_EDIT_ROLE_NAME, "editedRoleDisplay");
+
+ selenium.type(INP_EDIT_ROLE_NAME, roleDisplayNameEditet);
selenium.click(SUB_EDIT_ROLE_SUBMIT);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- r = findTableRow(TABLE_ROLELIST, "editRoleDisplay", 1);
- Assert.assertFalse(r>=0,"Renamed display name found in table");
-
- r = findTableRow(TABLE_ROLELIST, "editedRoleDisplay", 1);
- Assert.assertTrue(r>=0,"New role display name not found in table");
-
- deleteRole("editRole");
+
+ r = findTableRow(TBL_ROLELIST, roleDisplayName, 1);
+ Assert.assertFalse(r >= 0, "Renamed display name found in table");
+
+ r = findTableRow(TBL_ROLELIST, roleDisplayNameEditet, 1);
+ Assert.assertTrue(r >= 0, "New role display name not found in table");
+
+ deleteRole(roleName);
}
-
- @Test(enabled= false, description = "Altering the number of rows in user
search")
- public void testSearchUserCount() {
-
- for(int i=0; i< 95; i++){
- createUser("man"+i+"us", "man"+i+"pas",
"man"+i+"us"+"(a)redhatqa.com");
- }
-
- searchSimple("man","10");
- Assert.assertEquals(countTableRows(TABLE_USERLIST)-1,10,"Wrong number of row in
user table #1.");
-
- searchSimple("man","50");
- Assert.assertEquals(countTableRows(TABLE_USERLIST)-1,50,"Wrong number of row in
user table #2.");
- selenium.click("search-user-form1:next-page");
- selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertEquals(countTableRows(TABLE_USERLIST)-1,45,"Wrong number of row in
user table #3.");
- selenium.click("search-user-form1:prev-page");
- selenium.waitForPageToLoad(PAGE_LOAD);
-
- searchSimple("man","100");
- Assert.assertEquals(countTableRows(TABLE_USERLIST)-1,95,"Wrong number of row in
user table #4.");
- /*
- for(int i=0; i< 95; i++){
- deleteUser("man"+i+"us",
"man"+i+"us"+"(a)redhatqa.com");
+
+ @Test(enabled = false)
+ public void testManyUsers() {
+ for (int i = 0; i < 25; i++) {
+ createUser("user0" + i + "", "useruser",
"user0" + i + "" + "(a)portal.com");
}
- */
-
}
-
- private void searchSimple(String name, String count){
- selenium.open("/portal/");
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Members");
- selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_USERTAB);
- clickIfVisible(ID_LINK_USERMAIN);
- clickIfVisible(LINK_USERMANG_MAIN);
+ @Test(enabled = true, description = "Altering the number of rows in user
search")
+ public void testSearchUserCount() {
- selenium.click(LINK_SEARCH_USER);
+ for (int i = 0; i < 95; i++) {
+ createUser("man" + i + "us", "man" + i +
"pas", "man" + i + "us" + "(a)redhatqa.com");
+ }
+
+ searchSimple("man", "10");
+ Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 10, "Wrong number of row in
user table #1.");
+
+ searchSimple("man", "50");
+ Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 50, "Wrong number of row in
user table #2.");
+ selenium.click(INP_USER_SEARCH_NEXT);
selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 45, "Wrong number of row in
user table #3.");
+ selenium.click(INP_USER_SEARCH_PREV);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 50, "Wrong number of row in
user table #2.");
+
+ searchSimple("man", "100");
+ //selenium.setSpeed("60000");
+ Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 95, "Wrong number of row in
user table #4.");
+ //selenium.setSpeed("0");
+ /*
+ * for(int i=0; i< 95; i++){ deleteUser("man"+i+"us",
+ * "man"+i+"us"+"(a)redhatqa.com"); }
+ */
- selenium.type(ID_INPUT_SEARCH_USER, name);
- selenium.select("search-user-form:limit", "label="+count);
- selenium.click(ID_SUBMIT_SEARCH_USER);
- //selenium.waitForPageToLoad(PAGE_LOAD);
- waitBlock();
}
-
@Test(enabled = true, dependsOnMethods = { "testCreateUser",
"testCreateRole" }, description = "Assigning of the role to the
user.")
public void testAssignRole2User() {
String user = "tempUser";
String userMail = "tempUser(a)redhat.com";
String role = "tempRole";
- String roleDisplay = "tempRoleDisplay";
+ final String roleDisplayName = "tempRoleDisplay";
+ final String userPass = "tempPassword";
- createUser(user, "tempPassword", userMail);
- createRole(role, "tempRoleDisplay");
- assignRole(user, userMail, role, roleDisplay);
+ createUser(user, userPass, userMail);
+ createRole(role, roleDisplayName);
+ assignRole(user, userMail, role, roleDisplayName);
- deassignRole(user, userMail, role, roleDisplay);
+ deassignRole(user, userMail, role, roleDisplayName);
deleteRole(role);
deleteUser(user, userMail);
}
- void assignRole(String user, String email, String role, String roleDisplay) {
+ void assignRole(String userName, String userMail, String roleName, String
roleDisplayName) {
- searchUser(user, email);
- selenium.click(butUsrRol_id(user));
+ searchUser(userName, userMail);
+ selenium.click(butUsrRol_id(userName));
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: "
+ roleDisplay + " not found on the page.");
+ Assert.assertTrue(selenium.isTextPresent(roleDisplayName), "Role display name:
" + roleDisplayName + " not found on the page.");
- final String CHECK_ROLE = MessageFormat.format(ID_CHECK_ROLE, role);
+ final String CHECK_ROLE = MessageFormat.format(CHK_ROLE, roleName);
selenium.click(CHECK_ROLE);
- selenium.click(ID_SUBMIT_ASSIGN_ROLE);
+ selenium.click(SUB_ASSIGN_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
- searchUser(user, email);
+ searchUser(userName, userMail);
- selenium.click(butUsrRol_id(user));
+ selenium.click(butUsrRol_id(userName));
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isChecked(CHECK_ROLE), "The role wasn't correctly
assigned.");
@@ -497,10 +514,10 @@
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: "
+ roleDisplay + " not found on the page.");
// check the tempRole check box
- final String CHECK_ROLE = MessageFormat.format(ID_CHECK_ROLE, role);
+ final String CHECK_ROLE = MessageFormat.format(CHK_ROLE, role);
selenium.click(CHECK_ROLE);
- selenium.click(ID_SUBMIT_ASSIGN_ROLE);
+ selenium.click(SUB_ASSIGN_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
searchUser(user, email);
@@ -511,7 +528,7 @@
}
- void createUser(String username, String password, String email) {
+ void createUser(String userName, String userPass, String userMail) {
selenium.open("/portal/auth/portal/default");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -521,30 +538,30 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_USERTAB);
- clickIfVisible(ID_LINK_USERMAIN);
- selenium.click(ID_LINK_CREATE_USER);
+ clickIfVisible(LNK_USERTAB);
+ clickIfVisible(LNK_USERMAIN);
+ selenium.click(LNK_CREATE_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Username *"), "Label for
username input is wrong or missing.");
- selenium.type(ID_INPUT_USERNAME, username);
+ selenium.type(INP_USERNAME, userName);
Assert.assertTrue(selenium.isTextPresent("E-Mail *"), "Label for e-mail
input is wrong or missing.");
- selenium.type(ID_INPUT_USEREMAIL, email);
+ selenium.type(INP_USEREMAIL, userMail);
Assert.assertTrue(selenium.isTextPresent("Password *"), "Label for
password input is wrong or missing.");
- selenium.type(ID_INPUT_PASSWORD, password);
+ selenium.type(INP_PASSWORD, userPass);
Assert.assertTrue(selenium.isTextPresent("Confirm Password *"), "Label
for password confirm input is wrong or missing.");
- selenium.type(ID_INPUT_PASSWORD_CHK, password);
+ selenium.type(INP_PASSWORD_CHK, userPass);
- selenium.click(ID_SUBMIT_CREATE_USER);
+ selenium.click(SUB_CREATE_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("This username is already taken.
tempUser"), "User already exists.");
- selenium.click(ID_SUBMIT_USER_ROLE);
+ selenium.click(SUB_USER_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Confirmation"), "Confirmation
screen is missing or corrupted.");
- selenium.click(ID_SUBMIT_CONF_CREATE_USER);
+ selenium.click(SUB_CONF_CREATE_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("User created"), "User was not
created (\"User created\" text missing).");
@@ -559,24 +576,22 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_USERMAIN);
+ clickIfVisible(LNK_USERMAIN);
- selenium.click(ID_LINK_CREATE_USER);
+ selenium.click(LNK_CREATE_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(ID_INPUT_USERNAME, username);
- selenium.type(ID_INPUT_USEREMAIL, email);
- selenium.type(ID_INPUT_PASSWORD, password);
- selenium.type(ID_INPUT_PASSWORD_CHK, password);
- selenium.click(ID_SUBMIT_CREATE_USER);
+ selenium.type(INP_USERNAME, username);
+ selenium.type(INP_USEREMAIL, email);
+ selenium.type(INP_PASSWORD, password);
+ selenium.type(INP_PASSWORD_CHK, password);
+ selenium.click(SUB_CREATE_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert
- .assertTrue(selenium.isTextPresent("This username is already taken."),
- "No user was overwritten, current username wasn't already taken.");
+ Assert.assertTrue(selenium.isTextPresent("This username is already taken."),
"No user was overwritten, current username wasn't already taken.");
}
- void searchUser(String username, String email) {
+ void searchUser(String userName, String userMail) {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
@@ -584,21 +599,44 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_USERTAB);
- clickIfVisible(ID_LINK_USERMAIN);
- clickIfVisible(LINK_USERMANG_MAIN);
+ clickIfVisible(LNK_USERTAB);
+ clickIfVisible(LNK_USERMAIN);
+ clickIfVisible(LNK_USERMANG_MAIN);
- selenium.click(LINK_SEARCH_USER);
+ selenium.click(LNK_SEARCH_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(ID_INPUT_SEARCH_USER, username);
- selenium.click(ID_SUBMIT_SEARCH_USER);
- //selenium.waitForPageToLoad(PAGE_LOAD);
- waitBlock();
- Assert.assertTrue(selenium.isTextPresent(username), "Username was not
found.");
- Assert.assertTrue(selenium.isTextPresent(email), "User email adress was not
found.");
+ selenium.type(INP_SEARCH_USER, userName);
+
+ selenium.click(SUB_SEARCH_USER);
+ waitFor(SEARCH_TIMEOUT);
+ if (!selenium.isTextPresent(userName) && !selenium.isTextPresent(userMail))
+ paginate(userName, userMail);
+
+ Assert.assertTrue(selenium.isTextPresent(userName), "Username was not
found.");
+ Assert.assertTrue(selenium.isTextPresent(userMail), "User email adress was not
found.");
}
+ private void paginate(String userName, String userMail) {
+
+ while (selenium.isElementPresent(SUB_PAGIN_RIGHT)) {
+ selenium.click(SUB_PAGIN_RIGHT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ if (selenium.isTextPresent(userName) && selenium.isTextPresent(userMail))
+ return;
+ }
+
+ while (selenium.isElementPresent(SUB_PAGIN_LEFT)) {
+ selenium.click(SUB_PAGIN_RIGHT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ if (selenium.isTextPresent(userName) && selenium.isTextPresent(userMail))
+ return;
+ }
+
+ }
+
private void deleteUser(String username, String email) {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -607,30 +645,30 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_USERTAB);
+ clickIfVisible(LNK_USERTAB);
// user home page
- clickIfVisible(ID_LINK_USERMAIN);
- clickIfVisible(LINK_USERMANG_MAIN);
- clickIfVisible(LINK_USERMANG_MAIN2);
+ clickIfVisible(LNK_USERMAIN);
+ clickIfVisible(LNK_USERMANG_MAIN);
+ clickIfVisible(LNK_USERMANG_MAIN2);
- selenium.click(LINK_SEARCH_USER);
+ selenium.click(LNK_SEARCH_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(ID_INPUT_SEARCH_USER, username);
- selenium.click(ID_SUBMIT_SEARCH_USER);
- //selenium.waitForPageToLoad(PAGE_LOAD);
- waitBlock();
+ selenium.type(INP_SEARCH_USER, username);
+ selenium.click(SUB_SEARCH_USER);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ waitFor(SEARCH_TIMEOUT);
Assert.assertTrue(selenium.isTextPresent(username), "Username was not
found.");
Assert.assertTrue(selenium.isTextPresent(email), "User e-mail adress was not
found.");
selenium.click(butDelUsr_id(username));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(ID_BUT_SUBMIT_DEL_USER);
+ selenium.click(SUB_DEL_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("User deleted"), "user was not
deleted (\"User deleted\" text missing).");
}
- private void clickUntilMembers(){
+ private void clickUntilMembers() {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
@@ -638,7 +676,7 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
}
-
+
private void createRole(String roleName, String roleDisplayName) {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -647,19 +685,19 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_ROLETAB);
- clickIfVisible(ID_LINK_ROLEMAIN);
+ clickIfVisible(LNK_ROLETAB);
+ clickIfVisible(LNK_ROLEMAIN);
- Assert.assertTrue(selenium.isElementPresent(ID_BUT_ROLE_CREATE), "Button for role
creating has wrong id or doesn't exist.");
- Assert.assertEquals(selenium.getText(ID_BUT_ROLE_CREATE), "Create role",
"Button for role creating has wrong label.");
- selenium.click(ID_BUT_ROLE_CREATE);
+ Assert.assertTrue(selenium.isElementPresent(LNK_ROLE_CREATE), "Button for role
creating has wrong id or doesn't exist.");
+ Assert.assertEquals(selenium.getText(LNK_ROLE_CREATE), "Create role",
"Button for role creating has wrong label.");
+ selenium.click(LNK_ROLE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Role"), "Label for role name
not present or incorrect.");
- selenium.type(ID_INPUT_ROLENAME, roleName);
+ selenium.type(INP_ROLENAME, roleName);
Assert.assertTrue(selenium.isTextPresent("Display name"), "Label for
display role name not present or incorrect.");
- selenium.type(ID_INPUT_ROLEDISNAME, roleDisplayName);
- selenium.click(ID_SUBMIT_ROLE_CREATE);
+ selenium.type(INP_ROLEDISNAME, roleDisplayName);
+ selenium.click(SUB_ROLE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(roleName), "Name of newly created role is
missing.");
@@ -674,31 +712,45 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_ROLETAB);
- clickIfVisible(ID_LINK_ROLEMAIN);
+ clickIfVisible(LNK_ROLETAB);
+ clickIfVisible(LNK_ROLEMAIN);
Assert.assertTrue(selenium.isTextPresent(roleName), "Role name is missing");
- int r = findTableRow(TABLE_ROLELIST, roleName, 0);
- selenium.click(MessageFormat.format(LINK_T_ROLLIST_DEL, r-1));
+ int r = findTableRow(TBL_ROLELIST, roleName, 0);
+ selenium.click(MessageFormat.format(LNK_T_ROLLIST_DEL, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Warning! You are about to delete the
role '" + roleName+"'"),
+ Assert.assertTrue(selenium.isTextPresent("Warning! You are about to delete the
role '" + roleName + "'"),
"Confirmation text for role deletion missing missing.");
- selenium.click(ID_SUBMIT_DELETE_ROLE);
+ selenium.click(SUB_DELETE_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
}
-
- protected void waitBlock(){
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+
+ private void searchSimple(String name, String count) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Members");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(LNK_USERTAB);
+ clickIfVisible(LNK_USERMAIN);
+ clickIfVisible(LNK_USERMANG_MAIN);
+
+ selenium.click(LNK_SEARCH_USER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.select(SEL_SEARCHUSER_LIMIT, "label=" + count);
+ //waitFor(SEARCH_TIMEOUT);
+ selenium.type(INP_SEARCH_USER, name);
+ selenium.click(SUB_SEARCH_USER);
+ waitFor(SEARCH_TIMEOUT);
+
}
}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -1,9 +1,8 @@
package org.jboss.portal.test.selenium;
-import java.io.BufferedWriter;
-import java.io.FileWriter;
import java.io.IOException;
-import java.io.PrintWriter;
+import java.io.InputStream;
+import java.util.Properties;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
@@ -16,30 +15,50 @@
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
public class JBossPortalSeleniumTestCase {
- public static final String LINK_LOGOUT = "link=Logout";
- public static final String SUBMIT_LOGIN = "login";
- public static final String ADDR_PORTAL = "/portal/";
- public static final String FRAME_LOGIN_CONTENT = "login-content";
- public static final String LINK_LOGIN = "link=Login";
- public static final String INPUT_PASSWORD = "j_password";
- public static final String INPUT_USERNAME = "j_username";
+
+ private String casePfx = "portal.";
+ private String debugDir = "debug";
+
+ static {
+ try {
+ props = getProperties();
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+
+ public final String LINK_LOGOUT = getProp(casePfx + "link.logout",
"link=Logout");
+ public final String SUBMIT_LOGIN = getProp(casePfx + "submit.login",
"login");
+ public final String ADDR_PORTAL = getProp(casePfx + "addr.portal",
"/portal/");
+ public final String FRAME_LOGIN_CONTENT = getProp(casePfx +
"frame.login.content", "login-content");
+ public final String LINK_LOGIN = getProp(casePfx + "link.login",
"link=Login");
+ public final String INPUT_PASSWORD = getProp(casePfx + "input.password",
"j_password");
+ public final String INPUT_USERNAME = getProp(casePfx + "input.username",
"j_username");
+
+ protected static Properties props;
protected Selenium selenium;
// Generic timeout in miliseconds
protected static final String PAGE_LOAD = "2400000";
+ protected static final long AJAX_LOAD = 3000;
+ // protected static final String PAGE_LOAD = "60000";
+ // protected static final long AJAX_LOAD = 2000;
+
// Element timeout in seconds
protected static final int ELEM_TIMEOUT = 220;
@BeforeClass
public void setupChromeForLogin() throws Exception {
+
String browser = System.getProperty("browser");
selenium = new DefaultSelenium("127.0.0.1", 44444, browser,
"http://localhost:8080/portal/");
- JBossSeleniumTestListener.selenium = selenium;
+ JBossSeleniumTestListener.selenium = selenium;
selenium.start();
selenium.setTimeout(PAGE_LOAD);
+ selenium.setSpeed("0");
}
@AfterClass
@@ -47,40 +66,46 @@
selenium.stop();
}
- protected void clickIfVisible(String id) {
+ private static Properties getProperties() throws IOException {
+ ClassLoader cl = ClassLoader.getSystemClassLoader();
+ InputStream is =
cl.getResourceAsStream("org/jboss/portal/test/selenium/locator.properties");
+ Properties props = new Properties();
+ props.load(is);
+ if (props == null) {
+ is =
JBossPortalSeleniumTestCase.class.getResourceAsStream("org/jboss/portal/test/selenium/locator.properties");
+ props.load(is);
+ }
+ if (props == null) {
+ // System.out.println("still null");
+ }
- if (selenium.isElementPresent(id)) {
- selenium.click(id);
+ return props;
+ }
- selenium.waitForPageToLoad(PAGE_LOAD);
+ protected String getProp(String prop, String subst) {
+
+ if (subst == null || "".equals(subst)) {
+ subst = "Locator not set";
}
+
+ if (props == null) {
+ // System.out.println("props null");
+ return subst;
+ } else {
+ // System.out.println("! props null");
+ return props.getProperty(prop) != null ? props.getProperty(prop) : subst;
+ }
}
- protected void clickIfVisible(String id, String awaited) {
+ protected void clickIfVisible(String id) {
if (selenium.isElementPresent(id)) {
selenium.click(id);
+
selenium.waitForPageToLoad(PAGE_LOAD);
}
- Assert.assertTrue(selenium.isTextPresent(awaited));
}
- @Deprecated
- protected boolean findLink(String id) {
- for (String link : selenium.getAllLinks()) {
- if (link.equals(id)) {
- return true;
- }
- }
- for (String link : selenium.getAllFields()) {
- if (link.equals(id)) {
- return true;
- }
- }
-
- return false;
- }
-
protected int findTableRow(String tableLocation, String searchName, int searchCol) {
return Integer.valueOf(selenium.getEval("selenium.findTableRow(\"" +
tableLocation + "\",'" + searchName + "'," + searchCol +
")"));
}
@@ -107,8 +132,9 @@
}
}
- if (isAvailable)
+ if (isAvailable) {
break;
+ }
} catch (Exception e) {
}
waitFor(1000);
@@ -155,36 +181,24 @@
Assert.fail("Element " + locator + " not found.");
}
try {
- if (selenium.isElementPresent(locator))
+ if (selenium.isElementPresent(locator)) {
break;
+ }
} catch (Exception e) {
}
waitFor(1000);
}
}
-
- protected void waitForElement(String locator, boolean toFind) {
- for (int second = 0;; second++) {
- if (second >= ELEM_TIMEOUT) {
- Assert.fail("Element " + locator + " not found.");
- }
- try {
- if (selenium.isElementPresent(locator))
- break;
- } catch (Exception e) {
- }
- waitFor(1000);
- }
- }
-
+
protected void waitForElement(String locatorElem, String locatorLink, long timeToWait,
long n) {
for (int i = 0;; i++) {
if (i >= n) {
Assert.fail("Element " + locatorElem + " not found.");
}
try {
- if (selenium.isElementPresent(locatorElem))
+ if (selenium.isElementPresent(locatorElem)) {
break;
+ }
} catch (Exception e) {
}
waitFor(1000);
@@ -197,14 +211,15 @@
Assert.fail("Text '" + text + "' not found.");
}
try {
- if (selenium.isTextPresent(text))
+ if (selenium.isTextPresent(text)) {
break;
+ }
} catch (Exception e) {
}
- waitFor(1000);
+ waitFor(100);
}
}
-
+
protected void login(String username, String password) {
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -244,15 +259,15 @@
Assert.assertTrue(selenium.isElementPresent("Link=Login"), "Login link
not present.");
}
}
-
- protected void savePage(String filename) {
- try {
- PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(filename)));
- out.print(selenium.getHtmlSource());
- out.close();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+
+ protected void debugPrint(String debugText) {
+ if (JBossSeleniumTestListener.debug)
+ System.out.println("[Selenium debug] : " + debugText);
}
+
+ protected void debugScreenshot(String filename) {
+ if (JBossSeleniumTestListener.debug)
+ selenium.captureScreenshot(debugDir + "/" + filename);
+ }
+
}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSelenium.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSelenium.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSelenium.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -159,5 +159,14 @@
protected int countTableRows(String tableLocation) {
return Integer.valueOf(getEval("selenium.countTableRows(\"" +
tableLocation + "\")"));
}
+
+ protected void waitFor(long time){
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSeleniumTestListener.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSeleniumTestListener.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSeleniumTestListener.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -1,16 +1,10 @@
package org.jboss.portal.test.selenium;
-import java.awt.event.InputMethodEvent;
-import java.awt.event.InputMethodListener;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
-import java.util.List;
-import org.testng.IMethodInstance;
-import org.testng.IMethodInterceptor;
-import org.testng.ITestContext;
import org.testng.ITestResult;
import org.testng.TestListenerAdapter;
@@ -23,6 +17,8 @@
protected static int count;
protected static boolean screenshot = false;
protected static boolean htmlSource = false;
+ protected static boolean debug = false;
+ protected static String outputDir = "";
static {
String ss = System.getProperty("screenshot");
@@ -34,13 +30,23 @@
if ("true".equals(sh)) {
htmlSource = true;
}
+
+ String sd = System.getProperty("debug");
+ if ("true".equals(sd)) {
+ debug = true;
+ }
+
+ String so = System.getProperty("output-dir");
+ if (so != null) {
+ outputDir = so;
+ }
}
@Override
public void onTestFailure(ITestResult tr) {
- String name = "F_" + tr.getName() + "-" + count;
-
+ String name = outputDir +"/"+ "F_" + tr.getName() + "-" +
count;
+
if (htmlSource) {
try {
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(name +
".html")));
@@ -50,7 +56,7 @@
e1.printStackTrace();
}
}
- if (screenshot){
+ if (screenshot) {
try {
selenium.windowMaximize();
selenium.captureScreenshot(name + ".jpg");
Added:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalAjaxSamplesTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalAjaxSamplesTestCase.java
(rev 0)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalAjaxSamplesTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -0,0 +1,474 @@
+package org.jboss.portal.test.selenium;
+
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+
+@Test(groups = { "test_samples" }, enabled = true)
+public class PortalAjaxSamplesTestCase extends JBossPortalSeleniumTestCase {
+
+ public static long AJAX_TIMEOUT = 4500;
+
+ public static String casePfx = "samples.ajax.";
+
+ private final String SES_LNK_INVALIDATE =
getProp(casePfx+"ses.lnk.invalidate","link=invalidate");
+ private final String RES_DIV_RTEXT =
getProp(casePfx+"res.div.rtext","repeat-text");
+ private final String RES_DIV_PTEXT =
getProp(casePfx+"res.div.ptext","product-text");
+ private final String RES_LNK_P3 =
getProp(casePfx+"res.lnk.p3","link=Product3");
+ private final String RES_LNK_P2 =
getProp(casePfx+"res.lnk.p2","link=Product2");
+ private final String RES_LNK_P1 =
getProp(casePfx+"res.lnk.p1","link=Product1");
+ private final String RES_INP = getProp(casePfx+"res.inp","repeat");
+ private final String RES_LNK =
getProp(casePfx+"res.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[17]/a");
+ private final String WIN_DIV_CON =
getProp(casePfx+"win.div.con","//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div");
+ private final String WIN_LNK =
getProp(casePfx+"win.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[16]/a");
+ private final String SES_TAB_PSCOPE =
getProp(casePfx+"ses.tab.pscope","//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/table");
+ private final String SES_TAB_ASCOPE =
getProp(casePfx+"ses.tab.ascope","//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/table[2]");
+ private final String SES_SUB_ASCOPE =
getProp(casePfx+"ses.sub.ascope","application");
+ private final String SES_SUB_PSCOPE =
getProp(casePfx+"ses.sub.pscope","portlet");
+ private final String SES_INP_VAL =
getProp(casePfx+"ses.inp.val","value");
+ private final String SES_INP_NAM =
getProp(casePfx+"ses.inp.nam","name");
+ private final String SES_LNK =
getProp(casePfx+"ses.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[14]/a");
+ private final String PUB_1_LNK_FOO_REM =
getProp(casePfx+"pub.1.lnk.foo.rem","//html/body/div[2]/div/div/div[2]/div/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr/td[2]/a");
+ private final String PUB_3_LNK_BAR_REM =
getProp(casePfx+"pub.3.lnk.bar.rem","//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr[2]/td[2]/a");
+ private final String PUB_3_LNK_JUU_REM =
getProp(casePfx+"pub.3.lnk.juu.rem","//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr/td[2]/a");
+ private final String PUB_SUB_2 =
getProp(casePfx+"pub.sub.2","//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr[3]/td/input");
+ private final String PUB_SUB_1 =
getProp(casePfx+"pub.sub.1","//input[@value='Update']");
+ private final String PUB_DIV_3_BAR =
getProp(casePfx+"pub.div.3.bar","//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr[2]/td[2]/input");
+ private final String PUB_DIV_3_JUU =
getProp(casePfx+"pub.div.3.juu","//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr/td[2]/input");
+ private final String PUB_DIV_2_JUU =
getProp(casePfx+"pub.div.2.juu","juu");
+ private final String PUB_DIV_2_FOO =
getProp(casePfx+"pub.div.2.foo","//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr/td[2]/input");
+ private final String PUB_DIV_1_BAR =
getProp(casePfx+"pub.div.1.bar","bar");
+ private final String PUB_DIV_1_FOO =
getProp(casePfx+"pub.div.1.foo","foo");
+ private final String PUB_LNK =
getProp(casePfx+"pub.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[12]/a");
+ private final String PEVT_DIV_P3_MAX =
getProp(casePfx+"pevt.div.p3.max","//html/body/div[2]/div/div/div[2]/div[2]/div/div[3]/div/div/table/tbody/tr/td[2]/div/div[2]/span/a");
+ private final String PEVT_DIV_P2_MAX =
getProp(casePfx+"pevt.div.p2.max","//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr/td[2]/div/div[2]/span/a");
+ private final String PEVT_DIV_L3_MAX =
getProp(casePfx+"pevt.div.l3.max","//html/body/div[2]/div/div/div[2]/div/div/div[3]/div/div/table/tbody/tr/td[2]/div/div[2]/span/a");
+ private final String PEVT_DIV_L2_MAX =
getProp(casePfx+"pevt.div.l2.max","//html/body/div[2]/div/div/div[2]/div/div/div[2]/div/div/table/tbody/tr/td[2]/div/div[2]/span/a");
+ private final String PEVT_DIV_P3 =
getProp(casePfx+"pevt.div.p3","//html/body/div[2]/div/div/div[2]/div[2]/div/div[3]/div/div/table/tbody/tr[2]/td[2]/div/div");
+ private final String PEVT_DIV_P2 =
getProp(casePfx+"pevt.div.p2","//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div");
+ private final String PEVT_DIV_P1 =
getProp(casePfx+"pevt.div.p1","//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div");
+ private final String PEVT_DIV_L3 =
getProp(casePfx+"pevt.div.l3","//html/body/div[2]/div/div/div[2]/div/div/div[3]/div/div/table/tbody/tr[2]/td[2]/div/div");
+ private final String PEVT_DIV_L2 =
getProp(casePfx+"pevt.div.l2","//html/body/div[2]/div/div/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div");
+ private final String PEVT_DIV_L1 =
getProp(casePfx+"pevt.div.l1","//html/body/div[2]/div/div/div[2]/div/div/div/div/div/table/tbody/tr[2]/td[2]/div/div");
+ private final String PEVT_LNK =
getProp(casePfx+"pevt.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[11]/a");
+ private final String MOD_DIV_CON =
getProp(casePfx+"mod.div.con","//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div");
+ private final String MOD_LNK =
getProp(casePfx+"mod.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[10]/a");
+ private final String MPOR_DIV_CON =
getProp(casePfx+"mpor.div.con","content-container");
+ private final String MPOR_LNK =
getProp(casePfx+"mpor.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[9]/a");
+ private final String MINS_DIV_CON =
getProp(casePfx+"mins.div.con","content-container");
+ private final String MINS_LNK =
getProp(casePfx+"mins.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[8]/a");
+ private final String JS_LNK_SUBMIT =
getProp(casePfx+"js.lnk.submit","link=submit");
+ private final String JS_OPT_3 =
getProp(casePfx+"js.opt.3","//form[@id='jbpnsFormAutoSubmitPortletWindowsnpbj_the_form']/select/option[3]");
+ private final String JS_OPT_2 =
getProp(casePfx+"js.opt.2","//form[@id='jbpnsFormAutoSubmitPortletWindowsnpbj_the_form']/select/option[2]");
+ private final String JS_OPT_1 =
getProp(casePfx+"js.opt.1","//form[@id='jbpnsFormAutoSubmitPortletWindowsnpbj_the_form']/select/option[1]");
+ private final String JS_LAB_C =
getProp(casePfx+"js.lab.c","label=C");
+ private final String JS_LAB_B =
getProp(casePfx+"js.lab.b","label=B");
+ private final String JS_LAB_A =
getProp(casePfx+"js.lab.a","label=A");
+ private final String JS_SEL_LETTER =
getProp(casePfx+"js.sel.letter","//select[@onclick=\"document.getElementById('jbpnsFormAutoSubmitPortletWindowsnpbj_the_form').submit()\"]");
+ private final String JS_LNK =
getProp(casePfx+"js.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[7]/a");
+ private final String HEAD_INP_CONTENT =
getProp(casePfx+"head.inp.content","Introducing-HeaderContentInput");
+ private final String HEAD_DIV_CONTENT =
getProp(casePfx+"head.div.content","Introducing-HeaderContent");
+ private final String HEAD_LNK =
getProp(casePfx+"head.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[6]/a");
+ private final String EXC_LNK_PORTLET =
getProp(casePfx+"exc.lnk.portlet","link=render PortletException");
+ private final String EXC_LNK =
getProp(casePfx+"exc.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[5]/a");
+ private final String EVT_SUB_COLOR =
getProp(casePfx+"evt.sub.color","//input[@type='submit']");
+ private final String EVT_DIV_BLACK =
getProp(casePfx+"evt.div.black","//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/div[contains(@style,'black')]");
+ private final String EVT_DIV_RED =
getProp(casePfx+"evt.div.red","//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/div[contains(@style,'red')]");
+ private final String EVT_DIV_BLUE =
getProp(casePfx+"evt.div.blue","//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/div[contains(@style,'blue')]");
+ private final String EVT_SEL_LAB_BLACK =
getProp(casePfx+"evt.sel.lab.black","label=black");
+ private final String EVT_SEL_LAB_RED =
getProp(casePfx+"evt.sel.lab.red","label=red");
+ private final String EVT_SEL_LAB_BLUE =
getProp(casePfx+"evt.sel.lab.blue","label=blue");
+ private final String EVT_SEL_COL =
getProp(casePfx+"evt.sel.col","color");
+ private final String EVT_LNK =
getProp(casePfx+"evt.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[4]/a");
+ private final String ENC_LNK =
getProp(casePfx+"enc.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[3]/a");
+ private final String ENC_INP_REN =
getProp(casePfx+"enc.inp.ren","text");
+ private final String ENC_SUB_ACT =
getProp(casePfx+"enc.sub.act","//input[@value='Submit to action
phase']");
+ private final String ENC_INP_ACT =
getProp(casePfx+"enc.inp.act","//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div/form[2]/input");
+ private final String ENC_TEXTAREA2 =
getProp(casePfx+"enc.textarea2","//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div[5]/textarea");
+ private final String ENC_TEXTAREA1 =
getProp(casePfx+"enc.textarea1","//textarea[@name='text']");
+ private final String CHAR_ALL_SUB_CHECK =
getProp(casePfx+"char.all.sub.check","//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div[8]/form/input[3]");
+ private final String CHAR_INP_TEXT_SUB_CHECK =
getProp(casePfx+"char.inp.text.sub.check","//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div[6]/form/input[4]");
+ private final String CHAR_LNK_TEXTAREA_CHECK =
getProp(casePfx+"char.lnk.textarea.check","//input[@value='check']");
+ private final String CHAR_INP_TEXT =
getProp(casePfx+"char.inp.text","//input[@name='text']");
+ private final String CHAR_TEXTAREA =
getProp(casePfx+"char.textarea","text");
+ private final String CHAR_SUB_CHANGE =
getProp(casePfx+"char.sub.change","//input[@value='change']");
+ private final String CHAR_INP_TO =
getProp(casePfx+"char.inp.to","to");
+ private final String CHAR_INP_FROM =
getProp(casePfx+"char.inp.from","from");
+ private final String CHAR_LNK =
getProp(casePfx+"char.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[2]/a");
+ private final String CACHE_LNK =
getProp(casePfx+"cache.lnk","//ul[@id='tabsHeader']/li[4]/ul/li[1]/a");
+ private final String CACHE_LNK_2REN =
getProp(casePfx+"cache.lnk.2ren","//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/div[5]/a");
+ private final String CACHE_LNK_2ACT =
getProp(casePfx+"cache.lnk.2act","//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/div[4]/a");
+ private final String CACHE_LNK_1REN =
getProp(casePfx+"cache.lnk.1ren","link=render");
+ private final String CACHE_LNK_1ACT =
getProp(casePfx+"cache.lnk.1act","link=action");
+ private final String CACHE_DIV_2_RENDER =
getProp(casePfx+"cache.div.2.render","//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/div[2]/div");
+ private final String CACHE_DIV_1_RENDER =
getProp(casePfx+"cache.div.1.render","//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div[2]/div");
+
+
+
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ selenium.open("/portal/portal/default/default");
+ waitFor(AJAX_TIMEOUT);
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+
+ }
+ @Test(enabled = true)
+ public void cacheTest() {
+ selenium.click(CACHE_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("0", selenium.getText(CACHE_DIV_1_RENDER));
+ assertEquals("0", selenium.getText(CACHE_DIV_2_RENDER));
+
+ selenium.click(CACHE_LNK_1ACT);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("1", selenium.getText(CACHE_DIV_1_RENDER));
+ assertEquals("0", selenium.getText(CACHE_DIV_2_RENDER));
+
+ selenium.click(CACHE_LNK_1REN);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("1", selenium.getText(CACHE_DIV_1_RENDER));
+ assertEquals("0", selenium.getText(CACHE_DIV_2_RENDER));
+
+ selenium.click(CACHE_LNK_2ACT);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("1", selenium.getText(CACHE_DIV_1_RENDER));
+ assertEquals("1", selenium.getText(CACHE_DIV_2_RENDER));
+
+ selenium.click(CACHE_LNK_2REN);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("1", selenium.getText(CACHE_DIV_1_RENDER));
+ assertEquals("2", selenium.getText(CACHE_DIV_2_RENDER));
+ }
+
+ @Test(enabled = true)
+ public void charsetTest() {
+ selenium.click(CHAR_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(CHAR_INP_FROM, "65");
+ selenium.type(CHAR_INP_TO, "75");
+ selenium.click(CHAR_SUB_CHANGE);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("ABCDEFGHIJ", selenium.getText(CHAR_TEXTAREA));
+ selenium.click(CHAR_LNK_TEXTAREA_CHECK);
+ waitFor(AJAX_TIMEOUT);
+ assertTrue(selenium.isTextPresent("Test result: The input matched the expected
result"));
+ assertEquals("ABCDEFGHIJ", selenium.getValue(CHAR_INP_TEXT));
+ selenium.click(CHAR_INP_TEXT_SUB_CHECK);
+ waitFor(AJAX_TIMEOUT);
+ selenium.type(CHAR_INP_FROM, "55");
+ selenium.type(CHAR_INP_TO, "65");
+ selenium.click(CHAR_SUB_CHANGE);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("789:;<=>?@", selenium.getValue(CHAR_INP_TEXT));
+ selenium.type(CHAR_TEXTAREA, "789:;<=>?@4");
+ selenium.click(CHAR_LNK_TEXTAREA_CHECK);
+ waitFor(AJAX_TIMEOUT);
+ assertTrue(selenium.isTextPresent("Test result: The input did not matched the
expected result"));
+ selenium.type(CHAR_INP_TEXT, "789:;<=>?@f");
+ selenium.click(CHAR_ALL_SUB_CHECK);
+ waitFor(AJAX_TIMEOUT);
+ assertTrue(selenium.isTextPresent("Test result: The input matched the expected
result"));
+ }
+
+ @Test(enabled = true)
+ public void encodingTest() {
+ selenium.click(ENC_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("", selenium.getValue(ENC_TEXTAREA1));
+ assertEquals("", selenium.getValue(ENC_TEXTAREA2));
+ selenium.type(ENC_INP_ACT, "action");
+ selenium.click(ENC_SUB_ACT);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("action", selenium.getValue(ENC_TEXTAREA1));
+ assertEquals("action", selenium.getValue(ENC_TEXTAREA2));
+ selenium.type(CHAR_TEXTAREA, "render");
+ selenium.click("//input[@value='Submit to render phase']");
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("", selenium.getValue(ENC_TEXTAREA1));
+ assertEquals("action", selenium.getValue(ENC_TEXTAREA2));
+ }
+
+ @Test(enabled = true)
+ public void eventTest() {
+ selenium.click(EVT_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(EVT_SEL_COL, EVT_SEL_LAB_BLUE);
+ selenium.click(EVT_SUB_COLOR);
+ waitFor(AJAX_LOAD);
+ assertTrue(selenium.isElementPresent(EVT_DIV_BLUE));
+ selenium.select(EVT_SEL_COL, EVT_SEL_LAB_RED);
+ selenium.click(EVT_SUB_COLOR);
+ waitFor(AJAX_LOAD);
+ assertTrue(selenium.isElementPresent(EVT_DIV_RED));
+ selenium.select(EVT_SEL_COL, EVT_SEL_LAB_BLACK);
+ selenium.click(EVT_SUB_COLOR);
+ waitFor(AJAX_LOAD);
+ assertTrue(selenium.isElementPresent(EVT_DIV_BLACK));
+ }
+
+ @Test(enabled = true)
+ public void exceptionTest() {
+ selenium.click(EXC_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(EXC_LNK_PORTLET);
+ waitFor(AJAX_TIMEOUT);
+ assertTrue(selenium.isTextPresent("javax.portlet.PortletException"));
+ }
+
+ @Test(enabled = true)
+ public void headerTest() {
+ selenium.click(HEAD_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTrue(selenium.isElementPresent(HEAD_DIV_CONTENT));
+ selenium.click(HEAD_INP_CONTENT);
+ assertEquals("hello from the injected java script!", selenium.getAlert());
+ }
+
+ @Test(enabled = true)
+ public void javascriptTest() {
+ selenium.click(JS_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.addSelection(JS_SEL_LETTER, JS_LAB_A);
+ waitFor(AJAX_TIMEOUT);
+ selenium.click(JS_OPT_1);
+ waitFor(AJAX_TIMEOUT);
+
+ assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
+
+ selenium.addSelection(JS_SEL_LETTER, JS_LAB_B);
+ waitFor(AJAX_TIMEOUT);
+ selenium.click(JS_OPT_2);
+ waitFor(AJAX_TIMEOUT);
+
+ assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
+
+ selenium.addSelection(JS_SEL_LETTER, JS_LAB_C);
+ waitFor(AJAX_TIMEOUT);
+ selenium.click(JS_OPT_3);
+ waitFor(AJAX_TIMEOUT);
+
+ assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
+
+ selenium.click(JS_LNK_SUBMIT);
+ waitFor(AJAX_TIMEOUT);
+
+ assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
+ }
+
+ @Test(enabled = true)
+ public void missingInstanceTest() {
+ selenium.click(MINS_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("", selenium.getText(MINS_DIV_CON));
+ }
+
+ @Test(enabled = true)
+ public void missingPortletTest() {
+ selenium.click(MPOR_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("", selenium.getText(MPOR_DIV_CON));
+ }
+
+ @Test(enabled = true)
+ public void modeTest() {
+ selenium.click(MOD_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("View", selenium.getText(MOD_DIV_CON));
+ }
+
+ @Test(enabled = true)
+ public void pageEventTest() {
+ final String portletText = "This is a simple showcase of Portal Node Event
Listener. For this portal page it ensures that in every column, only one portlet window is
in NORMAL state. Try to change the window state of other portlets and see what happens. To
learn more, read InterPortlet Communication (IPC) chapter in JBoss Portal Reference
Guide.";
+ final String emptyText = "";
+
+ selenium.click(PEVT_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // Left column
+
+ assertEquals(portletText, selenium.getText(PEVT_DIV_L1));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_L2));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_L3));
+
+ selenium.click(PEVT_DIV_L2_MAX);
+ waitFor(AJAX_TIMEOUT);
+
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_L1));
+ assertEquals(portletText, selenium.getText(PEVT_DIV_L2));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_L3));
+
+ selenium.click(PEVT_DIV_L3_MAX);
+ waitFor(AJAX_TIMEOUT);
+
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_L1));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_L2));
+ assertEquals(portletText, selenium.getText(PEVT_DIV_L3));
+
+ // Right column
+
+ assertEquals(portletText, selenium.getText(PEVT_DIV_P1));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_P2));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_P3));
+
+ selenium.click(PEVT_DIV_P2_MAX);
+ waitFor(AJAX_TIMEOUT);
+
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_P1));
+ assertEquals(portletText, selenium.getText(PEVT_DIV_P2));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_P3));
+
+ selenium.click(PEVT_DIV_P3_MAX);
+ waitFor(AJAX_TIMEOUT);
+
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_P1));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_P2));
+ assertEquals(portletText, selenium.getText(PEVT_DIV_P3));
+
+ }
+
+ @Test(enabled = true)
+ public void publicParametersTest() {
+ selenium.click(PUB_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("", selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals("", selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_BAR));
+ selenium.type(PUB_DIV_1_FOO, PUB_DIV_1_FOO);
+ selenium.click(PUB_SUB_1);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals(PUB_DIV_1_FOO, selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals(PUB_DIV_1_FOO, selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_BAR));
+ selenium.type(PUB_DIV_1_BAR, PUB_DIV_1_BAR);
+ selenium.click(PUB_SUB_1);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals(PUB_DIV_1_FOO, selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals(PUB_DIV_1_FOO, selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_3_BAR));
+ selenium.type(PUB_DIV_2_JUU, PUB_DIV_2_JUU);
+ selenium.click(PUB_SUB_2);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals(PUB_DIV_1_FOO, selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals(PUB_DIV_1_FOO, selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals(PUB_DIV_2_JUU, selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals(PUB_DIV_2_JUU, selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_3_BAR));
+ selenium.click(PUB_1_LNK_FOO_REM);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("", selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals("", selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals(PUB_DIV_2_JUU, selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals(PUB_DIV_2_JUU, selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_3_BAR));
+ selenium.click(PUB_3_LNK_JUU_REM);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("", selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals("", selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_3_BAR));
+ selenium.click(PUB_3_LNK_BAR_REM);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("", selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals("", selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_BAR));
+ }
+
+ @Test(enabled = false)
+ public void secureTest() {
+
+
+ }
+
+ @Test(enabled = true)
+ public void sessionTest() {
+ selenium.click(SES_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(SES_INP_NAM, "scope1");
+ selenium.type(SES_INP_VAL, "scopeval1");
+ selenium.click(SES_SUB_PSCOPE);
+ waitFor(AJAX_TIMEOUT);
+
+ int r = findTableRow(SES_TAB_PSCOPE, "scope1", 0);
+ assertTrue(r>0);
+ assertEquals(findTableRow(SES_TAB_PSCOPE, "scopeval1", 1), r);
+
+ //assertEquals("scope1",
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[1]/tbody/tr[2]/td[1]"));
+ //assertEquals("scopeval1",
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[1]/tbody/tr[2]/td[2]"));
+ selenium.type(SES_INP_NAM, "app1");
+ selenium.type(SES_INP_VAL, "appval1");
+ selenium.click(SES_SUB_ASCOPE);
+ waitFor(AJAX_TIMEOUT);
+
+ r = findTableRow(SES_TAB_ASCOPE, "app1", 0);
+ assertTrue(r>0);
+ assertEquals(findTableRow(SES_TAB_ASCOPE, "appval1", 1), r);
+
+ //assertEquals("app1",
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[2]/td[1]"));
+ //assertEquals("appval1",
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[2]/td[2]"));
+
+ selenium.click(SES_LNK_INVALIDATE);
+ waitFor(AJAX_TIMEOUT);
+
+ assertFalse(selenium.isTextPresent("Session id"));
+ }
+
+ @Test(enabled = false)
+ public void urlPortletTest() {
+
+
+ }
+
+ @Test(enabled = true)
+ public void windowIdTest() {
+ selenium.click(WIN_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("Window ID is equals to /default/TestWithAjax/Window id
test/WindowIDPortletWindow", selenium.getText(WIN_DIV_CON));
+ }
+
+ @Test(enabled = true)
+ public void serveResourceDemoTest() {
+
+ selenium.click(RES_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(RES_INP, "valtest");
+ selenium.typeKeys(RES_INP, " ");
+
+ waitFor(AJAX_TIMEOUT);
+
+ assertEquals("valtest", selenium.getText(RES_DIV_RTEXT));
+ selenium.click(RES_LNK_P1);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("Product ID: 1\n B BY BURTON ALPHA\nSale Price: $314.96",
selenium.getText(RES_DIV_PTEXT));
+ selenium.click(RES_LNK_P2);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("Product ID: 2\nFORUM DESTROYER LTD\n$319.99",
selenium.getText(RES_DIV_PTEXT));
+ selenium.click(RES_LNK_P3);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("Product ID: 3\n SANTA CRUZ ALLSTAR\n$256.00",
selenium.getText(RES_DIV_PTEXT));
+
+ }
+
+
+}
Added:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java
(rev 0)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -0,0 +1,480 @@
+package org.jboss.portal.test.selenium;
+
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+
+@Test(groups = { "test_samples" }, enabled = true)
+public class PortalSamplesTestCase extends JBossPortalSeleniumTestCase {
+
+ public static long AJAX_TIMEOUT = 4500;
+
+ public static String casePfx = "samples.";
+
+ private final String SES_LNK_INVALIDATE =
getProp(casePfx+"ses.lnk.invalidate","link=invalidate");
+ private final String RES_DIV_RTEXT =
getProp(casePfx+"res.div.rtext","repeat-text");
+ private final String RES_DIV_PTEXT =
getProp(casePfx+"res.div.ptext","product-text");
+ private final String RES_LNK_P3 =
getProp(casePfx+"res.lnk.p3","link=Product3");
+ private final String RES_LNK_P2 =
getProp(casePfx+"res.lnk.p2","link=Product2");
+ private final String RES_LNK_P1 =
getProp(casePfx+"res.lnk.p1","link=Product1");
+ private final String RES_INP = getProp(casePfx+"res.inp","repeat");
+ private final String RES_LNK =
getProp(casePfx+"res.lnk","link=serveResource Demo");
+ private final String WIN_DIV_CON =
getProp(casePfx+"win.div.con","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
+ private final String WIN_LNK = getProp(casePfx+"win.lnk","link=Window id
test");
+ private final String SES_TAB_PSCOPE =
getProp(casePfx+"ses.tab.pscope","//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table");
+ private final String SES_TAB_ASCOPE =
getProp(casePfx+"ses.tab.ascope","//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table[2]");
+ private final String SES_SUB_ASCOPE =
getProp(casePfx+"ses.sub.ascope","application");
+ private final String SES_SUB_PSCOPE =
getProp(casePfx+"ses.sub.pscope","portlet");
+ private final String SES_INP_VAL =
getProp(casePfx+"ses.inp.val","value");
+ private final String SES_INP_NAM =
getProp(casePfx+"ses.inp.nam","name");
+ private final String SES_LNK = getProp(casePfx+"ses.lnk","link=Session
test");
+ private final String PUB_1_LNK_FOO_REM =
getProp(casePfx+"pub.1.lnk.foo.rem","link=Remove");
+ private final String PUB_3_LNK_BAR_REM =
getProp(casePfx+"pub.3.lnk.bar.rem","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a");
+ private final String PUB_3_LNK_JUU_REM =
getProp(casePfx+"pub.3.lnk.juu.rem","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/a");
+ private final String PUB_SUB_2 =
getProp(casePfx+"pub.sub.2","//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td/input");
+ private final String PUB_SUB_1 =
getProp(casePfx+"pub.sub.1","//input[@value='Update']");
+ private final String PUB_DIV_3_BAR =
getProp(casePfx+"pub.div.3.bar","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/input");
+ private final String PUB_DIV_3_JUU =
getProp(casePfx+"pub.div.3.juu","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input");
+ private final String PUB_DIV_2_JUU =
getProp(casePfx+"pub.div.2.juu","juu");
+ private final String PUB_DIV_2_FOO =
getProp(casePfx+"pub.div.2.foo","//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input");
+ private final String PUB_DIV_1_BAR =
getProp(casePfx+"pub.div.1.bar","bar");
+ private final String PUB_DIV_1_FOO =
getProp(casePfx+"pub.div.1.foo","foo");
+ private final String PUB_LNK = getProp(casePfx+"pub.lnk","link=Public
parameters test");
+ private final String PEVT_DIV_P3_MAX =
getProp(casePfx+"pevt.div.p3.max","//div[@id='regionB']/div[3]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
+ private final String PEVT_DIV_P2_MAX =
getProp(casePfx+"pevt.div.p2.max","//div[@id='regionB']/div[2]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
+ private final String PEVT_DIV_L3_MAX =
getProp(casePfx+"pevt.div.l3.max","//div[@id='regionA']/div[3]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
+ private final String PEVT_DIV_L2_MAX =
getProp(casePfx+"pevt.div.l2.max","//div[@id='regionA']/div[2]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
+ private final String PEVT_DIV_P3 =
getProp(casePfx+"pevt.div.p3","//div[@id='regionB']/div[3]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_P2 =
getProp(casePfx+"pevt.div.p2","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_P1 =
getProp(casePfx+"pevt.div.p1","//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_L3 =
getProp(casePfx+"pevt.div.l3","//div[@id='regionA']/div[3]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_L2 =
getProp(casePfx+"pevt.div.l2","//div[@id='regionA']/div[2]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_L1 =
getProp(casePfx+"pevt.div.l1","//div[@id='regionA']/div[1]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_LNK = getProp(casePfx+"pevt.lnk","link=Page
event test");
+ private final String MOD_DIV_CON =
getProp(casePfx+"mod.div.con","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
+ private final String MOD_LNK = getProp(casePfx+"mod.lnk","link=Mode
test");
+ private final String MPOR_DIV_CON =
getProp(casePfx+"mpor.div.con","content-container");
+ private final String MPOR_LNK = getProp(casePfx+"mpor.lnk","link=Missing
portlet");
+ private final String MINS_DIV_CON =
getProp(casePfx+"mins.div.con","content-container");
+ private final String MINS_LNK = getProp(casePfx+"mins.lnk","link=Missing
instance");
+ private final String JS_LNK_SUBMIT =
getProp(casePfx+"js.lnk.submit","link=submit");
+ private final String JS_OPT_3 =
getProp(casePfx+"js.opt.3","//form[contains(@id,'_the_form')]/select/option[3]");
+ private final String JS_OPT_2 =
getProp(casePfx+"js.opt.2","//form[contains(@id,'_the_form')]/select/option[2]");
+ private final String JS_OPT_1 =
getProp(casePfx+"js.opt.1","//form[@id='jbpnsFormAutoSubmitPortletWindowsnpbj_the_form']/select/option[1]");
+ private final String JS_LAB_C =
getProp(casePfx+"js.lab.c","label=C");
+ private final String JS_LAB_B =
getProp(casePfx+"js.lab.b","label=B");
+ private final String JS_LAB_A =
getProp(casePfx+"js.lab.a","label=A");
+ private final String JS_SEL_LETTER =
getProp(casePfx+"js.sel.letter","//select[@onclick=\"document.getElementById('jbpnsFormAutoSubmitPortletWindowsnpbj_the_form').submit()\"]");
+ private final String JS_LNK = getProp(casePfx+"js.lnk","link=Javascript
test");
+ private final String HEAD_INP_CONTENT =
getProp(casePfx+"head.inp.content","Introducing-HeaderContentInput");
+ private final String HEAD_DIV_CONTENT =
getProp(casePfx+"head.div.content","Introducing-HeaderContent");
+ private final String HEAD_LNK = getProp(casePfx+"head.lnk","link=Header
test");
+ private final String FS_LNK = getProp(casePfx+"fs.lnk","link=File system
content");
+ private final String EXC_LNK_PORTLET =
getProp(casePfx+"exc.lnk.portlet","link=render PortletException");
+ private final String EXC_LNK = getProp(casePfx+"exc.lnk","link=Exception
test");
+ private final String EVT_SUB_COLOR =
getProp(casePfx+"evt.sub.color","//input[@type='submit']");
+ private final String EVT_DIV_BLACK =
getProp(casePfx+"evt.div.black","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'black')]");
+ private final String EVT_DIV_RED =
getProp(casePfx+"evt.div.red","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'red')]");
+ private final String EVT_DIV_BLUE =
getProp(casePfx+"evt.div.blue","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'blue')]");
+ private final String EVT_SEL_LAB_BLACK =
getProp(casePfx+"evt.sel.lab.black","label=black");
+ private final String EVT_SEL_LAB_RED =
getProp(casePfx+"evt.sel.lab.red","label=red");
+ private final String EVT_SEL_LAB_BLUE =
getProp(casePfx+"evt.sel.lab.blue","label=blue");
+ private final String EVT_SEL_COL =
getProp(casePfx+"evt.sel.col","color");
+ private final String EVT_LNK = getProp(casePfx+"evt.lnk","link=Event
test");
+ private final String ENC_LNK = getProp(casePfx+"enc.lnk","link=Encoding
test");
+ private final String ENC_INP_REN =
getProp(casePfx+"enc.inp.ren","text");
+ private final String ENC_SUB_ACT =
getProp(casePfx+"enc.sub.act","//input[@value='Submit to action
phase']");
+ private final String ENC_INP_ACT =
getProp(casePfx+"enc.inp.act","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[1]/form[2]/input[1]");
+ private final String ENC_TEXTAREA2 =
getProp(casePfx+"enc.textarea2","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[5]/textarea");
+ private final String ENC_TEXTAREA1 =
getProp(casePfx+"enc.textarea1","//textarea[@name='text']");
+ private final String CHAR_ALL_SUB_CHECK =
getProp(casePfx+"char.all.sub.check","//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/div[8]/form/input[3]");
+ private final String CHAR_INP_TEXT_SUB_CHECK =
getProp(casePfx+"char.inp.text.sub.check","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[8]/form/input[3]");
+ private final String CHAR_LNK_TEXTAREA_CHECK =
getProp(casePfx+"char.lnk.textarea.check","//input[@value='check']");
+ private final String CHAR_INP_TEXT =
getProp(casePfx+"char.inp.text","//input[@name='text']");
+ private final String CHAR_TEXTAREA =
getProp(casePfx+"char.textarea","text");
+ private final String CHAR_SUB_CHANGE =
getProp(casePfx+"char.sub.change","//input[@value='change']");
+ private final String CHAR_INP_TO =
getProp(casePfx+"char.inp.to","to");
+ private final String CHAR_INP_FROM =
getProp(casePfx+"char.inp.from","from");
+ private final String CHAR_LNK = getProp(casePfx+"char.lnk","link=Charset
test");
+ private final String CACHE_LNK = getProp(casePfx+"cache.lnk","link=Cache
test");
+ private final String CACHE_LNK_2REN =
getProp(casePfx+"cache.lnk.2ren","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[5]/a");
+ private final String CACHE_LNK_2ACT =
getProp(casePfx+"cache.lnk.2act","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[4]/a");
+ private final String CACHE_LNK_1REN =
getProp(casePfx+"cache.lnk.1ren","link=render");
+ private final String CACHE_LNK_1ACT =
getProp(casePfx+"cache.lnk.1act","link=action");
+ private final String CACHE_2RENDER =
getProp(casePfx+"cache.2render","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[2]/div");
+ private final String CACHE_1RENDER =
getProp(casePfx+"cache.1render","//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/div[2]/div");
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ selenium.open("/portal/portal/default/default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+
+ }
+ @Test(enabled = true)
+ public void cacheTest() {
+ selenium.click(CACHE_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("0", selenium.getText(CACHE_1RENDER));
+ assertEquals("0", selenium.getText(CACHE_2RENDER));
+
+ selenium.click(CACHE_LNK_1ACT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("1", selenium.getText(CACHE_1RENDER));
+ assertEquals("1", selenium.getText(CACHE_2RENDER));
+
+ selenium.click(CACHE_LNK_1REN);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("1", selenium.getText(CACHE_1RENDER));
+ assertEquals("2", selenium.getText(CACHE_2RENDER));
+
+ selenium.click(CACHE_LNK_2ACT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("1", selenium.getText(CACHE_1RENDER));
+ assertEquals("3", selenium.getText(CACHE_2RENDER));
+
+ selenium.click(CACHE_LNK_2REN);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("1", selenium.getText(CACHE_1RENDER));
+ assertEquals("4", selenium.getText(CACHE_2RENDER));
+ }
+
+ @Test(enabled = true)
+ public void charsetTest() {
+ selenium.click(CHAR_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(CHAR_INP_FROM, "65");
+ selenium.type(CHAR_INP_TO, "75");
+ selenium.click(CHAR_SUB_CHANGE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("ABCDEFGHIJ", selenium.getText(CHAR_TEXTAREA));
+ selenium.click(CHAR_LNK_TEXTAREA_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTrue(selenium.isTextPresent("Test result: The input matched the expected
result"));
+ assertEquals("ABCDEFGHIJ", selenium.getValue(CHAR_INP_TEXT));
+ selenium.click(CHAR_INP_TEXT_SUB_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(CHAR_INP_FROM, "55");
+ selenium.type(CHAR_INP_TO, "65");
+ selenium.click(CHAR_SUB_CHANGE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("789:;<=>?@", selenium.getValue(CHAR_INP_TEXT));
+ selenium.type(CHAR_TEXTAREA, "789:;<=>?@4");
+ selenium.click(CHAR_LNK_TEXTAREA_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTrue(selenium.isTextPresent("Test result: The input did not matched the
expected result"));
+ selenium.type(CHAR_INP_TEXT, "789:;<=>?@f");
+ selenium.click(CHAR_ALL_SUB_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTrue(selenium.isTextPresent("Test result: The input matched the expected
result"));
+ }
+
+ @Test(enabled = true)
+ public void encodingTest() {
+ selenium.click(ENC_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("", selenium.getValue(ENC_TEXTAREA1));
+ assertEquals("", selenium.getValue(ENC_TEXTAREA2));
+ selenium.type(ENC_INP_ACT, "action");
+ selenium.click(ENC_SUB_ACT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("action", selenium.getValue(ENC_TEXTAREA1));
+ assertEquals("action", selenium.getValue(ENC_TEXTAREA2));
+ selenium.type(CHAR_TEXTAREA, "render");
+ selenium.click("//input[@value='Submit to render phase']");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("", selenium.getValue(ENC_TEXTAREA1));
+ assertEquals("action", selenium.getValue(ENC_TEXTAREA2));
+ }
+
+ @Test(enabled = true)
+ public void eventTest() {
+ selenium.click(EVT_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(EVT_SEL_COL, EVT_SEL_LAB_BLUE);
+ selenium.click(EVT_SUB_COLOR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTrue(selenium.isElementPresent(EVT_DIV_BLUE));
+ selenium.select(EVT_SEL_COL, EVT_SEL_LAB_RED);
+ selenium.click(EVT_SUB_COLOR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTrue(selenium.isElementPresent(EVT_DIV_RED));
+ selenium.select(EVT_SEL_COL, EVT_SEL_LAB_BLACK);
+ selenium.click(EVT_SUB_COLOR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTrue(selenium.isElementPresent(EVT_DIV_BLACK));
+ }
+
+ @Test(enabled = true)
+ public void exceptionTest() {
+ selenium.click(EXC_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(EXC_LNK_PORTLET);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTrue(selenium.isTextPresent("javax.portlet.PortletException"));
+ }
+
+ @Test(enabled = true)
+ public void fileSystemContentTest() {
+ selenium.click(FS_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTrue(selenium.isTextPresent("Bar content"));
+ }
+
+ @Test(enabled = true)
+ public void headerTest() {
+ selenium.click(HEAD_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTrue(selenium.isElementPresent(HEAD_DIV_CONTENT));
+ selenium.click(HEAD_INP_CONTENT);
+ assertEquals("hello from the injected java script!", selenium.getAlert());
+ }
+
+ @Test(enabled = true)
+ public void javascriptTest() {
+ selenium.click(JS_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.addSelection(JS_SEL_LETTER, JS_LAB_A);
+ waitFor(AJAX_TIMEOUT);
+ selenium.click(JS_OPT_1);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
+
+ selenium.addSelection(JS_SEL_LETTER, JS_LAB_B);
+ waitFor(AJAX_TIMEOUT);
+ selenium.click(JS_OPT_2);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
+
+ selenium.addSelection(JS_SEL_LETTER, JS_LAB_C);
+ waitFor(AJAX_TIMEOUT);
+ selenium.click(JS_OPT_3);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
+
+ selenium.click(JS_LNK_SUBMIT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
+ }
+
+ @Test(enabled = true)
+ public void missingInstanceTest() {
+ selenium.click(MINS_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("", selenium.getText(MINS_DIV_CON));
+ }
+
+ @Test(enabled = true)
+ public void missingPortletTest() {
+ selenium.click(MPOR_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("", selenium.getText(MPOR_DIV_CON));
+ }
+
+ @Test(enabled = true)
+ public void modeTest() {
+ selenium.click(MOD_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("View", selenium.getText(MOD_DIV_CON));
+ }
+
+ @Test(enabled = true)
+ public void pageEventTest() {
+ final String portletText = "This is a simple showcase of Portal Node Event
Listener. For this portal page it ensures that in every column, only one portlet window is
in NORMAL state. Try to change the window state of other portlets and see what happens. To
learn more, read InterPortlet Communication (IPC) chapter in JBoss Portal Reference
Guide.";
+ final String emptyText = "";
+
+ selenium.click(PEVT_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // Left column
+
+ assertEquals(portletText, selenium.getText(PEVT_DIV_L1));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_L2));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_L3));
+
+ selenium.click(PEVT_DIV_L2_MAX);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_L1));
+ assertEquals(portletText, selenium.getText(PEVT_DIV_L2));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_L3));
+
+ selenium.click(PEVT_DIV_L3_MAX);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_L1));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_L2));
+ assertEquals(portletText, selenium.getText(PEVT_DIV_L3));
+
+ // Right column
+
+ assertEquals(portletText, selenium.getText(PEVT_DIV_P1));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_P2));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_P3));
+
+ selenium.click(PEVT_DIV_P2_MAX);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_P1));
+ assertEquals(portletText, selenium.getText(PEVT_DIV_P2));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_P3));
+
+ selenium.click(PEVT_DIV_P3_MAX);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_P1));
+ assertEquals(emptyText, selenium.getText(PEVT_DIV_P2));
+ assertEquals(portletText, selenium.getText(PEVT_DIV_P3));
+
+ }
+
+ @Test(enabled = true)
+ public void publicParametersTest() {
+ selenium.click(PUB_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("", selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals("", selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_BAR));
+ selenium.type(PUB_DIV_1_FOO, PUB_DIV_1_FOO);
+ selenium.click(PUB_SUB_1);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals(PUB_DIV_1_FOO, selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals(PUB_DIV_1_FOO, selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_BAR));
+ selenium.type(PUB_DIV_1_BAR, PUB_DIV_1_BAR);
+ selenium.click(PUB_SUB_1);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals(PUB_DIV_1_FOO, selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals(PUB_DIV_1_FOO, selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_3_BAR));
+ selenium.type(PUB_DIV_2_JUU, PUB_DIV_2_JUU);
+ selenium.click(PUB_SUB_2);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals(PUB_DIV_1_FOO, selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals(PUB_DIV_1_FOO, selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals(PUB_DIV_2_JUU, selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals(PUB_DIV_2_JUU, selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_3_BAR));
+ selenium.click(PUB_1_LNK_FOO_REM);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("", selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals("", selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals(PUB_DIV_2_JUU, selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals(PUB_DIV_2_JUU, selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_3_BAR));
+ selenium.click(PUB_3_LNK_JUU_REM);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("", selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals("", selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals(PUB_DIV_1_BAR, selenium.getValue(PUB_DIV_3_BAR));
+ selenium.click(PUB_3_LNK_BAR_REM);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("", selenium.getValue(PUB_DIV_1_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_1_BAR));
+ assertEquals("", selenium.getValue(PUB_DIV_2_FOO));
+ assertEquals("", selenium.getValue(PUB_DIV_2_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_JUU));
+ assertEquals("", selenium.getValue(PUB_DIV_3_BAR));
+ }
+
+ @Test(enabled = false)
+ public void secureTest() {
+
+
+ }
+
+ @Test(enabled = true)
+ public void sessionTest() {
+ selenium.click(SES_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(SES_INP_NAM, "scope1");
+ selenium.type(SES_INP_VAL, "scopeval1");
+ selenium.click(SES_SUB_PSCOPE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = findTableRow(SES_TAB_PSCOPE, "scope1", 0);
+ assertTrue(r>0);
+ assertEquals(findTableRow(SES_TAB_PSCOPE, "scopeval1", 1), r);
+
+ //assertEquals("scope1",
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[1]/tbody/tr[2]/td[1]"));
+ //assertEquals("scopeval1",
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[1]/tbody/tr[2]/td[2]"));
+ selenium.type(SES_INP_NAM, "app1");
+ selenium.type(SES_INP_VAL, "appval1");
+ selenium.click(SES_SUB_ASCOPE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(SES_TAB_ASCOPE, "app1", 0);
+ assertTrue(r>0);
+ assertEquals(findTableRow(SES_TAB_ASCOPE, "appval1", 1), r);
+
+ //assertEquals("app1",
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[2]/td[1]"));
+ //assertEquals("appval1",
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[2]/td[2]"));
+
+ selenium.click(SES_LNK_INVALIDATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ assertFalse(selenium.isTextPresent("Session id"));
+ }
+
+ @Test(enabled = false)
+ public void urlPortletTest() {
+
+
+ }
+
+ @Test(enabled = true)
+ public void windowIdTest() {
+ selenium.click(WIN_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertEquals("Window ID is equals to /default/Test/Window id
test/WindowIDPortletWindow", selenium.getText(WIN_DIV_CON));
+ }
+
+ @Test(enabled = true)
+ public void serveResourceDemoTest() {
+
+ selenium.click(RES_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(RES_INP, "valtest");
+ selenium.typeKeys(RES_INP, " ");
+
+ waitFor(AJAX_TIMEOUT);
+
+ assertEquals("valtest", selenium.getText(RES_DIV_RTEXT));
+ selenium.click(RES_LNK_P1);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("Product ID: 1\n B BY BURTON ALPHA\nSale Price: $314.96",
selenium.getText(RES_DIV_PTEXT));
+ selenium.click(RES_LNK_P2);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("Product ID: 2\nFORUM DESTROYER LTD\n$319.99",
selenium.getText(RES_DIV_PTEXT));
+ selenium.click(RES_LNK_P3);
+ waitFor(AJAX_TIMEOUT);
+ assertEquals("Product ID: 3\n SANTA CRUZ ALLSTAR\n$256.00",
selenium.getText(RES_DIV_PTEXT));
+
+ }
+
+
+
+}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -9,24 +9,21 @@
@Test(groups = { "portlet_user_creation" }, enabled = true)
public class PortletUserCreationTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUBMIT_CREATE_CONF =
"//input[contains(@id,'confirm-form:user')]";
- public static final String SUBMIT_CREATE_CONF_EDIT =
"//input[contains(@id,'//input[contains(@id,'confirm-form:revise')]";
+
+ public String casePfx = "user.crea.port.";
+
+ private final String SUBMIT_CREATE_CONF =
getProp(casePfx+"submit.create.conf","//input[contains(@id,'confirm-form:user')]");
+ public final String SUBMIT_CREATE_CONF_EDIT =
getProp(casePfx+"submit.create.conf.edit","//input[contains(@id,'//input[contains(@id,'confirm-form:revise')]");
+ private final String SUBMIT_CREATE_USER =
getProp(casePfx+"submit.create.user","//input[contains(@id,'register-form:submit')]");
+ private final String SUBMIT_CREATE_USER_CANCEL =
getProp(casePfx+"submit.create.user.cancel","//input[contains(@id,'register-form:cancel')]");
+ private final String INPUT_USERPASSWDCONF =
getProp(casePfx+"input.userpasswdconf","//input[contains(@id,'register-form:passwordCheckv");
+ private final String INPUT_USERPASSWD =
getProp(casePfx+"input.userpasswd","//input[contains(@id,'register-form:password')]");
+ private final String INPUT_USERMAIL =
getProp(casePfx+"input.usermail","//input[contains(@id,'register-form:email')]");
+ private final String INPUT_USERNAME =
getProp(casePfx+"input.username","//input[contains(@id,'register-form:username')]");
+ private final String LINK_CREATE_USER =
getProp(casePfx+"link.create.user","//a[contains(@id,'create-account-form:register')]");
+ private final String TAB_WELCOME =
getProp(casePfx+"tab.welcome","//a[contains(@id,'register-temp-form:start-link')]");
- private static final String SUBMIT_CREATE_USER =
"//input[contains(@id,'register-form:submit')]";
- private static final String SUBMIT_CREATE_USER_CANCEL =
"//input[contains(@id,'register-form:cancel')]";
- private static final String INPUT_USERPASSWDCONF =
"//input[contains(@id,'register-form:passwordCheckv";
-
- private static final String INPUT_USERPASSWD =
"//input[contains(@id,'register-form:password')]";
-
- private static final String INPUT_USERMAIL =
"//input[contains(@id,'register-form:email')]";
-
- private static final String INPUT_USERNAME =
"//input[contains(@id,'register-form:username')]";
-
- private static final String LINK_CREATE_USER =
"//a[contains(@id,'create-account-form:register')]";
-
- private static final String TAB_WELCOME =
"//a[contains(@id,'register-temp-form:start-link')]";
-
@Test(enabled = true, description = "Simple user creation.")
public void userCreationTest() {
selenium.open("/portal");
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -1,8 +1,6 @@
package org.jboss.portal.test.selenium;
-import java.text.DateFormat;
import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Vector;
@@ -14,6 +12,9 @@
@Test(groups = { "cms_user_interceptor" }, enabled = true, description =
"Checking the log of logging of users.")
public class UserInterceptorPortletTestCase extends JBossPortalSeleniumTestCase {
+ private static final String LNK_USER_DETAILS = "link=UsersDetailPage";
+ private static final String DIV_LOGINFO =
"//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div";
+
@Test(enabled = true, description = "Checking the logging dates for user.")
public void testTestUserLogger() throws ParseException {
@@ -26,7 +27,6 @@
}
private int dateDiff(String name, String passwd, int ind) throws ParseException {
- DateFormat df = new SimpleDateFormat("E MMM dd HH:mm:ss z yyyy");
Vector<String> vs;
String logInfo;
@@ -34,25 +34,25 @@
logout();
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=UsersDetailPage");
+ selenium.click(LNK_USER_DETAILS);
selenium.waitForPageToLoad(PAGE_LOAD);
- logInfo =
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
+ logInfo = selenium.getText(DIV_LOGINFO);
vs = parseUserInterceptorString(logInfo);
- Date d1 = new Date(Long.valueOf(vs.get(ind)));//df.parse(vs.get(ind));
+ Date d1 = new Date(Long.valueOf(vs.get(ind)));
login(name, passwd);
logout();
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=UsersDetailPage");
+ selenium.click(LNK_USER_DETAILS);
selenium.waitForPageToLoad(PAGE_LOAD);
- logInfo =
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
+ logInfo = selenium.getText(DIV_LOGINFO);
vs = parseUserInterceptorString(logInfo);
- Date d2 = new Date(Long.valueOf(vs.get(ind)));//df.parse(vs.get(ind));
+ Date d2 = new Date(Long.valueOf(vs.get(ind)));
return d2.compareTo(d1);
}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -4,118 +4,197 @@
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;
+
/**
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
@Test(groups = { "login" }, enabled = true)
public class UserLoginTestCase extends JBossPortalSeleniumTestCase {
-
+
+ public final String casePfx = "user.login.";
+
+ private final String ADR_PORTAL =
getProp(casePfx+"adr.portal","/portal");
+ private final String FRM_MAIN =
getProp(casePfx+"frm.main","relative=up");
+ private final String SUB_CANCEL =
getProp(casePfx+"sub.portal","cancel");
+ private final String LNK_LOGOUT =
getProp(casePfx+"lnk.logout","link=Logout");
+ private final String SUB_LOGIN =
getProp(casePfx+"sub.login","login");
+ private final String INP_PASSWORD =
getProp(casePfx+"inp.password","xpath=id('j_password')");
+ private final String INP_USERNAME =
getProp(casePfx+"inp.username","xpath=id('j_username')");
+ private final String FRM_LOGINFORM =
getProp(casePfx+"frm.login","login-content");
+ private final String LNK_LOGIN =
getProp(casePfx+"lnk.login","link=Login");
+
@AfterClass(enabled = true)
public void logoutIfNeeded()
{
- selenium.open("/portal");
+ selenium.open(ADR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- if (selenium.isElementPresent("link=Logout")){
- selenium.click("link=Logout");
+ if (selenium.isElementPresent(LNK_LOGOUT)){
+ selenium.click(LNK_LOGOUT);
selenium.waitForPageToLoad(PAGE_LOAD);
}
}
@Test(enabled = true, description = "login as default user 'user' with
password 'user'.")
public void testDefaultUserLogin() throws Exception {
- //selenium.setSpeed("7000");
- selenium.open("/portal");
+ final String loginName = "user";
+ final String loginPass = "user";
+
+ selenium.open(ADR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isElementPresent("link=Login"), "Expected DOM
element for login link does not exist.");
- Assert.assertEquals(selenium.getText("link=Login"), "Login",
"Login button doesn't exist.");
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN), "Expected DOM element for
login link does not exist.");
+ Assert.assertEquals(selenium.getText(LNK_LOGIN), "Login", "Login button
doesn't exist.");
- selenium.click("link=Login");
- selenium.selectFrame("login-content");
+ selenium.click(LNK_LOGIN);
+ selenium.selectFrame(FRM_LOGINFORM);
- waitForElement("xpath=id('j_username')");
- waitForElement("xpath=id('j_password')");
+ waitForElement(INP_USERNAME);
+ waitForElement(INP_PASSWORD);
- Assert.assertTrue(selenium.isElementPresent("xpath=id('j_username')"),
"Expected input DOM element for username doesn't exist.");
- selenium.type("j_username", "user");
- Assert.assertTrue(selenium.isElementPresent("xpath=id('j_password')"),
"Expected input DOM element for password doesn't exist.");
- selenium.type("j_password", "user");
- selenium.click("login");
+ Assert.assertTrue(selenium.isElementPresent(INP_USERNAME), "Expected input DOM
element for username doesn't exist.");
+ selenium.type(INP_USERNAME, loginName);
+ Assert.assertTrue(selenium.isElementPresent(INP_PASSWORD), "Expected input DOM
element for password doesn't exist.");
+
+ selenium.type(INP_PASSWORD, loginPass);
+ selenium.click(SUB_LOGIN);
+
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Logged in as: user"),
"\"Logged in as\" message missing.");
+ Assert.assertTrue(selenium.isTextPresent("Logged in as: "+loginName),
"\"Logged in as\" message missing.");
- Assert.assertTrue(selenium.isElementPresent("link=Logout"), "Expected
DOM element for login link does not exist.");
- Assert.assertEquals(selenium.getText("link=Logout"), "Logout",
"Logout has wrong label.");
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGOUT), "Expected DOM element for
login link does not exist.");
+ Assert.assertEquals(selenium.getText(LNK_LOGOUT), "Logout", "Logout has
wrong label.");
- selenium.click("link=Logout");
+ selenium.click(LNK_LOGOUT);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("Logged in as:"),
"\"Logged in as:\" message with no user logged in is missing.");
}
@Test(enabled = true, description = "login as admin user 'admin' with
password 'admin'.")
public void testAdminLogin() throws Exception {
- selenium.open("/portal");
+ final String loginName = "admin";
+ final String loginPass = "admin";
+
+ selenium.open(ADR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- waitForElement("link=Login");
- Assert.assertTrue(selenium.isElementPresent("link=Login"), "Expected DOM
element for login link does not exist.");
- Assert.assertEquals(selenium.getText("link=Login"), "Login",
"Login button doesn't exist.");
+ waitForElement(LNK_LOGIN);
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN), "Expected DOM element for
login link does not exist.");
+ Assert.assertEquals(selenium.getText(LNK_LOGIN), "Login", "Login button
doesn't exist.");
- selenium.click("link=Login");
- selenium.selectFrame("login-content");
+ selenium.click(LNK_LOGIN);
+ selenium.selectFrame(FRM_LOGINFORM);
- waitForElement("xpath=id('j_username')");
- waitForElement("xpath=id('j_password')");
+ waitForElement(INP_USERNAME);
+ waitForElement(INP_PASSWORD);
- Assert.assertTrue(selenium.isElementPresent("xpath=id('j_username')"),
"Expected input DOM element for username doesn't exist.");
- selenium.type("j_username", "admin");
- Assert.assertTrue(selenium.isElementPresent("xpath=id('j_password')"),
"Expected input DOM element for password doesn't exist.");
- selenium.type("j_password", "admin");
- selenium.click("login");
+ Assert.assertTrue(selenium.isElementPresent(INP_USERNAME), "Expected input DOM
element for username doesn't exist.");
+ selenium.type(INP_USERNAME, loginName);
+ Assert.assertTrue(selenium.isElementPresent(INP_PASSWORD), "Expected input DOM
element for password doesn't exist.");
+ selenium.type(INP_PASSWORD, loginPass);
+ selenium.click(SUB_LOGIN);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Logged in as: admin"),
"\"Logged in as\" message missing.");
- Assert.assertTrue(selenium.isElementPresent("link=Logout"), "Expected
DOM element for login link does not exist.");
- Assert.assertEquals(selenium.getText("link=Logout"), "Logout",
"Logout has wrong label.");
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGOUT), "Expected DOM element for
login link does not exist.");
+ Assert.assertEquals(selenium.getText(LNK_LOGOUT), "Logout", "Logout has
wrong label.");
- selenium.click("link=Logout");
+ selenium.click(LNK_LOGOUT);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("Logged in as:"),
"\"Logged in as:\" message with no user logged in is missing.");
}
@Test(enabled = true, description = "canceling of the login form.")
public void testUserLoginCancel() throws Exception {
- selenium.open("/portal");
+ final String loginName = "saki";
+ final String loginPass = "paki";
+
+ selenium.open(ADR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("Logged in as:"),
"\"Logged in as:\" message with no user logged in is missing.");
- Assert.assertTrue(selenium.isElementPresent("link=Login"), "DOM element
for login link not found.");
- Assert.assertEquals(selenium.getText("link=Login"), "Login",
"Login button doesn't exist.");
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN), "DOM element for login
link not found.");
+ Assert.assertEquals(selenium.getText(LNK_LOGIN), "Login", "Login button
doesn't exist.");
- selenium.click("link=Login");
- selenium.selectFrame("login-content");
+ selenium.click(LNK_LOGIN);
+ selenium.selectFrame(FRM_LOGINFORM);
- waitForElement("xpath=id('j_username')");
- waitForElement("xpath=id('j_password')");
+ waitForElement(INP_USERNAME);
+ waitForElement(INP_PASSWORD);
- Assert.assertTrue(selenium.isElementPresent("xpath=id('j_username')"),
"Expected input DOM element for username doesn't exist.");
- selenium.type("j_username", "saki");
- Assert.assertTrue(selenium.isElementPresent("xpath=id('j_password')"),
"Expected input DOM element for password doesn't exist.");
- selenium.type("j_password", "paki");
+ Assert.assertTrue(selenium.isElementPresent(INP_USERNAME), "Expected input DOM
element for username doesn't exist.");
+ selenium.type(INP_USERNAME, loginName);
+ Assert.assertTrue(selenium.isElementPresent(INP_PASSWORD), "Expected input DOM
element for password doesn't exist.");
+ selenium.type(INP_PASSWORD, loginPass);
- selenium.click("cancel");
- selenium.selectFrame("relative=up");
+ selenium.click(SUB_CANCEL);
+ selenium.selectFrame(FRM_MAIN);
- Assert.assertTrue(selenium.isElementPresent("link=Login"), "DOM element
for login link not found.");
- Assert.assertEquals(selenium.getText("link=Login"), "Login",
"Login button doesn't exist.");
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN), "DOM element for login
link not found.");
+ Assert.assertEquals(selenium.getText(LNK_LOGIN), "Login", "Login button
doesn't exist.");
Assert.assertFalse(selenium.isTextPresent("Logged in as:"),
"\"Logged in as:\" message with no user logged in is missing.");
}
+
+ @Test(enabled = true, description = "login as 'us2er' which does not
exist.")
+ public void testFalseNameLogin() throws Exception {
+ final String loginName = "us2er";
+ final String loginPass = "user";
+
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN), "Expected DOM element for
login link does not exist.");
+ Assert.assertEquals(selenium.getText(LNK_LOGIN), "Login", "Login button
doesn't exist.");
+
+ selenium.click(LNK_LOGIN);
+ selenium.selectFrame(FRM_LOGINFORM);
+
+ waitForElement(INP_USERNAME);
+ waitForElement(INP_PASSWORD);
+
+ Assert.assertTrue(selenium.isElementPresent(INP_USERNAME), "Expected input DOM
element for username doesn't exist.");
+ selenium.type(INP_USERNAME, loginName);
+ Assert.assertTrue(selenium.isElementPresent(INP_PASSWORD), "Expected input DOM
element for password doesn't exist.");
+ selenium.type(INP_PASSWORD, loginPass);
+ selenium.click(SUB_LOGIN);
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent("The user doesn't exist or the
password is incorrect "), "\"Logged in as\" message missing.");
+ }
+
+ @Test(enabled = true, description = "login as 'user' with wrong password
'us2er'.")
+ public void testFalsePasswordLogin() throws Exception {
+ final String loginName = "user";
+ final String loginPass = "us2er";
+
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN), "Expected DOM element for
login link does not exist.");
+ Assert.assertEquals(selenium.getText(LNK_LOGIN), "Login", "Login button
doesn't exist.");
+
+ selenium.click(LNK_LOGIN);
+ selenium.selectFrame(FRM_LOGINFORM);
+
+ waitForElement(INP_USERNAME);
+ waitForElement(INP_PASSWORD);
+
+ Assert.assertTrue(selenium.isElementPresent(INP_USERNAME), "Expected input DOM
element for username doesn't exist.");
+ selenium.type(INP_USERNAME, loginName);
+ Assert.assertTrue(selenium.isElementPresent(INP_PASSWORD), "Expected input DOM
element for password doesn't exist.");
+ selenium.type(INP_PASSWORD, loginPass);
+ selenium.click(SUB_LOGIN);
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent("The user doesn't exist or the
password is incorrect "), "\"Logged in as\" message missing.");
+ }
+
}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -11,45 +11,38 @@
*/
@Test(groups = { "cms_wsrp" }, enabled = true, description = "WSRP test
case.")
public class WSRPTestCase extends JBossPortalSeleniumTestCase {
- private static final String INP_CONSUMER_NAME =
"//input[contains(@id,'edit-cons-form:id')]";
- private static final String CHK_CONSUMER_WSDL
="//input[contains(@id,'edit-cons-form:useWSDL')]";
- private static final String INP_WSDL_DESC_URL
="//input[contains(@id,'edit-cons-form:sd')]";
- private static final String INP_WSDL_MARK_URL
="//input[contains(@id,'edit-cons-form:m')]";
- private static final String INP_WSDL_REGI_URL
="//input[contains(@id,'edit-cons-form:r')]";
- private static final String INP_WSDL_PMAN_URL
="//input[contains(@id,'edit-cons-form:pm')]";
+ public static String casePfx = "test.wsrp.";
- private static final String SUBMIT_REFRESH_CANCEL =
"//a[contains(@id,'edit-cons-form:list-cons-link')]";
- private static final String SUBMIT_PROD_SAVE =
"//input[contains(@id,'producer-form:save-producer')]";
- private static final String SUBMIT_CONSDEL_CONF =
"//a[contains(@id,'confirm-delete-form:destroy-link')]";
+ private final String INP_CONSUMER_NAME =
getProp(casePfx+"inp.consumer.name","//input[contains(@id,'edit-cons-form:id')]");
+ private final String SUB_REFRESH_CANCEL =
getProp(casePfx+"submit.refresh.cancel","//a[contains(@id,'edit-cons-form:list-cons-link')]");
+ private final String SUB_PROD_SAVE =
getProp(casePfx+"submit.prod.save","//input[contains(@id,'producer-form:save-producer')]");
+ private final String SUB_CONSDEL_CONF =
getProp(casePfx+"submit.consdel.conf","//a[contains(@id,'confirm-delete-form:destroy-link')]");
+ private final String SUB_CONS_REGVAL =
getProp(casePfx+"submit.cons.regval","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+ private final String SUB_REFRESHFINAL =
getProp(casePfx+"submit.refreshfinal","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+ private final String INPUT_CONS_REGVALUE =
getProp(casePfx+"input.cons.regvalue","//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]");
+ private final String SUBMIT_REFRESHSAVE =
getProp(casePfx+"submit.refreshsave","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+ private final String INPUT_CONSWSDL =
getProp(casePfx+"input.conswsdl","//input[contains(@id,'edit-cons-form:wsdl')]");
+ private final String INPUT_CACHEEXP =
getProp(casePfx+"input.cacheexp","//input[contains(@id,'edit-cons-form:cache')]");
+ private final String SUBMIT_ADDPROP_INIT =
getProp(casePfx+"submit.addprop.init","//a[contains(@id,'producer-form:add-reg-prop')]");
+ private final String SUBMIT_ADDPROP =
getProp(casePfx+"submit.addprop","//a[contains(@id,'producer-form:add-reg-prop')]");
+ private final String INPUT_PROPHINT =
getProp(casePfx+"input.prophint","//input[contains(@id,'producer-form:reg-properties:0:hint')]");
+ private final String INPUT_PROPLABEL =
getProp(casePfx+"input.proplabel","//input[contains(@id,'producer-form:reg-properties:0:label')]");
+ private final String INPUT_PROPNAME =
getProp(casePfx+"input.propname","//input[contains(@id,'producer-form:reg-properties:0:name')]");
+ private final String SUBMIT_CREATECONS =
getProp(casePfx+"submit.createcons","//input[contains(@id,'createConsumer:createConsumerButton')]");
+ private final String INPUT_CREATECONS =
getProp(casePfx+"input.createcons","//input[contains(@id,'createConsumer:consumerName')]");
+ private final String ID_LINK_PRODCONF =
getProp(casePfx+"id.link.prodconf","//a[contains(@id,'cons-temp-form:producer-link')]");
+ private final String ID_LINK_CONSCONF =
getProp(casePfx+"id.link.consconf","//a[contains(@id,'producer-temp-form:consumersTab')]");
+ private final String LINK_CONSUMER_HOME
=getProp(casePfx+"link.consumer.home","//a[contains(@id,'cons-temp-form1:list-cons-link')]");
+ private final String
LINK_T_CONS_CON=getProp(casePfx+"link.t.cons.con","//a[contains(@id,''consumer-list-form:consumersList:{0}:configure'')]");
+ private final String
LINK_T_CONS_REF=getProp(casePfx+"link.t.cons.ref","//a[contains(@id,''consumer-list-form:consumersList:{0}:refresh'')]");
+ private final String
LINK_T_CONS_ACT=getProp(casePfx+"link.t.cons.act","//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]");
+ private final String
LINK_T_CONS_DEA=getProp(casePfx+"link.t.cons.dea","//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]");
+ private final String
LINK_T_CONS_REG=getProp(casePfx+"link.t.cons.reg","//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]");
+ private final String
LINK_T_CONS_DER=getProp(casePfx+"link.t.cons.der","//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]");
+ private final String
LINK_T_CONS_DEL=getProp(casePfx+"link.t.cons.del","//a[contains(@id,''consumer-list-form:consumersList:{0}:delete'')]");
+ private final String WSRP_CONSUMER_TABLE =
getProp(casePfx+"link.wsrp.consumer.table","//table[contains(@id,':consumer-list-form:consumersList')]");
- private static final String SUBMIT_CONS_REGVAL =
"//input[contains(@id,'edit-cons-form:refresh-cons-link')]";
- private static final String SUBMIT_REFRESHFINAL =
"//input[contains(@id,'edit-cons-form:refresh-cons-link')]";
-
- private static final String INPUT_CONS_REGVALUE =
"//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]";
- private static final String SUBMIT_REFRESHSAVE =
"//input[contains(@id,'edit-cons-form:refresh-cons-link')]";
- private static final String INPUT_CONSWSDL =
"//input[contains(@id,'edit-cons-form:wsdl')]";
- private static final String INPUT_CACHEEXP =
"//input[contains(@id,'edit-cons-form:cache')]";
- private static final String SUBMIT_ADDPROP_INIT =
"//a[contains(@id,'producer-form:add-reg-prop')]";
- private static final String SUBMIT_ADDPROP =
"//a[contains(@id,'producer-form:add-reg-prop')]";
- private static final String INPUT_PROPHINT =
"//input[contains(@id,'producer-form:reg-properties:0:hint')]";
- private static final String INPUT_PROPLABEL =
"//input[contains(@id,'producer-form:reg-properties:0:label')]";
- private static final String INPUT_PROPNAME =
"//input[contains(@id,'producer-form:reg-properties:0:name')]";
- private static final String SUBMIT_CREATECONS =
"//input[contains(@id,'createConsumer:createConsumerButton')]";
- private static final String INPUT_CREATECONS =
"//input[contains(@id,'createConsumer:consumerName')]";
- private static final String ID_LINK_PRODCONF =
"//a[contains(@id,'cons-temp-form:producer-link')]";
- private static final String ID_LINK_CONSCONF =
"//a[contains(@id,'producer-temp-form:consumersTab')]";
- private static final String LINK_CONSUMER_HOME
="//a[contains(@id,'cons-temp-form1:list-cons-link')]";
-
- private static final String
LINK_T_CONS_CON="//a[contains(@id,''consumer-list-form:consumersList:{0}:configure'')]";
- private static final String
LINK_T_CONS_REF="//a[contains(@id,''consumer-list-form:consumersList:{0}:refresh'')]";
- private static final String
LINK_T_CONS_ACT="//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]";
- private static final String
LINK_T_CONS_DEA="//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]";
- private static final String
LINK_T_CONS_REG="//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]";
- private static final String
LINK_T_CONS_DER="//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]";
- private static final String
LINK_T_CONS_DEL="//a[contains(@id,''consumer-list-form:consumersList:{0}:delete'')]";
-
- public static String WSRP_CONSUMER_TABLE =
"//table[contains(@id,':consumer-list-form:consumersList')]";
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
logoutIfPossible();
@@ -75,7 +68,6 @@
selenium.click(SUBMIT_CREATECONS);
selenium.waitForPageToLoad(PAGE_LOAD);
-
selenium.type(INPUT_CACHEEXP, "600");
selenium.type(INPUT_CONSWSDL,
"http://wsrp.bea.com:7001/producer/producer?WSDL");
@@ -85,10 +77,10 @@
Assert.assertTrue(selenium.isTextPresent("Missing value"));
selenium.type(INPUT_CONS_REGVALUE, "public");
- selenium.click(SUBMIT_CONS_REGVAL);
+ selenium.click(SUB_CONS_REGVAL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Refresh was successful."));
- selenium.click(SUBMIT_REFRESHFINAL);
+ selenium.click(SUB_REFRESHFINAL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("BEA"));
}
@@ -134,7 +126,7 @@
selenium.click(MessageFormat.format(LINK_T_CONS_DER,r));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(SUBMIT_REFRESH_CANCEL);
+ selenium.click(SUB_REFRESH_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertEquals(selenium.getText(MessageFormat.format(LINK_T_CONS_DER,r)),
"Register");
@@ -187,15 +179,7 @@
@Test(enabled = false, dependsOnMethods = { "testCreateBeaConsumer" },
description = "Standard BEA consumer configuring.")
public void testBeaConsumerConfigure() {
- selenium.open("/portal/");
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=WSRP");
- selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_CONSCONF);
- clickIfVisible(LINK_CONSUMER_HOME);
-
+
}
@Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer" },
description = "Standard BEA consumer deleting.")
@@ -222,7 +206,7 @@
Assert.assertTrue(selenium.isTextPresent("Delete 'BEAdel'
consumer?"));
- clickAndWait(SUBMIT_CONSDEL_CONF);
+ clickAndWait(SUB_CONSDEL_CONF);
Assert.assertFalse(selenium.isTextPresent("BEAdel"));
}
@@ -236,15 +220,15 @@
selenium.click("link=WSRP");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_PRODCONF,"Producer configuration");
-
+ clickIfVisible(ID_LINK_PRODCONF);
+ Assert.assertTrue(selenium.isTextPresent("Producer configuration"));
clickAndWait(SUBMIT_ADDPROP_INIT);
selenium.type(INPUT_PROPNAME, "testProp");
selenium.type(INPUT_PROPLABEL, "testProp label");
selenium.type(INPUT_PROPHINT, "tetsPropHint");
- selenium.click(SUBMIT_PROD_SAVE);
+ selenium.click(SUB_PROD_SAVE);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Producer configuration successfully
saved!"));
@@ -303,40 +287,6 @@
Assert.assertTrue(r>0, "Renamed consumer not found in table");
}
- @Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer" },
description = "WSDL checkbox functionality in consumer interface.")
- public void testConsumerWSDLCheckbox() {
- selenium.open("/portal/");
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=WSRP");
- selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_CONSCONF);
-
- selenium.type(INPUT_CREATECONS, "checkBEAwsdl");
-
- selenium.click(SUBMIT_CREATECONS);
- selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertTrue(selenium.isChecked(CHK_CONSUMER_WSDL),"wsdl checkbox not checked
after creating new consumer");
-
- selenium.click(CHK_CONSUMER_WSDL);
-
- waitForElement(INP_WSDL_DESC_URL);
- waitForElement(INP_WSDL_MARK_URL);
- waitForElement(INP_WSDL_PMAN_URL);
- waitForElement(INP_WSDL_REGI_URL);
-
- waitFor(10000);
-
- Assert.assertTrue(selenium.isElementPresent(INP_WSDL_DESC_URL), "wsdl attribute
seen after unchecking the wsdl checkbox #1");
- Assert.assertTrue(selenium.isElementPresent(INP_WSDL_MARK_URL), "wsdl attribute
seen after unchecking the wsdl checkbox #2");
- Assert.assertTrue(selenium.isElementPresent(INP_WSDL_PMAN_URL), "wsdl attribute
seen after unchecking the wsdl checkbox #3");
- Assert.assertTrue(selenium.isElementPresent(INP_WSDL_REGI_URL), "wsdl attribute
seen after unchecking the wsdl checkbox #4");
-
-
- }
-
private void createConsumer(String name, String timeout, String address) {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -357,10 +307,10 @@
selenium.waitForPageToLoad(PAGE_LOAD);
waitForElement(INPUT_CONS_REGVALUE);
selenium.type(INPUT_CONS_REGVALUE, "public");
- selenium.click(SUBMIT_CONS_REGVAL);
+ selenium.click(SUB_CONS_REGVAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(SUBMIT_REFRESHFINAL);
+ selenium.click(SUB_REFRESHFINAL);
selenium.waitForPageToLoad(PAGE_LOAD);
}
}
\ No newline at end of file
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -13,8 +13,8 @@
@Test(groups = { "cms_archive_upload" }, enabled = true)
public class CMSArchiveUploadTestCase extends JBossPortalSeleniumTestCase {
- private static final Integer ARCHIVE_WAITING = 10000;
- private static final int n = 10;
+ private static final Integer ARCHIVE_WAITING = 5000;
+ private static final int n = 50;
/*
* uncomment following lines and set the right path to the workspace in the
* case you want to use this test case locally from eclipse
@@ -24,13 +24,16 @@
System.setProperty("workspace",
"/home/vrockai/workspace/p2.7tests/ui-tests/");
}
*/
- private static final String SUB_CANCEL_ARCH_UPLOAD = "cancel";
- private static final String LNK_ADMIN = "link=Admin";
- private static final String LNK_CMS = "link=CMS";
- private static final String SUB_SEND_ARCHIVE = "submit";
- private static final String INP_ARCHIVE_FILE = "response";
- private static final String DIV_ARCHIVE_STATUS =
"//div[@id='center']/div/div/table/tbody/tr[2]/td/font";
- private static final String SEL_ACTION =
"//div[@id='center']/div/div/div[1]/div/select";
+
+ private final String casePfx = "cms.arch.";
+ private final String SUB_CANCEL_ARCH_UPLOAD =
getProp(casePfx+"sub.cancel.arch.upload","cancel");
+ private final String LNK_ADMIN =
getProp(casePfx+"lnk.admin","link=Admin");
+ private final String LNK_CMS =
getProp(casePfx+"lnk.cms","link=CMS");
+ private final String SUB_SEND_ARCHIVE =
getProp(casePfx+"sub.send.archive","submit");
+ private final String INP_ARCHIVE_FILE =
getProp(casePfx+"inp.archive.file","response");
+ private final String DIV_ARCHIVE_STATUS =
getProp(casePfx+"div.archive.status","//div[@id='center']/div/div/table/tbody/tr[2]/td/font");
+ private final String SEL_ACTION =
getProp(casePfx+"sel.action","//div[@id='center']/div/div/div[1]/div/select");
+
private final String WORKSPACE = System.getProperty("workspace");
@BeforeMethod(groups = { "log" })
@@ -38,7 +41,7 @@
logoutIfPossible();
login("admin", "admin");
// timeout hack
- selenium.setSpeed("15000");
+ selenium.setSpeed("10000");
}
@AfterMethod(groups = { "log" })
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -12,17 +12,18 @@
@Test(groups = { "cms_directory" }, enabled = true)
public class CMSDirectoryTestCase extends JBossPortalSeleniumTestCase {
+ private final String casePfx = "cms.dir.";
+ private final String SEL_CMS_ACTION = getProp(casePfx + "sel.cms.action",
"//div[@id='center']/div/div/div[1]/div/select");
+ private final String ADR_CMS_INTERFACE = getProp(casePfx +
"adr.cms.interface", "/portal/auth/portal/admin/CMS");
- private static final String SEL_CMS_ACTION =
"//div[@id='center']/div/div/div[1]/div/select";
- private static final String ADR_CMS_INTERFACE =
"/portal/auth/portal/admin/CMS";
private final String defaultDirName = "default";
private final String tempDirName = "tempDir";
private final String copyDirName = "copySrc";
private final String moveDirName = "moveSrc";
- private final String CMS_FILE_TABLE =
"//div[@id='center']/div/div/div[3]/table";
+ private final String CMS_FILE_TABLE = getProp(casePfx + "cms.file.table",
"//div[@id='center']/div/div/div[3]/table");
- @BeforeMethod( groups = { "log" })
+ @BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
logoutIfPossible();
login("admin", "admin");
@@ -33,11 +34,11 @@
}
- @Test(enabled = true, description="Directory creation.")
+ @Test(enabled = true, description = "Directory creation.")
public void testCreateDirectory() {
-
+
// cancelling of creating
-
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
@@ -45,7 +46,7 @@
selenium.open(ADR_CMS_INTERFACE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isTextPresent(tempDirName), "Test folder is already
present.");
selenium.select(SEL_CMS_ACTION, "label=Create Folder");
@@ -54,11 +55,11 @@
selenium.type("newcollectionname", tempDirName);
selenium.type("newcollectiondescription", "test folder");
selenium.click("cancel");
-
+
// really creating
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
@@ -66,7 +67,7 @@
selenium.open(ADR_CMS_INTERFACE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isTextPresent(tempDirName), "Test folder is already
present.");
selenium.select(SEL_CMS_ACTION, "label=Create Folder");
@@ -75,9 +76,9 @@
selenium.type("newcollectionname", tempDirName);
selenium.type("newcollectiondescription", "test folder");
selenium.click("submit");
-
+
// assuring that the directory is deleted
-
+
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isElementPresent("//div[@id='center']/div/div/ul/li[3]"));
Assert.assertEquals(tempDirName,
selenium.getText("//div[@id='center']/div/div/ul/li[3]"));
@@ -87,16 +88,16 @@
}
- @Test(enabled = true, dependsOnMethods =
"testCreateDirectory",description="Directory delete.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description =
"Directory delete.")
public void testDeleteDirectory() {
-
+
// firstly cancel the delete process
-
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertTrue(selenium.isElementPresent("link=" + tempDirName));
selenium.select(takeAction(tempDirName) + "/select",
"label=Delete");
selenium.click(takeAction(tempDirName) + "/select/option[4]");
@@ -109,10 +110,10 @@
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this
resource?"));
selenium.click("cancel");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// really deleting
selenium.open(ADDR_PORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
@@ -133,16 +134,16 @@
// assuring that the deletition was processed
selenium.open(ADDR_PORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isElementPresent("link=" + tempDirName));
}
- @Test(enabled = true, dependsOnMethods =
"testCreateDirectory",description="Copying of directory.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description =
"Copying of directory.")
public void testCopyDirectory() {
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -174,7 +175,6 @@
selenium.click("link=" + defaultDirName);
selenium.click("submit");
selenium.waitForPageToLoad(PAGE_LOAD);
- savePage("2.html");
Assert.assertEquals("copySrc",
selenium.getText("//div[@id='center']/div/div/ul/li[5]"));
Assert.assertTrue(selenium.isElementPresent("link=" + defaultDirName));
selenium.click("link=Home");
@@ -186,9 +186,9 @@
}
- @Test(enabled = true, dependsOnMethods =
"testCreateDirectory",description="Canceling of copying of
directory.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description =
"Canceling of copying of directory.")
public void testCopyCancelDirectory() {
- String copyCancelDirName = "L"+ "copyLDirName" +
"Cancel";
+ String copyCancelDirName = "L" + "copyLDirName" +
"Cancel";
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -227,9 +227,9 @@
}
- @Test(enabled = true, dependsOnMethods =
"testCreateDirectory",description="Moving a directory.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description =
"Moving a directory.")
public void testMoveDirectory() {
- //selenium.setSpeed("3000");
+ // selenium.setSpeed("3000");
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
@@ -274,7 +274,7 @@
}
- @Test(enabled = true, dependsOnMethods = "testCreateDirectory",
description="Canceling of moving a directory.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description =
"Canceling of moving a directory.")
public void testMoveCancelDirectory() {
String moveCancelDirName = "X" + "moveXDirName" +
"Cancel";
@@ -312,10 +312,10 @@
selenium.click("link=Home");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click("link=" + defaultDirName);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isElementPresent("link=" + moveCancelDirName));
}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -13,10 +13,11 @@
@Test(groups = { "cms_file" }, enabled = true)
public class CMSFileTestCase extends JBossPortalSeleniumTestCase {
- private static final String TBL_CMS_FILEVER =
"//div[@id='center']/div/div/table";
- public static final String TBL_CMS_FILE =
"//div[@id='center']/div/div/div[3]/table";
- public static final String TBL_FILE_PENDING =
"//div[@id='center']/div/div/table[2]";
- public static final String EDITOR_CONTENT = "mce_editor_0";
+ private final String casePfx = "cms.file.";
+
+ private final String TBL_CMS_FILEVER =
getProp(casePfx+"tbl.cms.filever","//div[@id='center']/div/div/table");
+ public final String TBL_CMS_FILE =
getProp(casePfx+"tbl.cms.file","//div[@id='center']/div/div/div[3]/table");
+ public final String TBL_FILE_PENDING =
getProp(casePfx+"tbl.file.pending","//div[@id='center']/div/div/table[2]");
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
@@ -39,9 +40,9 @@
Assert.assertTrue(selenium.isElementPresent("link=default"));
selenium.click("link=default");
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isElementPresent("link=images"), "images
folder is missing");
- Assert.assertTrue(selenium.isElementPresent("link=private"), "private
folder is missing");
- Assert.assertTrue(selenium.isElementPresent("link=index.html"),
"index.html is missing");
+ Assert.assertTrue(selenium.isElementPresent("link=images"));
+ Assert.assertTrue(selenium.isElementPresent("link=private"));
+ Assert.assertTrue(selenium.isElementPresent("link=index.html"));
//Assert.assertTrue(selenium.isElementPresent("link=project.html"));
//Assert.assertTrue(selenium.isElementPresent("link=support.html"));
selenium.click("link=index.html");
@@ -111,9 +112,6 @@
selenium.type("description", "newFile description");
selenium.type("title", "newFile title");
selenium.select("language", "label=Czech");
-
- fillInEditor(EDITOR_CONTENT,"now i'm not empty!");
-
selenium.click("save");
selenium.waitForPageToLoad(PAGE_LOAD);
/*
@@ -152,9 +150,6 @@
selenium.type("description", "file2edit description");
selenium.type("title", "file2edit title");
selenium.select("language", "label=Czech");
-
- fillInEditor(EDITOR_CONTENT,"edit me, please!");
-
selenium.click("save");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -197,9 +192,6 @@
selenium.type("description", "existingFile description");
selenium.type("title", "existingFile title");
selenium.select("language", "label=Czech");
-
- fillInEditor(EDITOR_CONTENT,"i already exist!");
-
selenium.click("save");
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertEquals("Czech", selenium.getText("link=Czech"));
@@ -227,9 +219,6 @@
selenium.type("description", "fileToMove description");
selenium.type("title", "fileToMove title");
selenium.select("language", "label=Czech");
-
- fillInEditor(EDITOR_CONTENT,"move on!");
-
selenium.click("save");
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertEquals("Czech", selenium.getText("link=Czech"));
@@ -274,9 +263,6 @@
selenium.type("description", "file2copy description");
selenium.type("title", "file2copy title");
selenium.select("language", "label=Czech");
-
- fillInEditor(EDITOR_CONTENT,"want to be a copy?");
-
selenium.click("save");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -333,7 +319,6 @@
selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr[3]/td[2]/form/select/option[4]");
selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr[3]/td[2]/form/input");
selenium.waitForPageToLoad(PAGE_LOAD);
-
Assert.assertTrue(selenium.isTextPresent("Confirm Deletion of /newFile"));
Assert.assertTrue(selenium.isTextPresent("WARNING! You will not be able to undo
these change!"));
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this
resource?"));
@@ -367,9 +352,6 @@
selenium.type("description", name + " description");
selenium.type("title", "existingFile title");
selenium.select("language", "label=Czech");
-
- fillInEditor(EDITOR_CONTENT,"contemporary content");
-
selenium.click("save");
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertEquals("Czech", selenium.getText("link=Czech"));
@@ -402,8 +384,4 @@
selenium.waitForPageToLoad(PAGE_LOAD);
logout();login("admin","admin");
}
-
- private void fillInEditor(String locator, String content){
- selenium.getEval("selenium.fillInEditor(\"" + locator +
"\",\"" + content + "\")");
- }
}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -19,7 +19,9 @@
System.setProperty("workspace","/home/vrockai/workspace/selenium/selenium/"
); }
*/
- private final String CMS_FILE_TABLE =
"//div[@id='center']/div/div/div[3]/table";
+ private final String casePfx = "cms.file.up.";
+
+ private final String CMS_FILE_TABLE =
getProp(casePfx+"cms.file.table","//div[@id='center']/div/div/div[3]/table");
private final String WORKSPACE = System.getProperty("workspace");
@BeforeMethod(groups = { "log" })
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -1,5 +1,7 @@
package org.jboss.portal.test.selenium.cms;
+import java.text.MessageFormat;
+
import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
@@ -13,17 +15,35 @@
@Test(groups = { "cms_file_workflow" }, enabled = true)
public class CMSFileWorkflowTestCase extends JBossPortalSeleniumTestCase {
- private static final String SELECT_CMS_MAIN =
"//div[@id='center']/div/div/div[1]/div/select";
+ private static final String SUB_MOVE = "submit";
- private final String CMS_FILE_TABLE =
"//div[@id='center']/div/div/div[3]/table";
+ public final String casePfx = "cms.file.work.";
+
+ private final String LAB_LANG_CZECH =
getProp(casePfx+"lab.lang.czech","label=Czech");
+ private final String LNK_DENY =
getProp(casePfx+"lnk.deny","link=Deny");
+ private final String LNK_PREVIEW =
getProp(casePfx+"lnk.preview","link=Preview");
+ private final String LNK_APPROVE =
getProp(casePfx+"lnk.approve","link=Approve");
+ private final String SUB_FILE_CREATE =
getProp(casePfx+"sub.file.create","save");
+ private final String SUB_FILE_CREATE_CANCEL =
getProp(casePfx+"sub.file.create.cancel","cancel");
+ private final String SEL_LANG =
getProp(casePfx+"sel.lang","language");
+ private final String INP_TITLE =
getProp(casePfx+"inp.title","title");
+ private final String INP_DESC =
getProp(casePfx+"inp.desc","description");
+ private final String INP_FILENAME =
getProp(casePfx+"inp.filename","filename");
+ private final String LAB_CREATE_FILE =
getProp(casePfx+"lab.create.file","label=Create File");
+ private final String LNK_CMS =
getProp(casePfx+"lnk.cms","link=CMS");
+ private final String LNK_ADMIN =
getProp(casePfx+"lnk.admin","link=Admin");
+
+ public final String SELECT_CMS_MAIN =
getProp(casePfx+"select.cms.main","//div[@id='center']/div/div/div[1]/div/select");
+ public final String CMS_FILE_TABLE =
getProp(casePfx+"cms.file.table","//div[@id='center']/div/div/div[3]/table");
+
+ public final String CMS_T_SELECT =
getProp(casePfx+"cms.t.select","//div[@id=''center'']/div/div/div[3]/table/tbody/tr[{0}]/td[2]/form/select");
+ public final String CMS_T_SUBMIT =
getProp(casePfx+"cms.t.submit","//div[@id=''center'']/div/div/div[3]/table/tbody/tr[{0}]/td[2]/form/input");
+
+ public final String CMS_WF_TABLE =
getProp(casePfx+"cms.wf.table","//div[@id='center']/div/div/table[2]");
+ public final String CMS_FV_TABLE =
getProp(casePfx+"cms.fv.table","//div[@id='center']/div/div/table");
+ public final String CMS_T_VER =
getProp(casePfx+"cms.t.ver","//div[@id=''center'']/div/div/table/tbody/tr[{0}]/td[1]/a");
+ public final String WYSIWYG_EDITOR_LOCATOR =
getProp(casePfx+"wysiwyg.editor.locator","mce_editor_0");
- // file workflow table in CMS
- private final String CMS_WF_TABLE =
"//div[@id='center']/div/div/table[2]";
-
- // file version table in CMS
- private final String CMS_FV_TABLE =
"//div[@id='center']/div/div/table";
- public static String WYSIWYG_EDITOR_LOCATOR = "mce_editor_0";
-
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
logoutIfPossible();
@@ -40,50 +60,50 @@
// canceling first
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SELECT_CMS_MAIN, "label=Create File");
+ selenium.select(SELECT_CMS_MAIN, LAB_CREATE_FILE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("filename", "newFile");
- selenium.type("description", "newFile description");
- selenium.type("title", "newFile title");
- selenium.select("language", "label=Czech");
+ selenium.type(INP_FILENAME, "newFile");
+ selenium.type(INP_DESC, "newFile description");
+ selenium.type(INP_TITLE, "newFile title");
+ selenium.select(SEL_LANG, LAB_LANG_CZECH);
- selenium.click("cancel");
+ selenium.click(SUB_FILE_CREATE_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
// saving
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SELECT_CMS_MAIN, "label=Create File");
+ selenium.select(SELECT_CMS_MAIN, LAB_CREATE_FILE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("filename", "newFile");
- selenium.type("description", "newFile description");
- selenium.type("title", "newFile title");
- selenium.select("language", "label=Czech");
+ selenium.type(INP_FILENAME, "newFile");
+ selenium.type(INP_DESC, "newFile description");
+ selenium.type(INP_TITLE, "newFile title");
+ selenium.select(SEL_LANG, LAB_LANG_CZECH);
- selenium.click("save");
+ selenium.click(SUB_FILE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
int row = countTableRows(CMS_WF_TABLE) - 1;
Assert.assertEquals(row, 1, "More instances of newly created document
exists.");
Assert.assertTrue(selenium.isTextPresent("Pending Approval Queue"));
- Assert.assertTrue(selenium.isElementPresent("link=Preview"));
- Assert.assertTrue(selenium.isElementPresent("link=Approve"));
- Assert.assertTrue(selenium.isElementPresent("link=Deny"));
+ Assert.assertTrue(selenium.isElementPresent(LNK_PREVIEW));
+ Assert.assertTrue(selenium.isElementPresent(LNK_APPROVE));
+ Assert.assertTrue(selenium.isElementPresent(LNK_DENY));
- selenium.click("link=Approve");
+ selenium.click(LNK_APPROVE);
selenium.waitForPageToLoad(PAGE_LOAD);
row = countTableRows(CMS_FV_TABLE) - 1;
@@ -93,29 +113,29 @@
@Test(enabled = true, description = "Simple file creation.")
public void testCreateFileDeny() {
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SELECT_CMS_MAIN, "label=Create File");
+ selenium.select(SELECT_CMS_MAIN, LAB_CREATE_FILE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("filename", "newFileDeny");
- selenium.type("description", "newFileDeny description");
- selenium.type("title", "newFileDeny title");
- selenium.select("language", "label=Czech");
- selenium.click("save");
+ selenium.type(INP_FILENAME, "newFileDeny");
+ selenium.type(INP_DESC, "newFileDeny description");
+ selenium.type(INP_TITLE, "newFileDeny title");
+ selenium.select(SEL_LANG, LAB_LANG_CZECH);
+ selenium.click(SUB_FILE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
int row = countTableRows(CMS_WF_TABLE) - 1;
Assert.assertEquals(row, 1, "More instances of newly created document
exists.");
Assert.assertTrue(selenium.isTextPresent("Pending Approval Queue"));
- Assert.assertTrue(selenium.isElementPresent("link=Preview"));
- Assert.assertTrue(selenium.isElementPresent("link=Approve"));
- Assert.assertTrue(selenium.isElementPresent("link=Deny"));
+ Assert.assertTrue(selenium.isElementPresent(LNK_PREVIEW));
+ Assert.assertTrue(selenium.isElementPresent(LNK_APPROVE));
+ Assert.assertTrue(selenium.isElementPresent(LNK_DENY));
- selenium.click("link=Deny");
+ selenium.click(LNK_DENY);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("newFileDeny"));
@@ -127,24 +147,24 @@
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Home");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SELECT_CMS_MAIN, "label=Create File");
+ selenium.select(SELECT_CMS_MAIN, LAB_CREATE_FILE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("filename", name);
- selenium.type("description", name + " description");
- selenium.type("title", "existingFile title");
- selenium.select("language", "label=Czech");
+ selenium.type(INP_FILENAME, name);
+ selenium.type(INP_DESC, name + " description");
+ selenium.type(INP_TITLE, "existingFile title");
+ selenium.select(SEL_LANG, LAB_LANG_CZECH);
fillInEditor("vivat!");
- selenium.click("save");
+ selenium.click(SUB_FILE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Preview");
+ selenium.click(LNK_PREVIEW);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Pending Approval Queue"));
@@ -154,36 +174,35 @@
@Test(enabled = true, dependsOnMethods = "testCreateFileApprove", description
= "Simple file delete Cancel in first step, and then delete.")
public void testDeleteFile() {
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
int row = findTableRow(CMS_FILE_TABLE, "newFile", 0) + 1;
- selenium.select("//div[@id='center']/div/div/div[3]/table/tbody/tr["+row+"]/td[2]/form/select",
"label=Delete");
- selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr["+row+"]/td[2]/form/select/option[4]");
- selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr["+row+"]/td[2]/form/input");
+ selenium.select(MessageFormat.format(CMS_T_SELECT,row), "label=Delete");
+ selenium.click(MessageFormat.format(CMS_T_SUBMIT,row));
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Confirm Deletion of /newFile"));
Assert.assertTrue(selenium.isTextPresent("WARNING! You will not be able to undo
these change!"));
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this
resource?"));
- selenium.click("cancel");
+ selenium.click(SUB_FILE_CREATE_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
row = findTableRow(CMS_FILE_TABLE, "newFile", 0) + 1;
- selenium.select(CMS_FILE_TABLE +
"/tbody/tr["+row+"]/td[2]/form/select", "label=Delete");
- selenium.click(CMS_FILE_TABLE +
"/tbody/tr["+row+"]/td[2]/form/select/option[4]");
- selenium.click(CMS_FILE_TABLE +
"/tbody/tr["+row+"]/td[2]/form/input");
+ selenium.select(MessageFormat.format(CMS_T_SELECT,row), "label=Delete");
+ selenium.click(MessageFormat.format(CMS_T_SUBMIT,row));
+
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Confirm Deletion of /newFile"));
Assert.assertTrue(selenium.isTextPresent("WARNING! You will not be able to undo
these change!"));
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this
resource?"));
- selenium.click("submit");
+ selenium.click(SUB_MOVE);
selenium.waitForPageToLoad(PAGE_LOAD);
}
@@ -193,18 +212,17 @@
//canceling first
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
int row = findTableRow(CMS_FILE_TABLE, "fileToMove", 0) + 1;
-
- selenium.select(CMS_FILE_TABLE + "/tbody/tr[" + row +
"]/td[2]/form/select", "label=Move");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr[" + row +
"]/td[2]/form/select/option[3]");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr[" + row +
"]/td[2]/form/input");
+ ;
+ selenium.select(MessageFormat.format(CMS_T_SELECT,row), "label=Move");
+ selenium.click(MessageFormat.format(CMS_T_SUBMIT,row));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=default");
- selenium.click("cancel");
+ selenium.click(SUB_FILE_CREATE_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
// assuming file is not moved
@@ -222,18 +240,17 @@
// really moving file
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
row = findTableRow(CMS_FILE_TABLE, "fileToMove", 0) + 1;
- selenium.select(CMS_FILE_TABLE + "/tbody/tr[" + row +
"]/td[2]/form/select", "label=Move");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr[" + row +
"]/td[2]/form/select/option[3]");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr[" + row +
"]/td[2]/form/input");
+ selenium.select(MessageFormat.format(CMS_T_SELECT,row), "label=Move");
+ selenium.click(MessageFormat.format(CMS_T_SUBMIT,row));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=default");
- selenium.click("submit");
+ selenium.click(SUB_MOVE);
selenium.waitForPageToLoad(PAGE_LOAD);
// assuming file is moved
@@ -252,18 +269,17 @@
@Test(enabled = true, dependsOnMethods = "testCreateFileApprove", description
= "File creation and copying to default directory.")
public void testCopyFile() {
createFile("file2copy","");
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
int row = findTableRow(CMS_FILE_TABLE, "file2copy", 0) + 1;
- selenium.select(CMS_FILE_TABLE + "/tbody/tr[" + row +
"]/td[2]/form/select", "label=Copy");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr[" + row +
"]/td[2]/form/select/option[3]");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr[" + row +
"]/td[2]/form/input");
+ selenium.select(MessageFormat.format(CMS_T_SELECT,row), "label=Copy");
+ selenium.click(MessageFormat.format(CMS_T_SUBMIT,row));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=default");
- selenium.click("submit");
+ selenium.click(SUB_MOVE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=default");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -286,27 +302,27 @@
// canceling for the first time
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link="+file);
selenium.waitForPageToLoad(PAGE_LOAD);
row = findTableRow(CMS_FV_TABLE, "1.1", 2) + 1;
- selenium.click(CMS_FV_TABLE + "/tbody/tr["+row+"]/td[1]/a");
+ selenium.click(MessageFormat.format(CMS_T_VER, row));
selenium.waitForPageToLoad(PAGE_LOAD);
fillInEditor("contentstring2");
- selenium.click("cancel");
+ selenium.click(SUB_FILE_CREATE_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
// really creating and approving
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Home");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -315,29 +331,29 @@
selenium.waitForPageToLoad(PAGE_LOAD);
row = findTableRow(CMS_FV_TABLE, "1.1", 2) + 1;
- selenium.click(CMS_FV_TABLE + "/tbody/tr["+row+"]/td[1]/a");
+ selenium.click(MessageFormat.format(CMS_T_VER, row));
selenium.waitForPageToLoad(PAGE_LOAD);
fillInEditor("contentstring2");
- selenium.click("save");
+ selenium.click(SUB_FILE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Approve");
+ selenium.click(LNK_APPROVE);
selenium.waitForPageToLoad(PAGE_LOAD);
row = findTableRow(CMS_FV_TABLE, "1.3", 2) + 1;
- selenium.click(CMS_FV_TABLE + "/tbody/tr["+row+"]/td[1]/a");
+ selenium.click(MessageFormat.format(CMS_T_VER, row));
selenium.waitForPageToLoad(PAGE_LOAD);
fillInEditor("contentstring3");
- selenium.click("save");
+ selenium.click(SUB_FILE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Deny");
+ selenium.click(LNK_DENY);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("1.5"));
row = findTableRow(CMS_FV_TABLE, "1.3", 2) + 1;
- selenium.click(CMS_FV_TABLE + "/tbody/tr["+row+"]/td[1]/a");
+ selenium.click(MessageFormat.format(CMS_T_VER, row));
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("contentstring2"));
@@ -349,24 +365,24 @@
// save and approve
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Home");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SELECT_CMS_MAIN, "label=Create File");
+ selenium.select(SELECT_CMS_MAIN, LAB_CREATE_FILE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("filename", name);
- selenium.type("description", name + " description");
- selenium.type("title", "existingFile title");
- selenium.select("language", "label=Czech");
+ selenium.type(INP_FILENAME, name);
+ selenium.type(INP_DESC, name + " description");
+ selenium.type(INP_TITLE, "existingFile title");
+ selenium.select(SEL_LANG, LAB_LANG_CZECH);
- selenium.click("save");
+ selenium.click(SUB_FILE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Approve");
+ selenium.click(LNK_APPROVE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Home");
selenium.waitForPageToLoad(PAGE_LOAD);
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -15,26 +15,44 @@
@Test(groups = { "cms_secure" }, enabled = true, description = "Setting
permissions on the default portlet.")
public class CMSSecureTestCase extends JBossPortalSeleniumTestCase {
+ private final String casePfx = "cms.sec.";
- private static final String LNK_EXPLORE =
"//area[(a)href='/portal/content/default/epp.html']";
- private static final String LNK_CMS_EXPLORE = "Link=private1.html";
- private static final String LNK_SUPPORT_HTML =
"//area[(a)href='/portal/content/default/project.html']";
- private static final String LNK_CMS_SUPPORT_HTML = "Link=project.html";
- private static final String LNK_MEMBERS = "link=Members";
- private static final String SUB_SECURITY_SET =
"//input[contains(@name,'submit')]";
- private static final String SEL_SECUREUSERS_MANAGE =
"//select[contains(@name,'secureusers:manage')]";
- private static final String SEL_SECUREROLES_MANAGE =
"//select[contains(@name,'secureroles:manage')]";
- private static final String SEL_SECUREUSERS_WRITE =
"//select[contains(@name,'secureusers:write')]";
- private static final String SEL_SECUREROLES_WRITE =
"//select[contains(@name,'secureroles:write')]";
- private static final String SEL_SECUREUSERS_READ =
"//select[contains(@name,'secureusers:read')]";
- private static final String SEL_SECUREROLES_READ =
"//select[contains(@name,'secureroles:read')]";
- private static final String LNK_INDEX_HTML = "link=index.html";
- private static final String LNK_DEFAULT = "link=default";
- private static final String LNK_CMS = "link=CMS";
- private static final String LNK_ADMIN = "link=Admin";
- private static final String LNK_LOGOUT = "link=Logout";
- private static final String SEL_CMS_ACTION =
"//div[@id='center']/div/div/div[1]/div/select";
+ private final String LNK_EXPLORE = getProp(casePfx + "lnk.explore",
"//area[(a)href='/portal/content/default/epp.html']");
+ private final String LNK_CMS_EXPLORE = getProp(casePfx + "lnk.cms.explore",
"Link=private1.html");
+ private final String LNK_MEMBERS = getProp(casePfx + "lnk.members",
"link=Members");
+ private final String SUB_SECURITY_SET = getProp(casePfx + "sub.security.set",
"//input[contains(@name,'submit')]");
+ private final String SEL_SECUREUSERS_MANAGE = getProp(casePfx +
"sel.secureusers.manage",
"//select[contains(@name,'secureusers:manage')]");
+ private final String SEL_SECUREROLES_MANAGE = getProp(casePfx +
"sel.secureroles.manage",
"//select[contains(@name,'secureroles:manage')]");
+ private final String SEL_SECUREUSERS_WRITE = getProp(casePfx +
"sel.secureusers.write",
"//select[contains(@name,'secureusers:write')]");
+ private final String SEL_SECUREROLES_WRITE = getProp(casePfx +
"sel.secureroles.write",
"//select[contains(@name,'secureroles:write')]");
+ private final String SEL_SECUREUSERS_READ = getProp(casePfx +
"sel.secureusers.read",
"//select[contains(@name,'secureusers:read')]");
+ private final String SEL_SECUREROLES_READ = getProp(casePfx +
"sel.secureroles.read",
"//select[contains(@name,'secureroles:read')]");
+ private final String LNK_INDEX_HTML = getProp(casePfx + "lnk.index.html",
"link=index.html");
+ private final String LNK_DEFAULT = getProp(casePfx + "lnk.default",
"link=default");
+ private final String LNK_CMS = getProp(casePfx + "lnk.cms",
"link=CMS");
+ private final String LNK_ADMIN = getProp(casePfx + "lnk.admin",
"link=Admin");
+ private final String LNK_LOGOUT = getProp(casePfx + "lnk.logout",
"link=Logout");
+ private final String SEL_CMS_ACTION = getProp(casePfx + "sel.cms.action",
"//div[@id='center']/div/div/div[1]/div/select");
+ public String caseIPfx = "iden.man.";
+ public final String LNK_ROLETAB = getProp(caseIPfx + "lnk.roletab",
"//a[contains(@id,'user-temp-form:role-mgm-link')]");
+ public final String LNK_ROLEMAIN = getProp(caseIPfx + "lnk.rolemain",
"//a[contains(@id, 'role-temp-form1:role-admin-link')]");
+ public final String LNK_ROLE_CREATE = getProp(caseIPfx + "lnk.role.create",
"//a[contains(@id, 'create-role-form:create-role-link')]");
+ public final String INP_ROLEDISNAME = getProp(caseIPfx + "inp.roledisname",
"//input[contains(@id,'create-role-form:roledisplayname')]");
+ public final String INP_ROLENAME = getProp(caseIPfx + "inp.rolename",
"//input[contains(@id,'create-role-form:rolename')]");
+ public final String SUB_ROLE_CREATE = getProp(caseIPfx + "sub.role.create",
"//input[contains(@id,'create-role-form:submit')]");
+ public final String SUB_ASSIGN_ROLE = getProp(caseIPfx + "sub.assign.role",
"//input[contains(@id,'assign-roles-form:submit')]");
+ public final String CHK_ROLE = getProp(caseIPfx + "chk.role",
"//input[contains(@name,''assign-roles-form:roles'') and
@value=''{0}'']");
+ public final String LNK_USERTAB = getProp(caseIPfx + "lnk.usertab",
"//a[contains(@id,'role-temp-form:manage-users')]");
+ public final String LNK_USERMAIN = getProp(caseIPfx + "lnk.usermain",
"//a[contains(@id,'user-temp-form1:user-adm-link')]");
+ public final String LNK_USERMANG_MAIN = getProp(caseIPfx +
"lnk.usermang.main",
"//a[contains(@id,'user-temp-form1:assign-role-link')]");
+ public final String SUB_SEARCH_USER = getProp(caseIPfx + "sub.search.user",
"//input[contains(@id,'search-user-form:search') and
@type='submit']");
+ public final String INP_SEARCH_USER = getProp(caseIPfx + "inp.search.user",
"//input[contains(@id,'search-user-form:searchString')]");
+ public final String LNK_SEARCH_USER = getProp(caseIPfx + "lnk.search.user",
"//a[contains(@id,'user-form:search-user-link')]");
+ public final String TBL_USERLIST = getProp(caseIPfx + "tbl.userlist",
"//table[contains(@id,'search-user-form1:userlist')]");
+ public final String LNK_T_USRLIST_ROLES = getProp(caseIPfx +
"lnk.t.usrlist.roles",
+ "//a[contains(@id,''search-user-form1:userlist:{0}:assign-role-link'')]");
+
@AfterMethod(groups = { "log" })
public void logoutAfterTestIfPossible() {
@@ -83,15 +101,15 @@
selenium.click(LNK_MEMBERS);
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(IdentityAdminTestCase.ID_LINK_ROLETAB);
- clickIfVisible(IdentityAdminTestCase.ID_LINK_ROLEMAIN);
+ clickIfVisible(LNK_ROLETAB);
+ clickIfVisible(LNK_ROLEMAIN);
- selenium.click(IdentityAdminTestCase.ID_BUT_ROLE_CREATE);
+ selenium.click(LNK_ROLE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(IdentityAdminTestCase.ID_INPUT_ROLENAME, roleName);
- selenium.type(IdentityAdminTestCase.ID_INPUT_ROLEDISNAME, roleDisplayName);
- selenium.click(IdentityAdminTestCase.ID_SUBMIT_ROLE_CREATE);
+ selenium.type(INP_ROLENAME, roleName);
+ selenium.type(INP_ROLEDISNAME, roleDisplayName);
+ selenium.click(SUB_ROLE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
logout();
}
@@ -165,10 +183,6 @@
login("admin", "admin");
Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied
"), "Non secured resource is not visible.#1");
- // Assert.assertFalse(selenium.isTextPresent(
- // "You are not allowed to access the following resource -
/default/index.html"
- // ),
- // "Non secured resource is not visible.#2");
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -195,7 +209,7 @@
}
- @Test(enabled = true, dependsOnMethods = { "testSetRoleReadPer2" },
description = "Set admin/secRole read permissions, login as user w secRole.")
+ @Test(enabled = true, description = "Set admin/secRole read permissions, login as
user w secRole.")
public void testSetRoleReadPer1() {
login("admin", "admin");
@@ -230,7 +244,7 @@
}
- @Test(enabled = true, description = "Set admin/secRole read permissions, login as
user w/o secRole.")
+ @Test(enabled = true, dependsOnMethods = { "testSetRoleReadPer1" },
description = "Set admin/secRole read permissions, login as user w/o secRole.")
public void testSetRoleReadPer2() {
login("admin", "admin");
@@ -294,7 +308,6 @@
@Test(enabled = true, dependsOnMethods = { "testSetRoleReadPer1" },
description = "Subpage permission test")
public void testSubpageSecurity() {
-
selenium.open("/portal/portal/default");
selenium.waitForPageToLoad(PAGE_LOAD);
login("admin","admin");
@@ -349,11 +362,11 @@
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: "
+ roleDisplay + " not found on the page.");
- final String CHECK_ROLE = MessageFormat.format(IdentityAdminTestCase.ID_CHECK_ROLE,
role);
+ final String CHECK_ROLE = MessageFormat.format(CHK_ROLE, role);
if (!selenium.isChecked(CHECK_ROLE)) {
selenium.click(CHECK_ROLE);
- selenium.click(IdentityAdminTestCase.ID_SUBMIT_ASSIGN_ROLE);
+ selenium.click(SUB_ASSIGN_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
}
searchUser(user, email);
@@ -373,11 +386,11 @@
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: "
+ roleDisplay + " not found on the page.");
// check the tempRole check box
- final String CHECK_ROLE = MessageFormat.format(IdentityAdminTestCase.ID_CHECK_ROLE,
role);
+ final String CHECK_ROLE = MessageFormat.format(CHK_ROLE, role);
if (selenium.isChecked(CHECK_ROLE)) {
selenium.click(CHECK_ROLE);
- selenium.click(IdentityAdminTestCase.ID_SUBMIT_ASSIGN_ROLE);
+ selenium.click(SUB_ASSIGN_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
}
searchUser(user, email);
@@ -397,19 +410,19 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(IdentityAdminTestCase.ID_LINK_USERTAB);
- clickIfVisible(IdentityAdminTestCase.ID_LINK_USERMAIN);
- clickIfVisible(IdentityAdminTestCase.LINK_USERMANG_MAIN);
+ clickIfVisible(LNK_USERTAB);
+ clickIfVisible(LNK_USERMAIN);
+ clickIfVisible(LNK_USERMANG_MAIN);
- selenium.click(IdentityAdminTestCase.LINK_SEARCH_USER);
+ selenium.click(LNK_SEARCH_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
+ //selenium.setSpeed("5000");
+ selenium.type(INP_SEARCH_USER, username);
+ //System.out.println(SUB_SEARCH_USER);
+ selenium.click(SUB_SEARCH_USER);
- selenium.type(IdentityAdminTestCase.ID_INPUT_SEARCH_USER, username);
- selenium.click(IdentityAdminTestCase.ID_SUBMIT_SEARCH_USER);
- // selenium.waitForPageToLoad(PAGE_LOAD);
-
try {
- Thread.sleep(5000);
+ Thread.sleep(10000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -417,11 +430,12 @@
Assert.assertTrue(selenium.isTextPresent(username), "Username was not
found.");
Assert.assertTrue(selenium.isTextPresent(email), "User email adress was not
found.");
+ //selenium.setSpeed("0");
}
private String butUsrRol_id(String userName) {
- String table = IdentityAdminTestCase.TABLE_USERLIST;
+ String table = TBL_USERLIST;
int r = findTableRow(table, userName, 0);
- return MessageFormat.format(IdentityAdminTestCase.LINK_T_USRLIST_ROLES, r - 1);
+ return MessageFormat.format(LNK_T_USRLIST_ROLES, r - 1);
}
}
Added:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
(rev 0)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties 2009-03-31
15:58:16 UTC (rev 13103)
@@ -0,0 +1,623 @@
+# JBossPortalSeleniumTestCase
+
+portal.lnk.logout=link=Logout
+portal.sub.login=login
+portal.adr.portal=/portal/
+portal.frm.login.content=login-content
+portal.inp.password=//input[contains(@id,'j_password')]
+portal.inp.username=//input[contains(@id,'j_username')]
+portal.lnk.login=link=Login
+
+# UserLoginTestCase
+
+user.login.adr.portal=/portal
+user.login.frm.main=relative=up
+user.login.sub.portal=cancel
+user.login.lnk.logout=link=Logout
+user.login.sub.login=login
+user.login.inp.password=//input[contains(@id,'j_password')]
+user.login.inp.username=//input[contains(@id,'j_username')]
+user.login.frm.login=login-content
+user.login.lnk.login=link=Login
+
+# IdentityAdminTestCase
+inp.user.search.prev=//input[contains(@id,'search-user-form1:prev-page')]
+inp.user.search.next=//input[contains(@id,'search-user-form1:next-page')]
+iden.man.sel.searchuser.limit=//select[contains(@id,'search-user-form:limit')]
+iden.man.sub.edit.prof=//input[contains(@id,'profile-form:submit')]
+iden.man.sub.pagin.left=//input[contains(@id,'search-user-form1:prev-page')]
+iden.man.sub.pagin.right=//input[contains(@id,'search-user-form1:next-page')]
+iden.man.sub.edit.user.email.cancel=//input[contains(@id,'profile-form:cancel')]
+iden.man.inp.edit.user.email=//input[contains(@id,'profile-form:email')]
+iden.man.sub.role.search.user=//input[contains(@id,'search-user-form:search') and
@type='submit']
+iden.man.inp.role.search.user=//input[contains(@id,'search-user-form:searchString')]
+iden.man.sub.edit.role.submit=//input[contains(@id,'edit-role-link:submit')]
+iden.man.sub.edit.role.cancel=//input[contains(@id,'edit-role-link:cancel')]
+iden.man.inp.edit.role.name=//input[contains(@id,'edit-role-link:display-name')]
+iden.man.sub.pass.change.submit=//input[contains(@name,'change-pwd-form:j_id31')]
+iden.man.sub.pass.change.cancel=//input[contains(@id,'change-pwd-form:cancel')]
+iden.man.inp.pass.change.p2=//input[contains(@id,':change-pwd-form:passwordCheck')]
+iden.man.inp.pass.change.p1=//input[contains(@id,':change-pwd-form:password')]
+iden.man.lnk.change.pass=//a[contains(@id,':profile-form:change-pwd-adm-link')]
+iden.man.tbl.userlist=//table[contains(@id,'search-user-form1:userlist')]
+iden.man.lnk.t.usrlist.del=//a[contains(@id,''search-user-form1:userlist:{0}:delete-user-link'')]
+iden.man.lnk.t.usrlist.roles=//a[contains(@id,''search-user-form1:userlist:{0}:assign-role-link'')]
+iden.man.lnk.t.usrlist.dis=//a[contains(@id,''search-user-form1:userlist:{0}:enable-user-link'')]
+iden.man.lnk.t.usrlist.edit=//a[contains(@id,''search-user-form1:userlist:{0}:rename-link'')]
+iden.man.tbl.rolelist=//table[contains(@id,'roles-form:userlist')]
+iden.man.lnk.t.rollist.del=//a[contains(@id,''roles-form:userlist:{0}:delete-role-link'')]
+iden.man.lnk.t.rollist.members=//a[contains(@id,''roles-form:userlist:{0}:view-role-link'')]
+iden.man.lnk.t.rollist.edit=//a[contains(@id,''roles-form:userlist:{0}:edit-role-link'')]
+iden.man.tbl.rolemembers=//table[contains(@id,'role-members-form:role-data-table')]
+iden.man.sub.conf.create.user=//input[contains(@id,'confirm-form:admin')]
+iden.man.sub.delete.role=//input[contains(@id,'delete-role-form:confirm')]
+iden.man.sub.role.create=//input[contains(@id,'create-role-form:submit')]
+iden.man.inp.roledisname=//input[contains(@id,'create-role-form:roledisplayname')]
+iden.man.inp.rolename=//input[contains(@id,'create-role-form:rolename')]
+iden.man.lnk.role.create=//a[contains(@id, 'create-role-form:create-role-link')]
+iden.man.sub.del.user=//input[contains(@id,'delete-user-form:submit')]
+iden.man.sub.assign.role=//input[contains(@id,'assign-roles-form:submit')]
+iden.man.sub.user.role=//input[contains(@id,'register-role-form:submit')]
+iden.man.sub.create.user=//input[contains(@id,'register-form:submit')]
+iden.man.inp.password.chk=//input[contains(@id,'register-form:passwordCheck')]
+iden.man.inp.password=//input[contains(@id,'register-form:password')]
+iden.man.inp.useremail=//input[contains(@id,'register-form:email')]
+iden.man.inp.username=//input[contains(@id,'register-form:username')]
+iden.man.sub.search.user=//input[contains(@id,'search-user-form:search') and
@type='submit']
+iden.man.inp.search.user=//input[contains(@id,'search-user-form:searchString')]
+iden.man.lnk.search.user=//a[contains(@id,'user-form:search-user-link')]
+iden.man.lnk.usertab=//a[contains(@id,'role-temp-form:manage-users')]
+iden.man.lnk.usermain=//a[contains(@id,'user-temp-form1:user-adm-link')]
+iden.man.lnk.roletab=//a[contains(@id,'user-temp-form:role-mgm-link')]
+iden.man.lnk.rolemain=//a[contains(@id, 'role-temp-form1:role-admin-link')]
+iden.man.lnk.usermang.main=//a[contains(@id,'user-temp-form1:assign-role-link')]
+iden.man.lnk.usermang.main2=//a[contains(@id,'user-temp-form1:user-mgm-link')]
+iden.man.lnk.create.user=//a[contains(@id,':user-form:create-user-link')]
+iden.man.chk.role=//input[contains(@name,''assign-roles-form:roles'') and
@value=''{0}'']
+
+# DashboardTestCase
+
+dash.sub.layout.update=//input[contains(@name,'dashboardLayoutForm:j_id12')]
+dash.sub.page.rename=//form[contains(@id,'renameForm')]/input[@type='submit']
+dash.inp.page.rename=//input[contains(@id,'renameForm:newName')]
+dash.link.weather.portlet=link=*WeatherPortlet*
+dash.link.portl2=link=*Who's online portlet*
+dash.link.portl1=link=*Welcome portlet*
+dash.opt.portl2=CurrentUsersPortletWindow
+dash.opt.portl1=JSPPortletWindow
+dash.sel.content.type=//select[contains(@id,'contentTypesForm:instanceId')]
+dash.sub.del.from.center.region=//input[contains(@id,'layoutForm:l_center')]
+dash.sub.down.center.region=//input[contains(@id,'layoutForm:d_center')]
+dash.sub.up.center.region=//input[contains(@id,'layoutForm:u_center')]
+dash.sel.center.region=//select[contains(@id,'layoutForm:selectMany_center')]
+dash.sub.addcenter=//input[contains(@id,'layoutForm:a_center')]
+dash.sub.addleft=//input[contains(@id,'layoutForm:a_left')]
+dash.lnk.configure.dashboard=link=Configure dashboard
+dash.lnk.dashboard=link=Dashboard
+dash.sel.page=//select[contains(@id,'pageNameSelector')]
+dash.inp.pagename=//input[contains(@id,':pageName')]
+dash.sub.createpage=//form[contains(@id,'j_id3')]/input[@type='submit']
+dash.sel.layout=//select[contains(@id,'dashboardLayoutForm:layoutSelector')]
+dash.sel.theme=//select[contains(@id,'dashboardThemeForm:themeSelector')]
+dash.sub.themesel=//form[contains(@id,'dashboardThemeForm')]/input[@type='submit']
+dash.lnk.por.wea.edit=//body/div[2]/div/div/div[2]/div/div/div/div/div/div/table/tbody/tr/td[2]/div/div/div[2]/span/a
+
+# PortletUserCreationTestCase
+
+user.crea.port.submit.create.conf=//input[contains(@id,'confirm-form:user')]
+user.crea.port.submit.create.conf.edit=//input[contains(@id,'//input[contains(@id,'confirm-form:revise')]
+user.crea.port.submit.create.user=//input[contains(@id,'register-form:submit')]
+user.crea.port.submit.create.user.cancel=//input[contains(@id,'register-form:cancel')]
+user.crea.port.input.userpasswdconf=//input[contains(@id,'register-form:passwordCheckv
+user.crea.port.input.userpasswd=//input[contains(@id,'register-form:password')]
+user.crea.port.input.usermail=//input[contains(@id,'register-form:email')]
+user.crea.port.input.username=//input[contains(@id,'register-form:username')]
+user.crea.port.link.create.user=//a[contains(@id,'create-account-form:register')]
+user.crea.port.tab.welcome=//a[contains(@id,'register-temp-form:start-link')]
+
+# WSRPTestCase
+
+test.wsrp.inp.consumer.name=//input[contains(@id,'edit-cons-form:id')]
+test.wsrp.submit.refresh.cancel=//a[contains(@id,'edit-cons-form:list-cons-link')]
+test.wsrp.submit.prod.save=//input[contains(@id,'producer-form:save-producer')]
+test.wsrp.submit.consdel.conf=//a[contains(@id,'confirm-delete-form:destroy-link')]
+test.wsrp.submit.cons.regval=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+test.wsrp.submit.refreshfinal=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+test.wsrp.input.cons.regvalue=//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]
+test.wsrp.submit.refreshsave=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+test.wsrp.input.conswsdl=//input[contains(@id,'edit-cons-form:wsdl')]
+test.wsrp.input.cacheexp=//input[contains(@id,'edit-cons-form:cache')]
+test.wsrp.submit.addprop.init=//a[contains(@id,'producer-form:add-reg-prop')]
+test.wsrp.submit.addprop=//a[contains(@id,'producer-form:add-reg-prop')]
+test.wsrp.input.prophint=//input[contains(@id,'producer-form:reg-properties:0:hint')]
+test.wsrp.input.proplabel=//input[contains(@id,'producer-form:reg-properties:0:label')]
+test.wsrp.input.propname=//input[contains(@id,'producer-form:reg-properties:0:name')]
+test.wsrp.submit.createcons=//input[contains(@id,'createConsumer:createConsumerButton')]
+test.wsrp.input.createcons=//input[contains(@id,'createConsumer:consumerName')]
+test.wsrp.id.link.prodconf=//a[contains(@id,'cons-temp-form:producer-link')]
+test.wsrp.id.link.consconf=//a[contains(@id,'producer-temp-form:consumersTab')]
+test.wsrp.link.consumer.home=//a[contains(@id,'cons-temp-form1:list-cons-link')]
+test.wsrp.link.t.cons.con=//a[contains(@id,''consumer-list-form:consumersList:{0}:configure'')]
+test.wsrp.link.t.cons.ref=//a[contains(@id,''consumer-list-form:consumersList:{0}:refresh'')]
+test.wsrp.link.t.cons.act=//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]
+test.wsrp.link.t.cons.dea=//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]
+test.wsrp.link.t.cons.reg=//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]
+test.wsrp.link.t.cons.der=//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]
+test.wsrp.link.t.cons.del=//a[contains(@id,''consumer-list-form:consumersList:{0}:delete'')]
+test.wsrp.link.wsrp.consumer.table=//table[contains(@id,':consumer-list-form:consumersList')]
+
+# CMSArchiveUploadTestCase
+
+cms.arch.sub.cancel.arch.upload=cancel
+cms.arch.lnk.admin=link=Admin
+cms.arch.lnk.cms=link=CMS
+cms.arch.sub.send.archive=submit
+cms.arch.inp.archive.file=response
+cms.arch.div.archive.status=//div[@id='center']/div/div/table/tbody/tr[2]/td/font
+cms.arch.sel.action=//div[@id='center']/div/div/div[1]/div/select
+
+# CMSDirectoryTestCase
+
+cms.dir.sel.cms.action=//div[@id='center']/div/div/div[1]/div/select
+cms.dir.adr.cms.interface=/portal/auth/portal/admin/CMS
+cms.dir.cms.file.table=//div[@id='center']/div/div/div[3]/table
+
+# CMSFileTestCase
+
+cms.file.tbl.cms.filever=//div[@id='center']/div/div/table
+cms.file.tbl.cms.file=//div[@id='center']/div/div/div[3]/table
+cms.file.tbl.file.pending=//div[@id='center']/div/div/table[2]
+
+# CMSFileUploadTestCase
+
+cms.file.up.cms.file.table=//div[@id='center']/div/div/div[3]/table
+
+# CMSFileWorkflowTestCase
+
+cms.file.work.lab.lang.czech=label=Czech
+cms.file.work.lnk.deny=link=Deny
+cms.file.work.lnk.preview=link=Preview
+cms.file.work.lnk.approve=link=Approve
+cms.file.work.sub.file.create=save
+cms.file.work.sub.file.create.cancel=cancel
+cms.file.work.sel.lang=language
+cms.file.work.inp.title=title
+cms.file.work.inp.desc=description
+cms.file.work.inp.filename=filename
+cms.file.work.lab.create.file=label=Create File
+cms.file.work.lnk.cms=link=CMS
+cms.file.work.lnk.admin=link=Admin
+cms.file.work.select.cms.main=//div[@id='center']/div/div/div[1]/div/select
+cms.file.work.cms.file.table=//div[@id='center']/div/div/div[3]/table
+cms.file.work.cms.t.select=//div[@id=''center'']/div/div/div[3]/table/tbody/tr[{0}]/td[2]/form/select
+cms.file.work.cms.t.submit=//div[@id=''center'']/div/div/div[3]/table/tbody/tr[{0}]/td[2]/form/input
+cms.file.work.cms.wf.table=//div[@id='center']/div/div/table[2]
+cms.file.work.cms.fv.table=//div[@id='center']/div/div/table
+cms.file.work.cms.t.ver=//div[@id=''center'']/div/div/table/tbody/tr[{0}]/td[1]/a
+cms.file.work.wysiwyg.editor.locator=mce_editor_0
+
+# CMSSecureTestCase
+
+cms.sec.lnk.explore=//area[(a)href='/portal/content/default/epp.html']
+cms.sec.lnk.cms.explore=Link=private1.html
+cms.sec.lnk.members=link=Members
+cms.sec.sub.security.set=//input[contains(@name,'submit')]
+cms.sec.sel.secureusers.manage=//select[contains(@name,'secureusers:manage')]
+cms.sec.sel.secureroles.manage=//select[contains(@name,'secureroles:manage')]
+cms.sec.sel.secureusers.write=//select[contains(@name,'secureusers:write')]
+cms.sec.sel.secureroles.write=//select[contains(@name,'secureroles:write')]
+cms.sec.sel.secureusers.read=//select[contains(@name,'secureusers:read')]
+cms.sec.sel.secureroles.read=//select[contains(@name,'secureroles:read')]
+cms.sec.lnk.index.html=link=index.html
+cms.sec.lnk.default=link=default
+cms.sec.lnk.cms=link=CMS
+cms.sec.lnk.admin=link=Admin
+cms.sec.lnk.logout=link=Logout
+cms.sec.sel.cms.action=//div[@id='center']/div/div/div[1]/div/select
+
+# AdminPortalTestCase
+
+portal.admin.sub.layout.add.center=//input[contains(@id,'layoutForm:a_center')]
+portal.admin.inp.window.name=//input[contains(@id,'windowForm:windowName')]
+portal.admin.submit.rename.portal=//input[contains(@id,'renameForm:rename')]
+portal.admin.input.rename.portal=//input[contains(@id,'renameForm:newName')]
+portal.admin.submit.delete.portal.conf=//input[contains(@id,'delete-view:confirm-form:delete')]
+portal.admin.input.submit.pagecreate=//input[contains(@id,'create-page-form:create-page')]
+portal.admin.input.pagename=//input[contains(@id,'create-page-form:pageName')]
+portal.admin.input.portalname=//input[contains(@id,'create-portal-form:name')]
+portal.admin.input.submit.createportal=//input[contains(@id,'create-portal-form:create-portal')]
+portal.admin.tab.portalobj.id=Link=Admin
+portal.admin.link.portals.id=link=*Portal Objects*
+portal.admin.link.portal.home=//a[contains(@id,'obj-temp-form:object-link-0')]
+portal.admin.table.portal.admin=//table[contains(@id,'obj-nav-form:portal-datatable')]
+portal.admin.por.tl.main=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]
+portal.admin.por.tl.security=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]
+portal.admin.por.tl.properties=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]
+portal.admin.por.tl.theme=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]
+portal.admin.por.tl.rename=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]
+portal.admin.por.tl.delete=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]
+portal.admin.por.tl.makedef=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]
+portal.admin.table.portalpage.admin=//table[contains(@id,'obj-nav-form:pages-datatable')]
+portal.admin.pag.tl.main=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]
+portal.admin.pag.tl.layout=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]
+portal.admin.pag.tl.security=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]
+portal.admin.pag.tl.properties=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]
+portal.admin.pag.tl.theme=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]
+portal.admin.pag.tl.rename=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]
+portal.admin.pag.tl.display=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]
+portal.admin.pag.tl.delete=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]
+portal.admin.pag.tl.makedef=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]
+
+portal.admin.lnk.pp.prop.delete=//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]
+portal.admin.sub.pp.propval.update=//input[contains(@id,'common-manage-prop-form:update')]
+portal.admin.inp.pp.prop.val=//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]
+portal.admin.sub.ppa.form.update=//input[contains(@id,'common-edit-page-error-form:update')]
+portal.admin.inp.ppa.res.select=//input[contains(@id,'common-edit-page-error-form:page-res-select')]
+portal.admin.sel.ppa.nf.select=//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]
+portal.admin.sel.ppa.internal.select=//select[contains(@id,'common-edit-page-error-form:page-internal-select')]
+portal.admin.sel.ppa.error.select=//select[contains(@id,'common-edit-page-error-form:page-error-select')]
+portal.admin.sel.ppa.control.select=//select[contains(@id,'common-edit-page-error-form:page-control-select')]
+portal.admin.sel.ppa.access.select=//select[contains(@id,'common-edit-page-error-form:page-access-select')]
+portal.admin.chk.ppa.res.check=//input[contains(@id,'common-edit-page-error-form:page-res-check')]
+portal.admin.chk.ppa.nf.check=//input[contains(@id,'common-edit-page-error-form:page-not-found-check')]
+portal.admin.chk.ppa.internal.check=//input[contains(@id,'common-edit-page-error-form:page-internal-check')]
+portal.admin.chk.ppa.error.check=//input[contains(@id,'common-edit-page-error-form:page-error-check')]
+portal.admin.chk.ppa.control.check=//input[contains(@id,'common-edit-page-error-form:page-control-check')]
+portal.admin.chk.ppa.access.check=//input[contains(@id,'common-edit-page-error-form:page-access-check')]
+portal.admin.sub.pp.error.form.update=//input[contains(@id,'common-edit-portal-error-form:update')]
+portal.admin.inp.pp.res.input=//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]
+portal.admin.sel.pp.nf.select=//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]
+portal.admin.sel.pp.internal.select=//select[contains(@id,'common-edit-portal-error-form:portal-internal-select')]
+portal.admin.sel.pp.error.select=//select[contains(@id,'common-edit-portal-error-form:portal-error-select')]
+portal.admin.sel.pp.unavail.select=//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]
+portal.admin.sel.pp.access.select=//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]
+portal.admin.chk.pp.res.check=//input[contains(@id,'common-edit-portal-error-form:portal-res-check')]
+portal.admin.chk.pp.nf.check=//input[contains(@id,'common-edit-portal-error-form:portal-not-found-check')]
+portal.admin.chk.pp.internal.check=//input[contains(@id,'common-edit-portal-error-form:portal-internal-check')]
+portal.admin.chk.pp.error.check=//input[contains(@id,'common-edit-portal-error-form:portal-error-check')]
+portal.admin.chk.pp.access.check=//input[contains(@id,'common-edit-portal-error-form:portal-access-check')]
+portal.admin.chk.pp.unavail.check=//input[contains(@id,'common-edit-portal-error-form:portal-unavail-check')]
+portal.admin.sub.pp.propadd=//input[contains(@id,'common-edit-prop-form:add-property')]
+portal.admin.inp.pp.propname=//input[contains(@id,'common-edit-prop-form:property')]
+portal.admin.sub.pp.listener=//input[contains(@id,'edit-prop-form:update')]
+portal.admin.sel.pp.listener=//select[contains(@id,'edit-prop-form:listener')]
+portal.admin.tbl.pp.props=//table[contains(@id,'common-manage-prop-form:prop-data-table')]
+
+# DashboardsTestCase
+
+portal.dash.t.dh.sub.update=//form[contains(@id,'common-edit-theme-form')]/input[@type='submit']
+portal.dash.t.dh.sel.renderset=//select[contains(@id,'common-edit-theme-form:renderSet')]
+portal.dash.t.dh.sel.theme=//select[contains(@id,'common-edit-theme-form:theme')]
+portal.dash.t.dh.sel.layout=//select[contains(@id,'common-edit-theme-form:layout')]
+portal.dash.t.pa.sub.update=//input[contains(@id,'common-edit-page-error-form:update')]
+portal.dash.t.po.sub.update=//input[contains(@id,'common-edit-portal-error-form:update')]
+portal.dash.t.pa.inp.pageadd=//input[contains(@id,'common-edit-page-error-form:page-res-select')]
+portal.dash.t.po.inp.pageadd=//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]
+portal.dash.t.pa.sel.pnf=//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]
+portal.dash.t.pa.sel.intern=//select[contains(@id,'common-edit-page-error-form:page-internal-select')]
+portal.dash.t.pa.sel.error=//select[contains(@id,'common-edit-page-error-form:page-error-select')]
+portal.dash.t.pa.sel.control=//select[contains(@id,'common-edit-page-error-form:page-control-select')]
+portal.dash.t.pa.sel.access=//select[contains(@id,'common-edit-page-error-form:page-access-select')]
+portal.dash.t.po.sel.pnf=//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]
+portal.dash.t.po.sel.unavail=//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]
+portal.dash.t.po.sel.access=//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]
+portal.dash.submit.update.value=//input[contains(@id,'common-manage-prop-form:update')]
+portal.dash.table.props=//table[contains(@id,'common-manage-prop-form:prop-data-table')]
+portal.dash.t.props.input.value=//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]
+portal.dash.t.props.link.del=//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]
+portal.dash.table.pa.err=//form[@id='common-edit-page-error-form']/table
+portal.dash.table.po.err=//form[@id='common-edit-portal-error-form']/table
+portal.dash.table.dh.thm=//form[@id='common-edit-theme-form']/table
+portal.dash.input.prop.name=//input[contains(@id,'common-edit-prop-form:property')]
+portal.dash.submit.add.prop=//input[contains(@id,'common-edit-prop-form:add-property')]
+portal.dash.link.admin=link=Admin
+portal.dash.link.tab.dash=//a[contains(@id,'admin-subtab-form:dashboard-link')]
+
+# PortletDefinitionsTestCase
+
+portal.port.def.t.link.pref=//a[contains(@id,''def-list:portlet-pref-{0}'')]
+portal.port.def.submit.create.inst=//input[contains(@name,'add_instance_form:j_id19')]
+portal.port.def.input.instance.name=//input[contains(@id,'add_instance_form:instanceId')]
+portal.port.def.t.link.create=//a[contains(@id,''def-list:create-instance-{0}'')]
+portal.port.def.submit.provider.view=//input[contains(@id,'definition-form:view-portlets')]
+portal.port.def.select.provider=//select[contains(@id,'definition-form:menu')]
+portal.port.def.table.portlet=//form[contains(@id,'def-list')]/table
+portal.port.def.link.name.admin.port=//a[contains(@id,'common-show-portlet-detail-form:field1:select')]
+portal.port.def.link.admin.port=//a[contains(@id,'def-list:portlet-def-0')]
+portal.port.def.link.admin=link=Admin
+portal.port.def.link.tab.pd=//a[contains(@id,'admin-subtab-form:portlet-def-link')]
+portal.port.def.link.pd.main=//a[contains(@id,'man-form:def-link')]
+
+# PortletInstancesTestCase
+
+portal.port.ins.tab.portlet.instances=//table[contains(@id,'instancesTable2')]
+portal.port.ins.ul.paginator=//ul[@class='pagination property-container']
+portal.port.ins.submit.security.update=//input[contains(@id,'common-edit-security-form:update')]
+portal.port.ins.submit.security.cancel=//input[contains(@id,'common-edit-security-form:cancel')]
+portal.port.ins.link.20.page=link=20
+portal.port.ins.link.pref.welcomeport=//a[contains(@id,'security-JSPPortletInstance')]
+portal.port.ins.table.pref.key=//form[contains(@id,'common-edit-pref-form')]/table
+portal.port.ins.submit.pref.delete=//input[contains(@id,'common-edit-exisiting-form:row_0')]
+portal.port.ins.link.pref.guestnum=//a[contains(@id,'common-edit-pref-form:pref-link-0')]
+portal.port.ins.input.pref.newval=//input[contains(@id,'common-append-form:new_value')]
+portal.port.ins.submit.pref.update=//input[contains(@id,'common-append-form:append-button')]
+portal.port.ins.submit.pref.save=//input[contains(@id,':save')]
+portal.port.ins.input.pref.update=//input[contains(@id,'common-edit-exisiting-form:update')]
+portal.port.ins.input.pref.append=//input[contains(@id,'common-edit-exisiting-form:pref-input-0')]
+portal.port.ins.submit.pref.cancel=//input[contains(@id,':cancel')]
+portal.port.ins.link.curuser.preferences=//a[contains(@id,'instances-form:preference-CurrentUsersPortletInstance')]
+portal.port.ins.link.del.exceptport=//a[contains(@id,'instances-form:delete-GoogleMapPortletInstance')]
+portal.port.ins.submit.pi.delete.conf=//input[contains(@id,'confirm-delete-form1:delete')]
+portal.port.ins.submit.pi.delete.canc=//input[contains(@id,'confirm-delete-form1:cancel')]
+portal.port.ins.t.link.deletename=//a[contains(@id,''instance-display-form:locale-datatable:{0}:delete-link'')]
+portal.port.ins.t.link.modifyname=//a[contains(@id,''instance-display-form:locale-datatable:{0}:edit-link'')]
+portal.port.ins.link.countport=//a[contains(@id,'instances-form:CurrentUsersPortletInstance')]
+portal.port.ins.name.countport=CurrentUsersPortletInstance
+portal.port.ins.submit.modify.name=//input[contains(@id,'add-display-name-form:addDisplay')]
+portal.port.ins.input.name=//input[contains(@id,'add-display-name-form:newName')]
+portal.port.ins.select.language=//select[contains(@id,'add-display-name-form:locales')]
+portal.port.ins.link.admin=link=Admin
+portal.port.ins.link.tab.pi=//a[contains(@id,'admin-subtab-form:portlet-instance-link')]
+portal.port.ins.link.pi.main=//a[contains(@id,'instance-form1:instance-link')]
+portal.port.ins.table.dispnames=//table[contains(@id,'instance-display-form:locale-datatable')]
+portal.port.ins.lnk.sec.button=//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''Security'')]
+portal.port.ins.lnk.pref.button=//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionPreferences'')]
+portal.port.ins.lnk.del.button=//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionDeleteInstance'')]
+portal.port.ins.lnk.instance.button=//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td[1]/a[1]
+
+# EndToEndBeaPortlet
+
+e2e.wsrp.adr.home=portal/auth/portal/default
+e2e.wsrp.inp.consumer.name=//input[contains(@id,'edit-cons-form:id')]
+e2e.wsrp.submit.refresh.cancel=//a[contains(@id,'edit-cons-form:list-cons-link')]
+e2e.wsrp.submit.prod.save=//input[contains(@id,'producer-form:save-producer')]
+e2e.wsrp.submit.consdel.conf=//a[contains(@id,'confirm-delete-form:destroy-link')]
+e2e.wsrp.submit.cons.regval=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+e2e.wsrp.submit.refreshfinal=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+e2e.wsrp.input.cons.regvalue=//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]
+e2e.wsrp.submit.refreshsave=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+e2e.wsrp.input.conswsdl=//input[contains(@id,'edit-cons-form:wsdl')]
+e2e.wsrp.input.cacheexp=//input[contains(@id,'edit-cons-form:cache')]
+e2e.wsrp.submit.addprop.init=//a[contains(@id,'producer-form:add-reg-prop')]
+e2e.wsrp.submit.addprop=//a[contains(@id,'producer-form:add-reg-prop')]
+e2e.wsrp.input.prophint=//input[contains(@id,'producer-form:reg-properties:0:hint')]
+e2e.wsrp.input.proplabel=//input[contains(@id,'producer-form:reg-properties:0:label')]
+e2e.wsrp.input.propname=//input[contains(@id,'producer-form:reg-properties:0:name')]
+e2e.wsrp.submit.createcons=//input[contains(@id,'createConsumer:createConsumerButton')]
+e2e.wsrp.input.createcons=//input[contains(@id,'createConsumer:consumerName')]
+e2e.wsrp.id.link.prodconf=//a[contains(@id,'cons-temp-form:producer-link')]
+e2e.wsrp.id.link.consconf=//a[contains(@id,'producer-temp-form:consumersTab')]
+e2e.wsrp.link.consumer.home=//a[contains(@id,'cons-temp-form1:list-cons-link')]
+e2e.wsrp.link.t.cons.con=//a[contains(@id,''consumer-list-form:consumersList:{0}:configure'')]
+e2e.wsrp.link.t.cons.ref=//a[contains(@id,''consumer-list-form:consumersList:{0}:refresh'')]
+e2e.wsrp.link.t.cons.act=//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]
+e2e.wsrp.link.t.cons.dea=//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]
+e2e.wsrp.link.t.cons.reg=//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]
+e2e.wsrp.link.t.cons.der=//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]
+e2e.wsrp.link.t.cons.del=//a[contains(@id,''consumer-list-form:consumersList:{0}:delete'')]
+
+# EndtoEndPortalAdminTestCase
+
+portal.e2e.sel.portlet.type=//select[contains(@id,'windowForm:instanceId')]
+portal.e2e.sub.layout.add.center=//input[contains(@id,'layoutForm:a_center')]
+portal.e2e.inp.window.name=//input[contains(@id,'windowForm:windowName')]
+portal.e2e.sub.rename.portal=//input[contains(@id,'renameForm:rename')]
+portal.e2e.inp.rename.portal=//input[contains(@id,'renameForm:newName')]
+portal.e2e.sub.delete.portal.conf=//input[contains(@id,'delete-view:confirm-form:delete')]
+portal.e2e.inp.submit.pagecreate=//input[contains(@id,'create-page-form:create-page')]
+portal.e2e.inp.pagename=//input[contains(@id,'create-page-form:pageName')]
+portal.e2e.inp.portalname=//input[contains(@id,'create-portal-form:name')]
+portal.e2e.inp.submit.createportal=//input[contains(@id,'create-portal-form:create-portal')]
+portal.e2e.tab.portalobj.id=Link=Admin
+portal.e2e.lnk.portals.id=link=*Portal Objects*
+portal.e2e.lnk.portal.home=//a[contains(@id,'obj-temp-form:object-link-0')]
+portal.e2e.tbl.portal.admin=//table[contains(@id,'obj-nav-form:portal-datatable')]
+portal.e2e.por.tl.main=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]
+portal.e2e.por.tl.security=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]
+portal.e2e.por.tl.properties=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]
+
+portal.e2e.por.tl.theme=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]
+portal.e2e.por.tl.rename=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]
+portal.e2e.por.tl.delete=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]
+portal.e2e.por.tl.makedef=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]
+portal.e2e.tbl.portalpage.admin=//table[contains(@id,'obj-nav-form:pages-datatable')]
+portal.e2e.pag.tl.main=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]
+portal.e2e.pag.tl.layout=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]
+portal.e2e.pag.tl.security=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]
+portal.e2e.pag.tl.properties=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]
+portal.e2e.pag.tl.theme=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]
+portal.e2e.pag.tl.rename=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]
+portal.e2e.pag.tl.display=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]
+portal.e2e.pag.tl.delete=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]
+portal.e2e.pag.tl.makedef=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]
+portal.e2e.pag.tl.coord=//a[contains(@id,''pages-datatable:{0}:edit-coord'')]
+portal.e2e.div.por.cont=content-container
+
+# PortalSamplesTestCase
+
+samples.ses.lnk.invalidate=link=invalidate
+samples.res.div.rtext=repeat-text
+samples.res.div.ptext=product-text
+samples.res.lnk.p3=link=Product3
+samples.res.lnk.p2=link=Product2
+samples.res.lnk.p1=link=Product1
+samples.res.inp=repeat
+samples.res.lnk=link=serveResource Demo
+samples.win.div.con=//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div
+samples.win.lnk=link=Window id test
+samples.ses.tab.pscope=//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table
+samples.ses.tab.ascope=//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table[2]
+samples.ses.sub.ascope=application
+samples.ses.sub.pscope=portlet
+samples.ses.inp.val=value
+samples.ses.inp.nam=name
+samples.ses.lnk=link=Session test
+samples.pub.1.lnk.foo.rem=link=Remove
+samples.pub.3.lnk.bar.rem=//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a
+samples.pub.3.lnk.juu.rem=//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/a
+samples.pub.sub.2=//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td/input
+samples.pub.sub.1=//input[@value='Update']
+samples.pub.div.3.bar=//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/input
+samples.pub.div.3.juu=//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input
+samples.pub.div.2.juu=juu
+samples.pub.div.2.foo=//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input
+samples.pub.div.1.bar=bar
+samples.pub.div.1.foo=foo
+samples.pub.lnk=link=Public parameters test
+samples.pevt.div.p3.max=//div[@id='regionB']/div[3]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a
+samples.pevt.div.p2.max=//div[@id='regionB']/div[2]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a
+samples.pevt.div.l3.max=//div[@id='regionA']/div[3]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a
+samples.pevt.div.l2.max=//div[@id='regionA']/div[2]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a
+samples.pevt.div.p3=//div[@id='regionB']/div[3]/table/tbody/tr[2]/td[2]/div/
+samples.pevt.div.p2=//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/
+samples.pevt.div.p1=//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/
+samples.pevt.div.l3=//div[@id='regionA']/div[3]/table/tbody/tr[2]/td[2]/div/
+samples.pevt.div.l2=//div[@id='regionA']/div[2]/table/tbody/tr[2]/td[2]/div/
+samples.pevt.div.l1=//div[@id='regionA']/div[1]/table/tbody/tr[2]/td[2]/div/
+samples.pevt.lnk=link=Page event test
+samples.mod.div.con=//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div
+samples.mod.lnk=link=Mode test
+samples.mpor.div.con=content-container
+samples.mpor.lnk=link=Missing portlet
+samples.mins.div.con=content-container
+samples.mins.lnk=link=Missing instance
+samples.js.lnk.submit=link=submit
+samples.js.opt.3=//form[contains(@id,'_the_form')]/select/option[3]
+samples.js.opt.2=//form[contains(@id,'_the_form')]/select/option[2]
+samples.js.opt.1=//form[contains(@id,'_the_form')]/select/option[1]
+samples.js.lab.c=label=C
+samples.js.lab.b=label=B
+samples.js.lab.a=label=A
+samples.js.sel.letter=//div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/form/select
+samples.js.lnk=link=Javascript test
+samples.head.inp.content=Introducing-HeaderContentInput
+samples.head.div.content=Introducing-HeaderContent
+samples.head.lnk=link=Header test
+samples.fs.lnk=link=File system content
+samples.exc.lnk.portlet=link=render PortletException
+samples.exc.lnk=link=Exception test
+samples.evt.sub.color=//input[@type='submit']
+samples.evt.div.black=//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'black')]
+samples.evt.div.red=//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'red')]
+samples.evt.div.blue=//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'blue')]
+samples.evt.sel.lab.black=label=black
+samples.evt.sel.lab.red=label=red
+samples.evt.sel.lab.blue=label=blue
+samples.evt.sel.col=color
+samples.evt.lnk=link=Event test
+samples.enc.lnk=link=Encoding test
+samples.enc.inp.ren=text
+samples.enc.sub.act=//input[@value='Submit to action phase']
+samples.enc.inp.act=//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[1]/form[2]/input[1]
+samples.enc.textarea2=//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[5]/textarea
+samples.enc.textarea1=//textarea[@name='text']
+samples.char.all.sub.check=//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/div[8]/form/input[3]
+samples.char.inp.text.sub.check=//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[8]/form/input[3]
+samples.char.lnk.textarea.check=//input[@value='check']
+samples.char.inp.text=//input[@name='text']
+samples.char.textarea=text
+samples.char.sub.change=//input[@value='change']
+samples.char.inp.to=to
+samples.char.inp.from=from
+samples.char.lnk=link=Charset test
+samples.cache.lnk=link=Cache test
+samples.cache.lnk.2ren=//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[5]/a
+samples.cache.lnk.2act=//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[4]/a
+samples.cache.lnk.1ren=link=render
+samples.cache.lnk.1act=link=action
+samples.cache.2render=//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[2]/div
+samples.cache.1render=//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/div[2]/div
+
+# PortalAjaxSamplesTestCase
+
+samples.ajax.ses.lnk.invalidate=link=invalidate
+samples.ajax.res.div.rtext=repeat-text
+samples.ajax.res.div.ptext=product-text
+samples.ajax.res.lnk.p3=link=Product3
+samples.ajax.res.lnk.p2=link=Product2
+samples.ajax.res.lnk.p1=link=Product1
+samples.ajax.res.inp=repeat
+samples.ajax.res.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[17]/a
+samples.ajax.win.div.con=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div
+samples.ajax.win.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[16]/a
+samples.ajax.ses.tab.pscope=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/table
+samples.ajax.ses.tab.ascope=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/table[2]
+samples.ajax.ses.sub.ascope=application
+samples.ajax.ses.sub.pscope=portlet
+samples.ajax.ses.inp.val=value
+samples.ajax.ses.inp.nam=name
+samples.ajax.ses.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[14]/a
+samples.ajax.pub.1.lnk.foo.rem=//html/body/div[2]/div/div/div[2]/div/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr/td[2]/a
+samples.ajax.pub.3.lnk.bar.rem=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr[2]/td[2]/a
+samples.ajax.pub.3.lnk.juu.rem=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr/td[2]/a
+samples.ajax.pub.sub.2=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr[3]/td/input
+samples.ajax.pub.sub.1=//input[@value='Update']
+samples.ajax.pub.div.3.bar=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr[2]/td[2]/input
+samples.ajax.pub.div.3.juu=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr/td[2]/input
+samples.ajax.pub.div.2.juu=juu
+samples.ajax.pub.div.2.foo=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr/td[2]/input
+samples.ajax.pub.div.1.bar=bar
+samples.ajax.pub.div.1.foo=foo
+samples.ajax.pub.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[12]/a
+samples.ajax.pevt.div.p3.max=//html/body/div[2]/div/div/div[2]/div[2]/div/div[3]/div/div/table/tbody/tr/td[2]/div/div[2]/span/a
+samples.ajax.pevt.div.p2.max=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr/td[2]/div/div[2]/span/a
+samples.ajax.pevt.div.l3.max=//html/body/div[2]/div/div/div[2]/div/div/div[3]/div/div/table/tbody/tr/td[2]/div/div[2]/span/a
+samples.ajax.pevt.div.l2.max=//html/body/div[2]/div/div/div[2]/div/div/div[2]/div/div/table/tbody/tr/td[2]/div/div[2]/span/a
+samples.ajax.pevt.div.p3=//html/body/div[2]/div/div/div[2]/div[2]/div/div[3]/div/div/table/tbody/tr[2]/td[2]/div/div
+samples.ajax.pevt.div.p2=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div
+samples.ajax.pevt.div.p1=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div
+samples.ajax.pevt.div.l3=//html/body/div[2]/div/div/div[2]/div/div/div[3]/div/div/table/tbody/tr[2]/td[2]/div/div
+samples.ajax.pevt.div.l2=//html/body/div[2]/div/div/div[2]/div/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div
+samples.ajax.pevt.div.l1=//html/body/div[2]/div/div/div[2]/div/div/div/div/div/table/tbody/tr[2]/td[2]/div/div
+samples.ajax.pevt.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[11]/a
+samples.ajax.mod.div.con=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div
+samples.ajax.mod.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[10]/a
+samples.ajax.mpor.div.con=content-container
+samples.ajax.mpor.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[9]/a
+samples.ajax.mins.div.con=content-container
+samples.ajax.mins.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[8]/a
+samples.ajax.js.lnk.submit=link=submit
+samples.ajax.js.opt.3=//form[contains(@id,'_the_form')]/select/option[3]
+samples.ajax.js.opt.2=//form[contains(@id,'_the_form')]/select/option[2]
+samples.ajax.js.opt.1=//form[contains(@id,'_the_form')]/select/option[1]
+samples.ajax.js.lab.c=label=C
+samples.ajax.js.lab.b=label=B
+samples.ajax.js.lab.a=label=A
+samples.ajax.js.sel.letter=//body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/form/select
+samples.ajax.js.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[7]/a
+samples.ajax.head.inp.content=Introducing-HeaderContentInput
+samples.ajax.head.div.content=Introducing-HeaderContent
+samples.ajax.head.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[6]/a
+samples.ajax.exc.lnk.portlet=link=render PortletException
+samples.ajax.exc.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[5]/a
+samples.ajax.evt.sub.color=//input[@type='submit']
+samples.ajax.evt.div.black=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/div[contains(@style,'black')]
+samples.ajax.evt.div.red=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/div[contains(@style,'red')]
+samples.ajax.evt.div.blue=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/div[contains(@style,'blue')]
+samples.ajax.evt.sel.lab.black=label=black
+samples.ajax.evt.sel.lab.red=label=red
+samples.ajax.evt.sel.lab.blue=label=blue
+samples.ajax.evt.sel.col=color
+samples.ajax.evt.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[4]/a
+samples.ajax.enc.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[3]/a
+samples.ajax.enc.inp.ren=text
+samples.ajax.enc.sub.act=//input[@value='Submit to action phase']
+samples.ajax.enc.inp.act=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div/form[2]/input
+samples.ajax.enc.textarea2=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div[5]/textarea
+samples.ajax.enc.textarea1=//textarea[@name='text']
+samples.ajax.char.all.sub.check=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div[8]/form/input[3]
+samples.ajax.char.inp.text.sub.check=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div[6]/form/input[4]
+samples.ajax.char.lnk.textarea.check=//input[@value='check']
+samples.ajax.char.inp.text=//input[@name='text']
+samples.ajax.char.textarea=text
+samples.ajax.char.sub.change=//input[@value='change']
+samples.ajax.char.inp.to=to
+samples.ajax.char.inp.from=from
+samples.ajax.char.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[2]/a
+samples.ajax.cache.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[1]/a
+samples.ajax.cache.lnk.2ren=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/div[5]/a
+samples.ajax.cache.lnk.2act=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/div[4]/a
+samples.ajax.cache.lnk.1ren=link=render
+samples.ajax.cache.lnk.1act=link=action
+samples.ajax.cache.div.2.render=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/div[2]/div
+samples.ajax.cache.div.1.render=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div[2]/div
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -14,41 +14,74 @@
@Test(groups = { "admin_portal" }, enabled = true, description = "Partal
administrating.")
public class AdminPortalTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUB_LAYOUT_ADD_CENTER =
"//input[contains(@id,'layoutForm:a_center')]";
- private static final String INP_WINDOW_NAME =
"//input[contains(@id,'windowForm:windowName')]";
- private static final String SUBMIT_RENAME_PORTAL =
"//input[contains(@id,'renameForm:rename')]";
- private static final String INPUT_RENAME_PORTAL =
"//input[contains(@id,'renameForm:newName')]";
- private static final String SUBMIT_DELETE_PORTAL_CONF =
"//input[contains(@id,'delete-view:confirm-form:delete')]";
- private static final String INPUT_SUBMIT_PAGECREATE =
"//input[contains(@id,'create-page-form:create-page')]";
- private static final String INPUT_PAGENAME =
"//input[contains(@id,'create-page-form:pageName')]";
- private static final String INPUT_PORTALNAME =
"//input[contains(@id,'create-portal-form:name')]";
- private static final String INPUT_SUBMIT_CREATEPORTAL =
"//input[contains(@id,'create-portal-form:create-portal')]";
+ public final String casePfx = "portal.admin.";
- private final String TAB_PORTALOBJ_ID = "Link=Admin";
+ private final String LNK_PP_PROP_DELETE =
getProp(casePfx+"lnk.pp.prop.delete","//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]");
+ private final String SUB_PP_PROPVAL_UPDATE =
getProp(casePfx+"sub.pp.propval.update","//input[contains(@id,'common-manage-prop-form:update')]");
+ private final String INP_PP_PROP_VAL =
getProp(casePfx+"inp.pp.prop.val","//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]");
+ private final String SUB_PPA_FORM_UPDATE =
getProp(casePfx+"sub.ppa.form.update","//input[contains(@id,'common-edit-page-error-form:update')]");
+ private final String INP_PPA_RES_SELECT =
getProp(casePfx+"inp.ppa.res.select","//input[contains(@id,'common-edit-page-error-form:page-res-select')]");
+ private final String SEL_PPA_NF_SELECT =
getProp(casePfx+"sel.ppa.nf.select","//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]");
+ private final String SEL_PPA_INTERNAL_SELECT =
getProp(casePfx+"sel.ppa.internal.select","//select[contains(@id,'common-edit-page-error-form:page-internal-select')]");
+ private final String SEL_PPA_ERROR_SELECT =
getProp(casePfx+"sel.ppa.error.select","//select[contains(@id,'common-edit-page-error-form:page-error-select')]");
+ private final String SEL_PPA_CONTROL_SELECT =
getProp(casePfx+"sel.ppa.control.select","//select[contains(@id,'common-edit-page-error-form:page-control-select')]");
+ private final String SEL_PPA_ACCESS_SELECT =
getProp(casePfx+"sel.ppa.access.select","//select[contains(@id,'common-edit-page-error-form:page-access-select')]");
+ private final String CHK_PPA_RES_CHECK =
getProp(casePfx+"chk.ppa.res.check","//input[contains(@id,'common-edit-page-error-form:page-res-check')]");
+ private final String CHK_PPA_NF_CHECK =
getProp(casePfx+"chk.ppa.nf.check","//input[contains(@id,'common-edit-page-error-form:page-not-found-check')]");
+ private final String CHK_PPA_INTERNAL_CHECK =
getProp(casePfx+"chk.ppa.internal.check","//input[contains(@id,'common-edit-page-error-form:page-internal-check')]");
+ private final String CHK_PPA_ERROR_CHECK =
getProp(casePfx+"chk.ppa.error.check","//input[contains(@id,'common-edit-page-error-form:page-error-check')]");
+ private final String CHK_PPA_CONTROL_CHECK =
getProp(casePfx+"chk.ppa.control.check","//input[contains(@id,'common-edit-page-error-form:page-control-check')]");
+ private final String CHK_PPA_ACCESS_CHECK =
getProp(casePfx+"chk.ppa.access.check","//input[contains(@id,'common-edit-page-error-form:page-access-check')]");
+ private final String SUB_PP_ERROR_FORM_UPDATE =
getProp(casePfx+"sub.pp.error.form.update","//input[contains(@id,'common-edit-portal-error-form:update')]");
+ private final String INP_PP_RES_INPUT =
getProp(casePfx+"inp.pp.res.input","//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]");
+ private final String SEL_PP_NF_SELECT =
getProp(casePfx+"sel.pp.nf.select","//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]");
+ private final String SEL_PP_INTERNAL_SELECT =
getProp(casePfx+"sel.pp.internal.select","//select[contains(@id,'common-edit-portal-error-form:portal-internal-select')]");
+ private final String SEL_PP_ERROR_SELECT =
getProp(casePfx+"sel.pp.error.select","//select[contains(@id,'common-edit-portal-error-form:portal-error-select')]");
+ private final String SEL_PP_UNAVAIL_SELECT =
getProp(casePfx+"sel.pp.unavail.select","//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]");
+ private final String SEL_PP_ACCESS_SELECT =
getProp(casePfx+"sel.pp.access.select","//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]");
+ private final String CHK_PP_RES_CHECK =
getProp(casePfx+"chk.pp.res.check","//input[contains(@id,'common-edit-portal-error-form:portal-res-check')]");
+ private final String CHK_PP_NF_CHECK =
getProp(casePfx+"chk.pp.nf.check","//input[contains(@id,'common-edit-portal-error-form:portal-not-found-check')]");
+ private final String CHK_PP_INTERNAL_CHECK =
getProp(casePfx+"chk.pp.internal.check","//input[contains(@id,'common-edit-portal-error-form:portal-internal-check')]");
+ private final String CHK_PP_ERROR_CHECK =
getProp(casePfx+"chk.pp.error.check","//input[contains(@id,'common-edit-portal-error-form:portal-error-check')]");
+ private final String CHK_PP_ACCESS_CHECK =
getProp(casePfx+"chk.pp.access.check","//input[contains(@id,'common-edit-portal-error-form:portal-access-check')]");
+ private final String CHK_PP_UNAVAIL_CHECK =
getProp(casePfx+"chk.pp.unavail.check","//input[contains(@id,'common-edit-portal-error-form:portal-unavail-check')]");
+ private final String SUB_PP_PROPADD =
getProp(casePfx+"sub.pp.propadd","//input[contains(@id,'common-edit-prop-form:add-property')]");
+ private final String INP_PP_PROPNAME =
getProp(casePfx+"inp.pp.propname","//input[contains(@id,'common-edit-prop-form:property')]");
+ private final String SUB_PP_LISTENER =
getProp(casePfx+"sub.pp.listener","//input[contains(@id,'edit-prop-form:update')]");
+ private final String SEL_PP_LISTENER =
getProp(casePfx+"sel.pp.listener","//select[contains(@id,'edit-prop-form:listener')]");
+ private final String TBL_PP_PROPS =
getProp(casePfx+"tbl.pp.props","//table[contains(@id,'common-manage-prop-form:prop-data-table')]");
- private final String LINK_PORTALS_ID = "link=*Portal Objects*";
- private final String LINK_PORTAL_HOME =
"//a[contains(@id,'obj-temp-form:object-link-0')]";
-
- private final String TABLE_PORTAL_ADMIN =
"//table[contains(@id,'obj-nav-form:portal-datatable')]";
- private final String POR_TL_MAIN =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]";
- private final String POR_TL_SECURITY =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]";
- private final String POR_TL_PROPERTIES =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]";
- private final String POR_TL_THEME =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]";
- private final String POR_TL_RENAME =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]";
- private final String POR_TL_DELETE =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]";
- private final String POR_TL_MAKEDEF =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]";
+ private final String SUB_LAYOUT_ADD_CENTER = getProp(casePfx +
"sub.layout.add.center",
"//input[contains(@id,'layoutForm:a_center')]");
+ private final String INP_WINDOW_NAME = getProp(casePfx + "inp.window.name",
"//input[contains(@id,'windowForm:windowName')]");
+ private final String SUBMIT_RENAME_PORTAL = getProp(casePfx +
"submit.rename.portal",
"//input[contains(@id,'renameForm:rename')]");
+ private final String INPUT_RENAME_PORTAL = getProp(casePfx +
"input.rename.portal",
"//input[contains(@id,'renameForm:newName')]");
+ private final String SUBMIT_DELETE_PORTAL_CONF = getProp(casePfx +
"submit.delete.portal.conf",
"//input[contains(@id,'delete-view:confirm-form:delete')]");
+ private final String INPUT_SUBMIT_PAGECREATE = getProp(casePfx +
"input.submit.pagecreate",
"//input[contains(@id,'create-page-form:create-page')]");
+ private final String INPUT_PAGENAME = getProp(casePfx + "input.pagename",
"//input[contains(@id,'create-page-form:pageName')]");
+ private final String INPUT_PORTALNAME = getProp(casePfx + "input.portalname",
"//input[contains(@id,'create-portal-form:name')]");
+ private final String INPUT_SUBMIT_CREATEPORTAL = getProp(casePfx +
"input.submit.createportal",
"//input[contains(@id,'create-portal-form:create-portal')]");
+ private final String TAB_PORTALOBJ_ID = getProp(casePfx + "tab.portalobj.id",
"Link=Admin");
+ private final String LINK_PORTALS_ID = getProp(casePfx + "link.portals.id",
"link=*Portal Objects*");
+ private final String LINK_PORTAL_HOME = getProp(casePfx + "link.portal.home",
"//a[contains(@id,'obj-temp-form:object-link-0')]");
+ private final String TABLE_PORTAL_ADMIN = getProp(casePfx +
"table.portal.admin",
"//table[contains(@id,'obj-nav-form:portal-datatable')]");
+ private final String POR_TL_MAIN = getProp(casePfx + "por.tl.main",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]");
+ private final String POR_TL_SECURITY = getProp(casePfx + "por.tl.security",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]");
+ private final String POR_TL_PROPERTIES = getProp(casePfx +
"por.tl.properties",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]");
+ private final String POR_TL_THEME = getProp(casePfx + "por.tl.theme",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]");
+ private final String POR_TL_RENAME = getProp(casePfx + "por.tl.rename",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]");
+ private final String POR_TL_DELETE = getProp(casePfx + "por.tl.delete",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]");
+ private final String POR_TL_MAKEDEF = getProp(casePfx + "por.tl.makedef",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]");
+ private final String TABLE_PORTALPAGE_ADMIN = getProp(casePfx +
"table.portalpage.admin",
"//table[contains(@id,'obj-nav-form:pages-datatable')]");
+ private final String PAG_TL_MAIN = getProp(casePfx + "pag.tl.main",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]");
+ private final String PAG_TL_LAYOUT = getProp(casePfx + "pag.tl.layout",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]");
+ private final String PAG_TL_SECURITY = getProp(casePfx + "pag.tl.security",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]");
+ private final String PAG_TL_PROPERTIES = getProp(casePfx +
"pag.tl.properties",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]");
+ private final String PAG_TL_THEME = getProp(casePfx + "pag.tl.theme",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]");
+ private final String PAG_TL_RENAME = getProp(casePfx + "pag.tl.rename",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]");
+ private final String PAG_TL_DISPLAY = getProp(casePfx + "pag.tl.display",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]");
+ private final String PAG_TL_DELETE = getProp(casePfx + "pag.tl.delete",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]");
+ private final String PAG_TL_MAKEDEF = getProp(casePfx + "pag.tl.makedef",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]");
- private final String TABLE_PORTALPAGE_ADMIN =
"//table[contains(@id,'obj-nav-form:pages-datatable')]";
- private final String PAG_TL_MAIN =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]";
- private final String PAG_TL_LAYOUT =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]";
- private final String PAG_TL_SECURITY =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]";
- private final String PAG_TL_PROPERTIES =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]";
- private final String PAG_TL_THEME =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]";
- private final String PAG_TL_RENAME =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]";
- private final String PAG_TL_DISPLAY =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]";
- private final String PAG_TL_DELETE =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]";
- private final String PAG_TL_MAKEDEF =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]";
-
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
logoutIfPossible();
@@ -57,7 +90,6 @@
@AfterMethod(groups = { "log" })
public void logoutAfterTest() {
-
}
@Test(enabled = true)
@@ -67,7 +99,7 @@
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
-
+
final String portalName = "TestPortal";
Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already
exist.");
@@ -75,9 +107,11 @@
selenium.click(INPUT_SUBMIT_CREATEPORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
+ debugScreenshot("pa" + ".jpg");
Assert.assertTrue(selenium.isTextPresent(portalName));
int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ debugPrint(portalName + " : " + r);
Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_MAIN, r)));
Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_SECURITY,
r)));
@@ -90,22 +124,22 @@
@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.");
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);
@@ -133,22 +167,22 @@
@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, portalName);
selenium.click(INPUT_SUBMIT_CREATEPORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// then delete it
-
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -166,12 +200,13 @@
selenium.click(MessageFormat.format(POR_TL_DELETE, r));
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("WARNING! You are about to delete the
"+portalToDelete+" 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);
selenium.waitForPageToLoad(PAGE_LOAD);
- //Assert.assertTrue(selenium.isTextPresent("TestDelete has successfully been
destroyed"));
+ // Assert.assertTrue(selenium.isTextPresent(
+ // "TestDelete has successfully been destroyed"));
clickIfVisible("link=Admin");
clickIfVisible(TAB_PORTALOBJ_ID);
@@ -180,18 +215,206 @@
}
@Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPortalProperties() {
+ // first create a portal
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+
+ final String portalName = "TestProperties";
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already
exist.");
+
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // then property it
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent(portalName));
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ selenium.click(MessageFormat.format(POR_TL_PROPERTIES, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // Event Listener Binding
+
+ selenium.select(SEL_PP_LISTENER, "label=release_sessions_listener_self");
+ selenium.click(SUB_PP_LISTENER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PP_LISTENER, "label=user_listener");
+ selenium.click(SUB_PP_LISTENER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // Properties
+
+ final String propName1 = "viliamProp";
+ final String propVal1 = "hier!";
+ final String propName2 = "danielProp";
+ final String propVal2 = "ohne!";
+
+ selenium.type(INP_PP_PROPNAME, propName1);
+ selenium.click(SUB_PP_PROPADD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TBL_PP_PROPS, propName1, 0) - 1;
+
+ selenium.type(MessageFormat.format(INP_PP_PROP_VAL,r), propVal1);
+ selenium.click(SUB_PP_PROPVAL_UPDATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_PP_PROPNAME, propName2);
+ selenium.click(SUB_PP_PROPADD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TBL_PP_PROPS, propName2, 0) - 1;
+
+ selenium.type(MessageFormat.format(INP_PP_PROP_VAL,r), propVal2);
+ selenium.click(SUB_PP_PROPVAL_UPDATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TBL_PP_PROPS, propName1, 0) - 1;
+
+ selenium.click(MessageFormat.format(LNK_PP_PROP_DELETE,r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // Portal & Page Error Handling
+
+ selenium.click(CHK_PP_UNAVAIL_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(CHK_PP_ACCESS_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(CHK_PP_ERROR_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(CHK_PP_INTERNAL_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(CHK_PP_NF_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(CHK_PP_RES_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PP_ACCESS_SELECT, "label=Redirect to the specified
resource");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PP_UNAVAIL_SELECT, "label=Redirect to the specified
resource");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PP_ERROR_SELECT, "label=Display the default error
message");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PP_INTERNAL_SELECT, "label=Display the default error
message");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PP_NF_SELECT, "label=Redirect to the specified
resource");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_PP_RES_INPUT, "/WEB-INF/jsp/error/portalx.jsp");
+ selenium.click(SUB_PP_ERROR_FORM_UPDATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click(CHK_PPA_ACCESS_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(CHK_PPA_CONTROL_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(CHK_PPA_ERROR_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(CHK_PPA_INTERNAL_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(CHK_PPA_NF_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(CHK_PPA_RES_CHECK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PPA_ACCESS_SELECT, "label=Redirect to the specified
resource");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PPA_CONTROL_SELECT, "label=Redirect to the specified
resource");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PPA_ERROR_SELECT, "label=Display the default error
message");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PPA_INTERNAL_SELECT, "label=Display the default error
message");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PPA_NF_SELECT, "label=Redirect to the specified
resource");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_PPA_RES_SELECT, "/WEB-INF/jsp/error/pagey.jsp");
+ selenium.click(SUB_PPA_FORM_UPDATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // logout login and property again
+
+ logout();
+ login("admin","admin");
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent(portalName));
+
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ selenium.click(MessageFormat.format(POR_TL_PROPERTIES, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // assert time!
+
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_LISTENER),"user_listener");
+
+ r = findTableRow(TBL_PP_PROPS, propName1, 0) - 1;
+ Assert.assertFalse(r>0, propName1+" was deleted previously but now it's
found in property table");
+ r = findTableRow(TBL_PP_PROPS, propName2, 0) - 1;
+ Assert.assertEquals(selenium.getValue(MessageFormat.format(INP_PP_PROP_VAL,r)),
propVal2, "previously changed value other than expected");
+
+ Assert.assertFalse(selenium.isChecked(CHK_PP_UNAVAIL_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_ACCESS_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_ERROR_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_INTERNAL_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_NF_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_RES_CHECK));
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_ACCESS_SELECT),"Redirect to
the specified resource");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_UNAVAIL_SELECT),"Redirect to
the specified resource");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_ERROR_SELECT),"Display the
default error message");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_INTERNAL_SELECT),"Display the
default error message");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_NF_SELECT),"Redirect to the
specified resource");
+ Assert.assertEquals(selenium.getValue(INP_PP_RES_INPUT),"/WEB-INF/jsp/error/portalx.jsp");
+
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_ACCESS_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_CONTROL_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_ERROR_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_INTERNAL_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_NF_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_RES_CHECK));
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_ACCESS_SELECT),"Redirect to
the specified resource");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_CONTROL_SELECT),"Redirect to
the specified resource");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_ERROR_SELECT),"Display the
default error message");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_INTERNAL_SELECT),"Display
the default error message");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_NF_SELECT),"Redirect to the
specified resource");
+ Assert.assertEquals(selenium.getValue(INP_PPA_RES_SELECT),"/WEB-INF/jsp/error/pagey.jsp");
+
+ }
+
+ @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);
-
selenium.type(INPUT_PORTALNAME, portalName);
selenium.click(INPUT_SUBMIT_CREATEPORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -200,7 +423,7 @@
selenium.click(MessageFormat.format(POR_TL_MAIN, r));
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isTextPresent(portalPage), "Portal page already
present");
Assert.assertTrue(selenium.isTextPresent("Create a page named:"));
@@ -210,15 +433,15 @@
Assert.assertTrue(selenium.isTextPresent(portalPage));
}
- @Test(enabled = true, dependsOnMethods = {
"testPortalCreate","testAddPage" })
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate",
"testAddPage" })
public void testRemovePage() {
-
+
final String portalName = "TestRemovePagePortal";
final String portalPage = "tRemPage";
createPortal(portalName);
createPage(portalName, portalPage);
-
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -270,43 +493,43 @@
// click on the page layout
selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
- //selenium.waitForPageToLoad(PAGE_LOAD);
+
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
+
selenium.click("link=Who's online portlet");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.type(INP_WINDOW_NAME, windowName);
-
+
selenium.click(SUB_LAYOUT_ADD_CENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent(windowName), "created window name not
found on the screen");
+ Assert.assertTrue(selenium.isTextPresent(windowName));
selenium.open("/portal/auth/portal/mimikry");
Assert.assertTrue(selenium.isTextPresent("Current users"));
}
-
- @Test(enabled = true, dependsOnMethods={"testPortalCreate",
"testAddPage"})
- public void testPageRename(){
+
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate",
"testAddPage" })
+ public void testPageRename() {
String portalName = "TestPortal";
String pageName = "PageToRename";
-
+
createPage("TestPortal", "PageToRename");
-
+
openAndWait("/portal");
clickAndWait("link=Admin");
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
- //selenium.setSpeed("8000");
- clickIfVisible(LINK_PORTAL_HOME ,"Create a portal named:");
-
+ // selenium.setSpeed("8000");
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
@@ -318,20 +541,17 @@
}
@Test(enabled = false)
- public void testPageSecurity(){
-
+ public void testPageSecurity() {
}
-
+
@Test(enabled = false)
- public void testPageTheme(){
-
+ public void testPageTheme() {
}
-
+
@Test(enabled = false)
- public void testPageLayout(){
-
+ public void testPageLayout() {
}
-
+
private void createPortal(String name) {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -366,5 +586,4 @@
selenium.waitForPageToLoad(PAGE_LOAD);
}
-
}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -10,34 +10,36 @@
public class DashboardsTestCase extends JBossPortalSeleniumTestCase {
- private static final String T_DH_SUB_UPDATE =
"//form[contains(@id,'common-edit-theme-form')]/input[@type='submit']";
- private static final String T_DH_SEL_RENDERSET =
"//select[contains(@id,'common-edit-theme-form:renderSet')]";
- private static final String T_DH_SEL_THEME =
"//select[contains(@id,'common-edit-theme-form:theme')]";
- private static final String T_DH_SEL_LAYOUT =
"//select[contains(@id,'common-edit-theme-form:layout')]";
- private static final String T_PA_SUB_UPDATE =
"//input[contains(@id,'common-edit-page-error-form:update')]";
- private static final String T_PO_SUB_UPDATE =
"//input[contains(@id,'common-edit-portal-error-form:update')]";
- private static final String T_PA_INP_PAGEADD =
"//input[contains(@id,'common-edit-page-error-form:page-res-select')]";
- private static final String T_PO_INP_PAGEADD =
"//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]";
- private static final String T_PA_SEL_PNF =
"//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]";
- private static final String T_PA_SEL_INTERN =
"//select[contains(@id,'common-edit-page-error-form:page-internal-select')]";
- private static final String T_PA_SEL_ERROR =
"//select[contains(@id,'common-edit-page-error-form:page-error-select')]";
- private static final String T_PA_SEL_CONTROL =
"//select[contains(@id,'common-edit-page-error-form:page-control-select')]";
- private static final String T_PA_SEL_ACCESS =
"//select[contains(@id,'common-edit-page-error-form:page-access-select')]";
- private static final String T_PO_SEL_PNF =
"//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]";
- private static final String T_PO_SEL_UNAVAIL =
"//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]";
- private static final String T_PO_SEL_ACCESS =
"//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]";
- private static final String SUBMIT_UPDATE_VALUE =
"//input[contains(@id,'common-manage-prop-form:update')]";
- private static final String TABLE_PROPS =
"//table[contains(@id,'common-manage-prop-form:prop-data-table')]";
- private static final String T_PROPS_INPUT_VALUE =
"//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]";
- private static final String T_PROPS_LINK_DEL =
"//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]";
+ public final String casePfx = "portal.dash.";
+
+ private final String T_DH_SUB_UPDATE =
getProp(casePfx+"t.dh.sub.update","//form[contains(@id,'common-edit-theme-form')]/input[@type='submit']");
+ private final String T_DH_SEL_RENDERSET =
getProp(casePfx+"t.dh.sel.renderset","//select[contains(@id,'common-edit-theme-form:renderSet')]");
+ private final String T_DH_SEL_THEME =
getProp(casePfx+"t.dh.sel.theme","//select[contains(@id,'common-edit-theme-form:theme')]");
+ private final String T_DH_SEL_LAYOUT =
getProp(casePfx+"t.dh.sel.layout","//select[contains(@id,'common-edit-theme-form:layout')]");
+ private final String T_PA_SUB_UPDATE =
getProp(casePfx+"t.pa.sub.update","//input[contains(@id,'common-edit-page-error-form:update')]");
+ private final String T_PO_SUB_UPDATE =
getProp(casePfx+"t.po.sub.update","//input[contains(@id,'common-edit-portal-error-form:update')]");
+ private final String T_PA_INP_PAGEADD =
getProp(casePfx+"t.pa.inp.pageadd","//input[contains(@id,'common-edit-page-error-form:page-res-select')]");
+ private final String T_PO_INP_PAGEADD =
getProp(casePfx+"t.po.inp.pageadd","//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]");
+ private final String T_PA_SEL_PNF =
getProp(casePfx+"t.pa.sel.pnf","//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]");
+ private final String T_PA_SEL_INTERN =
getProp(casePfx+"t.pa.sel.intern","//select[contains(@id,'common-edit-page-error-form:page-internal-select')]");
+ private final String T_PA_SEL_ERROR =
getProp(casePfx+"t.pa.sel.error","//select[contains(@id,'common-edit-page-error-form:page-error-select')]");
+ private final String T_PA_SEL_CONTROL =
getProp(casePfx+"t.pa.sel.control","//select[contains(@id,'common-edit-page-error-form:page-control-select')]");
+ private final String T_PA_SEL_ACCESS =
getProp(casePfx+"t.pa.sel.access","//select[contains(@id,'common-edit-page-error-form:page-access-select')]");
+ private final String T_PO_SEL_PNF =
getProp(casePfx+"t.po.sel.pnf","//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]");
+ private final String T_PO_SEL_UNAVAIL =
getProp(casePfx+"t.po.sel.unavail","//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]");
+ private final String T_PO_SEL_ACCESS =
getProp(casePfx+"t.po.sel.access","//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]");
+ private final String SUBMIT_UPDATE_VALUE =
getProp(casePfx+"submit.update.value","//input[contains(@id,'common-manage-prop-form:update')]");
+ private final String TABLE_PROPS =
getProp(casePfx+"table.props","//table[contains(@id,'common-manage-prop-form:prop-data-table')]");
+ private final String T_PROPS_INPUT_VALUE =
getProp(casePfx+"t.props.input.value","//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]");
+ private final String T_PROPS_LINK_DEL =
getProp(casePfx+"t.props.link.del","//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]");
+ private final String TABLE_PA_ERR =
getProp(casePfx+"table.pa.err","//form[@id='common-edit-page-error-form']/table");
+ private final String TABLE_PO_ERR =
getProp(casePfx+"table.po.err","//form[@id='common-edit-portal-error-form']/table");
+ private final String TABLE_DH_THM =
getProp(casePfx+"table.dh.thm","//form[@id='common-edit-theme-form']/table");
+ private final String INPUT_PROP_NAME =
getProp(casePfx+"input.prop.name","//input[contains(@id,'common-edit-prop-form:property')]");
+ private final String SUBMIT_ADD_PROP =
getProp(casePfx+"submit.add.prop","//input[contains(@id,'common-edit-prop-form:add-property')]");
+ private final String LINK_ADMIN =
getProp(casePfx+"link.admin","link=Admin");
+ private final String LINK_TAB_DASH =
getProp(casePfx+"link.tab.dash","//a[contains(@id,'admin-subtab-form:dashboard-link')]");
- private static final String TABLE_PA_ERR =
"//form[@id='common-edit-page-error-form']/table";
- private static final String TABLE_PO_ERR =
"//form[@id='common-edit-portal-error-form']/table";
- private static final String TABLE_DH_THM =
"//form[@id='common-edit-theme-form']/table";
- private static final String INPUT_PROP_NAME =
"//input[contains(@id,'common-edit-prop-form:property')]";
- private static final String SUBMIT_ADD_PROP =
"//input[contains(@id,'common-edit-prop-form:add-property')]";
- private static final String LINK_ADMIN = "link=Admin";
- private static final String LINK_TAB_DASH =
"//a[contains(@id,'admin-subtab-form:dashboard-link')]";
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
Added:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
(rev 0)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -0,0 +1,282 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jboss.portal.test.selenium.portal;
+
+import java.text.MessageFormat;
+import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
+ */
+@Test(groups = { "end2end" }, enabled = true, description = "Creating of
new portal with content.")
+public class EndtoEndPortalAdminTestCase extends JBossPortalSeleniumTestCase {
+
+
+ public static String casePfx = "portal.e2e.";
+
+ private final String ADR_PORTAL = getProp(casePfx +
"adr.home","/portal");
+ public final String SEL_PORTLET_TYPE = getProp(casePfx +
"sel.portlet.type","//select[contains(@id,'windowForm:instanceId')]");
+ private final String SUB_LAYOUT_ADD_CENTER = getProp(casePfx +
"sub.layout.add.center",
"//input[contains(@id,'layoutForm:a_center')]");
+ private final String INP_WINDOW_NAME = getProp(casePfx + "inp.window.name",
"//input[contains(@id,'windowForm:windowName')]");
+ private final String SUB_RENAME_PORTAL = getProp(casePfx +
"sub.rename.portal",
"//input[contains(@id,'renameForm:rename')]");
+ private final String INP_RENAME_PORTAL = getProp(casePfx +
"inp.rename.portal",
"//input[contains(@id,'renameForm:newName')]");
+ private final String SUB_DELETE_PORTAL_CONF = getProp(casePfx +
"sub.delete.portal.conf",
"//input[contains(@id,'delete-view:confirm-form:delete')]");
+ private final String INP_SUBMIT_PAGECREATE = getProp(casePfx +
"inp.submit.pagecreate",
"//input[contains(@id,'create-page-form:create-page')]");
+ private final String INP_PAGENAME = getProp(casePfx + "inp.pagename",
"//input[contains(@id,'create-page-form:pageName')]");
+ private final String INP_PORTALNAME = getProp(casePfx + "inp.portalname",
"//input[contains(@id,'create-portal-form:name')]");
+ private final String INP_SUBMIT_CREATEPORTAL = getProp(casePfx +
"inp.submit.createportal",
"//input[contains(@id,'create-portal-form:create-portal')]");
+ private final String TAB_PORTALOBJ_ID = getProp(casePfx + "tab.portalobj.id",
"Link=Admin");
+ private final String LNK_PORTALS_ID = getProp(casePfx + "lnk.portals.id",
"link=*Portal Objects*");
+ private final String LNK_PORTAL_HOME = getProp(casePfx + "lnk.portal.home",
"//a[contains(@id,'obj-temp-form:object-link-0')]");
+ private final String TBL_PORTAL_ADMIN = getProp(casePfx + "tbl.portal.admin",
"//table[contains(@id,'obj-nav-form:portal-datatable')]");
+ private final String POR_TL_MAIN = getProp(casePfx + "por.tl.main",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]");
+ private final String POR_TL_SECURITY = getProp(casePfx + "por.tl.security",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]");
+ private final String POR_TL_PROPERTIES = getProp(casePfx +
"por.tl.properties",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]");
+ private final String POR_TL_THEME = getProp(casePfx + "por.tl.theme",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]");
+ private final String POR_TL_RENAME = getProp(casePfx + "por.tl.rename",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]");
+ private final String POR_TL_DELETE = getProp(casePfx + "por.tl.delete",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]");
+ private final String POR_TL_MAKEDEF = getProp(casePfx + "por.tl.makedef",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]");
+ private final String TBL_PORTALPAGE_ADMIN = getProp(casePfx +
"tbl.portalpage.admin",
"//table[contains(@id,'obj-nav-form:pages-datatable')]");
+ private final String PAG_TL_MAIN = getProp(casePfx + "pag.tl.main",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]");
+ private final String PAG_TL_LAYOUT = getProp(casePfx + "pag.tl.layout",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]");
+ private final String PAG_TL_SECURITY = getProp(casePfx + "pag.tl.security",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]");
+ private final String PAG_TL_PROPERTIES = getProp(casePfx +
"pag.tl.properties",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]");
+ private final String PAG_TL_THEME = getProp(casePfx + "pag.tl.theme",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]");
+ private final String PAG_TL_RENAME = getProp(casePfx + "pag.tl.rename",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]");
+ private final String PAG_TL_DISPLAY = getProp(casePfx + "pag.tl.display",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]");
+ private final String PAG_TL_DELETE = getProp(casePfx + "pag.tl.delete",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]");
+ private final String PAG_TL_MAKEDEF = getProp(casePfx + "pag.tl.makedef",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]");
+ private final String DIV_PORT_CONTENT = getProp(casePfx + "div.por.cont",
"conrrerertent-container");
+ private final String INP_GOO_SEARCH = getProp(casePfx + "inp.goo.search",
"//div[contains(@id,'directory_search_div')]/form/input[@name='query']");
+ private final String SUB_GOO_SEARCH = getProp(casePfx + "sup.goo.search",
"//div[contains(@id,'directory_search_div')]/form/input[@type='submit']");
+ private final String INP_NET_SEARCH = getProp(casePfx + "inp.goo.search",
"//div[contains(@id,'directory_search_div')]/form/input[@name='query']");
+ private final String SUB_NET_SEARCH = getProp(casePfx + "sub.goo.search",
"//div[contains(@id,'directory_search_div')]/form/input[@type='submit']");
+
+ /*
+ * - create a new portal - add couple of page to the portal - add few
+ * portlets of different kinds (csm, widget, regular portlets) in each page
+ * - verify that new portal, pages and portlets get added correctly. - Make
+ * the new portal default and verify that it becomes default portal
+ */
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ logoutIfPossible();
+ login("admin", "admin");
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+ }
+
+ final String portalName = "UseCasePortal";
+ final String page1Name = "firstPage";
+ final String page2Name = "anotherPage";
+ final String page3Name = "lastPage with whitespace";
+ final String page4Name = "dseer";
+ final String page5Name = "cemese";
+ final String PORTLET1 = "Cart Portlet";
+ final String por1str = "Cart Portlet";
+ final String PORTLET2 = "Band Culinaria";
+ final String por2str = "Band Culinaria";
+ final String PORTLET3 = "Cahuete.com";
+ final String por3str = "Cahuete.com";
+ final String PORTLET4 = "dir1/foo.txt";
+ final String por4str = "File Portlet";
+ final String PORTLET5 = "default/index.html";
+ final String por5str = "Powered by JBoss Enterprise Portal Platform";
+
+ @Test(enabled = true, description = "Usecase for creating small portal with
content.")
+ public void testCreatePortalUsecase() {
+ createPortal(portalName);
+
+ addPage(page1Name);
+ addPage(page2Name);
+ addPage(page3Name);
+ addPage(page4Name);
+ addPage(page5Name);
+
+ addPortlet(portalName, page1Name, PORTLET1, "portlet");
+ addPortlet(portalName, page2Name, PORTLET2, "widget/google");
+ addPortlet(portalName, page3Name, PORTLET3, "widget/netvibes");
+ //addPortlet(portalName, page4Name, PORTLET4, "filesystem");
+ addPortlet(portalName, page5Name, PORTLET5, "cms");
+
+ makeDefaultPortal(portalName);
+
+ // Assert the portal is default
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals("", selenium.getText(DIV_PORT_CONTENT));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page1Name));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page2Name));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page3Name));
+ //Assert.assertTrue(selenium.isElementPresent("link=" + page4Name));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page5Name));
+
+ // Assert pages contain what they should
+ assertPageContains(page1Name, por1str);
+ assertPageContains(page2Name, por2str);
+ assertPageContains(page3Name, por3str);
+ //assertPageContains(page4Name, por4str);
+ assertPageContains(page5Name, por5str);
+
+ }
+
+ public void testManagePortal(){
+
+ }
+
+ private void assertPageContains(String pageName, String awaitStr) {
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=" + pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent(awaitStr));
+ }
+
+ private void createPortal(String portalName) {
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
+
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already
exist.");
+
+ selenium.type(INP_PORTALNAME, portalName);
+ selenium.click(INP_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent(portalName));
+ }
+
+ private void addPage(String pageName) {
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
+
+ selenium.type(INP_PORTALNAME, portalName);
+ selenium.click(INP_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
+
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(selenium.isTextPresent(pageName), "Portal page already
present");
+ Assert.assertTrue(selenium.isTextPresent("Create a page named:"));
+
+ selenium.type(INP_PAGENAME, pageName);
+ selenium.click(INP_SUBMIT_PAGECREATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(pageName));
+ }
+
+ private void addPortlet(String portalName, String pageName, String portletName, String
type) {
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
+
+ int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TBL_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ // click on the page layout
+ selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
+
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ // hack
+ selenium.select(SEL_PORTLET_TYPE, "label=" + "cms");
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ selenium.select(SEL_PORTLET_TYPE, "label=" + type);
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ if ("portlet".equals(type)) {
+
+ } else if ("widget/google".equals(type)) {
+ selenium.type(INP_GOO_SEARCH, portletName);
+ selenium.click(SUB_GOO_SEARCH);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ } else if ("widget/netvibes".equals(type)) {
+ selenium.type(INP_NET_SEARCH, portletName);
+ selenium.click(SUB_NET_SEARCH);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ } else if ("cms".equals(type)) {
+ String[] links = portletName.split("/");
+ selenium.click("link="+links[0]);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ portletName = links[1];
+ } else if ("filesystem".equals(type)) {
+ String[] links = portletName.split("/");
+ selenium.click("link="+links[0]);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ portletName = links[1];
+ }
+
+ selenium.click("link=*" + portletName+"*");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_LAYOUT_ADD_CENTER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+
+ }
+
+ private void makeDefaultPortal(String portalName) {
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
+
+ int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
+
+ selenium.click(MessageFormat.format(POR_TL_MAKEDEF, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+}
Added:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java
(rev 0)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -0,0 +1,325 @@
+package org.jboss.portal.test.selenium.portal;
+
+import java.text.MessageFormat;
+
+import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class PageCoordinationTestCase extends JBossPortalSeleniumTestCase {
+ private final String INP_ALIAS_REN =
"//input[contains(@name,'renameForm:newName')]";
+ private final String SUB_ALIAS_RENAME_SUBMIT =
"//input[contains(@name,'renameForm:j_id35')]";
+ private final String SUB_ALIAS_REN_CANCEL =
"//input[contains(@name,'renameForm:j_id36')]";
+ private final String TBL_ALIASES =
"//div[@id='aliasBindings']/form/div/table";
+ private final String LNK_T_ALIAS_RENAME =
"//div[@id=''aliasBindings'']/form[2]/div/table/tbody/tr[{0}]/td[2]/table/tbody/tr/td[1]/a/span";
+ private final String LNK_T_ALIAS_DELETE =
"//div[@id=''aliasBindings'']/form[2]/div/table/tbody/tr[{0}]/td[2]/table/tbody/tr/td[2]/a/span";
+ private final String SUB_ALIAS_DEL_SUBMIT =
"//input[contains(@name,'j_id47:j_id34:j_id40:j_id41')]";
+ private final String SUB_ALIAS_DEL_CANCEL =
"//input[contains(@name,'j_id47:j_id34:j_id40:j_id42')]";
+ private final String CHK_EXPL_WIR =
"//input[contains(@id,'useExplicitEvents')]";
+ private final String CHK_PARAM_BIND =
"//input[contains(@id,'useExplicitBinding')]";
+ private final String SUB_CREATE_ALIAS =
"//input[contains(@name,'create-alias-form') and
@type='submit'][1]";
+ private final String SUB_CREATE_ALIAS_CANCEL =
"//input[contains(@name,'create-alias-form') and
@type='submit'][2]";
+ private final String INP_ALIAS_NAME =
"//input[contains(@id,'create-alias-form:aliasName')]";
+ private final String LIS_RENDER_PAR =
"//select[contains(@id,'create-alias-form:alias')]";
+
+ public final String casePfx = "portal.admin.";
+
+ private final String TAB_PORTALOBJ_ID = getProp(casePfx + "tab.portalobj.id",
"Link=Admin");
+ private final String LINK_PORTALS_ID = getProp(casePfx + "link.portals.id",
"link=*Portal Objects*");
+ private final String LINK_PORTAL_HOME = getProp(casePfx + "link.portal.home",
"//a[contains(@id,'obj-temp-form:object-link-0')]");
+ private final String TABLE_PORTAL_ADMIN = getProp(casePfx +
"table.portal.admin",
"//table[contains(@id,'obj-nav-form:portal-datatable')]");
+ private final String POR_TL_MAIN = getProp(casePfx + "por.tl.main",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]");
+ private final String TABLE_PORTALPAGE_ADMIN = getProp(casePfx +
"table.portalpage.admin",
"//table[contains(@id,'obj-nav-form:pages-datatable')]");
+ private final String PAG_TL_COORDINATION = getProp(casePfx + "pag.tl.coord",
"//a[contains(@id,''pages-datatable:{0}:edit-coord'')]");
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ logoutIfPossible();
+ login("admin", "admin");
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+ }
+
+ @Test(enabled = true)
+ public void testDefaultPageCoordination(){
+ openAndWait("/portal/auth/portal/default/Coordination+Samples");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):null"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):null"));
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?zipcode=10101");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):null"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):10101"));
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?zip=10102");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):10102"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):10102"));
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?zipcode=10103");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):null"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):10103"));
+ }
+
+ @Test(enabled = true, dependsOnMethods ={"testDefaultPageCoordination"})
+ public void testPageCoordination(){
+ String portalName = "default";
+ String pageName = "Coordination Samples";
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+
+ // create alias
+ selenium.addSelection(LIS_RENDER_PAR, "label=zipcode");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_ALIAS_NAME, "aliasBindTest");
+ selenium.click(SUB_CREATE_ALIAS_CANCEL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.addSelection(LIS_RENDER_PAR, "label=zipcode");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_ALIAS_NAME, "aliasBindTest");
+ selenium.click(SUB_CREATE_ALIAS);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?aliasBindTest=222333");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):null"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):222333"));
+
+ }
+
+ @Test(enabled = true, dependsOnMethods ={"testDefaultPageCoordination"})
+ public void testDeleteAlias(){
+ int count = 0;
+ String portalName = "default";
+ String pageName = "Coordination Samples";
+
+ debugPrint("in testDeleteAlias()");
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+ selenium.captureScreenshot(++count + ".jpg");
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ debugScreenshot(++count + ".jpg");
+ clickIfVisible(LINK_PORTALS_ID);
+ debugScreenshot(++count + ".jpg");
+ clickIfVisible(LINK_PORTAL_HOME);
+ debugScreenshot(++count + ".jpg");
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ debugPrint("Position of admin portal : " +
findTableRow(TABLE_PORTAL_ADMIN, "admin", 0));
+ debugPrint("Position of default portal : " +
findTableRow(TABLE_PORTAL_ADMIN, "default", 0));
+ debugPrint("Position of template portal : " +
findTableRow(TABLE_PORTAL_ADMIN, "template", 0));
+ debugPrint("Table rows in " + TABLE_PORTAL_ADMIN + " : " +
countTableRows(TABLE_PORTAL_ADMIN));
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+ debugScreenshot(++count + ".jpg");
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+ debugPrint(pageName +" : "+r);
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+ debugScreenshot(++count + ".jpg");
+
+ // create delete alias
+ selenium.addSelection(LIS_RENDER_PAR,
"label={urn:jboss:portal:samples:coor}zipcode");
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ debugScreenshot(++count + ".jpg");
+ selenium.type(INP_ALIAS_NAME, "aliasBindDelete");
+
+ selenium.click(SUB_CREATE_ALIAS);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ debugScreenshot(++count + ".jpg");
+
+ // delete alias
+ r = findTableRow(TBL_ALIASES, "aliasBindDelete", 0);
+
+ selenium.click(MessageFormat.format(LNK_T_ALIAS_DELETE,r));
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ debugScreenshot(++count + ".jpg");
+ selenium.click(SUB_ALIAS_DEL_CANCEL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ debugScreenshot(++count + ".jpg");
+ r = findTableRow(TBL_ALIASES, "aliasBindDelete", 0);
+
+ selenium.click(MessageFormat.format(LNK_T_ALIAS_DELETE,r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ debugScreenshot(++count + ".jpg");
+ selenium.click(SUB_ALIAS_DEL_SUBMIT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ debugScreenshot(++count + ".jpg");
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?zip=222333");
+ debugScreenshot(++count + ".jpg");
+ Assert.assertTrue(selenium.isTextPresent("Weather for
(my_zipcode):222333"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):222333"));
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?aliasBindDelete=222334");
+ debugScreenshot(++count + ".jpg");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):null"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):null"));
+ }
+
+ @Test(enabled = true, dependsOnMethods ={"testDefaultPageCoordination"})
+ public void testRenameAlias(){
+ String portalName = "default";
+ String pageName = "Coordination Samples";
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+
+ // create rename alias
+ selenium.addSelection(LIS_RENDER_PAR,
"label={urn:jboss:portal:samples:coor}zipcode");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_ALIAS_NAME, "aliasBingRename");
+
+ selenium.click(SUB_CREATE_ALIAS);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // rename alias
+ r = findTableRow(TBL_ALIASES, "aliasBingRename", 0);
+
+ selenium.click(MessageFormat.format(LNK_T_ALIAS_RENAME,r));
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_ALIAS_REN_CANCEL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TBL_ALIASES, "aliasBingRename", 0);
+
+ selenium.click(MessageFormat.format(LNK_T_ALIAS_RENAME,r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_ALIAS_REN, "aliasBindWasRenamed");
+ selenium.click(SUB_ALIAS_RENAME_SUBMIT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?zip=222333");
+ Assert.assertTrue(selenium.isTextPresent("Weather for
(my_zipcode):222333"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):222333"));
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?aliasBingRename=222334");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):null"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):null"));
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?aliasBindWasRenamed=222334");
+ Assert.assertTrue(selenium.isTextPresent("Weather for
(my_zipcode):222334"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):null"));
+ }
+
+ @Test(enabled = true, dependsOnMethods ={"testDefaultPageCoordination"})
+ public void testParamBinding(){
+ String portalName = "default";
+ String pageName = "Coordination Samples";
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+
+ // parameter binding
+ selenium.click(CHK_PARAM_BIND);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ logout();
+ login("admin","admin");
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+
+ Assert.assertTrue(selenium.isChecked(CHK_PARAM_BIND));
+ }
+
+ @Test(enabled = true, dependsOnMethods ={"testDefaultPageCoordination"})
+ public void testExplicitWiring(){
+ String portalName = "default";
+ String pageName = "Coordination Samples";
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+
+ // explicit wiring
+ selenium.click(CHK_EXPL_WIR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ logout();
+ login("admin","admin");
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+
+ Assert.assertTrue(selenium.isChecked(CHK_EXPL_WIR));
+ }
+}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -10,19 +10,22 @@
public class PortletDefinitionsTestCase extends JBossPortalSeleniumTestCase{
- private static final String T_LINK_PREF =
"//a[contains(@id,''def-list:portlet-pref-{0}'')]";
- private static final String SUBMIT_CREATE_INST =
"//input[contains(@name,'add_instance_form:j_id19')]";
- private static final String INPUT_INSTANCE_NAME =
"//input[contains(@id,'add_instance_form:instanceId')]";
- private static final String T_LINK_CREATE =
"//a[contains(@id,''def-list:create-instance-{0}'')]";
- private static final String SUBMIT_PROVIDER_VIEW =
"//input[contains(@id,'definition-form:view-portlets')]";
- private static final String SELECT_PROVIDER =
"//select[contains(@id,'definition-form:menu')]";
- private static final String TABLE_PORTLET =
"//form[contains(@id,'def-list')]/table";
- private static final String LINK_NAME_ADMIN_PORT =
"//a[contains(@id,'common-show-portlet-detail-form:field1:select')]";
- private static final String LINK_ADMIN_PORT =
"//a[contains(@id,'def-list:portlet-def-0')]";
- private static final String LINK_ADMIN = "link=Admin";
- private static final String LINK_TAB_PD =
"//a[contains(@id,'admin-subtab-form:portlet-def-link')]";
- private static final String LINK_PD_MAIN =
"//a[contains(@id,'man-form:def-link')]";
+ public final String casePfx = "portal.port.def.";
+ private final String T_LINK_PREF =
getProp(casePfx+"t.link.pref","//a[contains(@id,''def-list:portlet-pref-{0}'')]");
+ private final String SUBMIT_CREATE_INST =
getProp(casePfx+"submit.create.inst","//input[contains(@name,'add_instance_form:j_id19')]");
+ private final String INPUT_INSTANCE_NAME =
getProp(casePfx+"input.instance.name","//input[contains(@id,'add_instance_form:instanceId')]");
+ private final String T_LINK_CREATE =
getProp(casePfx+"t.link.create","//a[contains(@id,''def-list:create-instance-{0}'')]");
+ private final String SUBMIT_PROVIDER_VIEW =
getProp(casePfx+"submit.provider.view","//input[contains(@id,'definition-form:view-portlets')]");
+ private final String SELECT_PROVIDER =
getProp(casePfx+"select.provider","//select[contains(@id,'definition-form:menu')]");
+ private final String TABLE_PORTLET =
getProp(casePfx+"table.portlet","//form[contains(@id,'def-list')]/table");
+ private final String LINK_NAME_ADMIN_PORT =
getProp(casePfx+"link.name.admin.port","//a[contains(@id,'common-show-portlet-detail-form:field1:select')]");
+ private final String LINK_ADMIN_PORT =
getProp(casePfx+"link.admin.port","//a[contains(@id,'def-list:portlet-def-0')]");
+ private final String LINK_ADMIN =
getProp(casePfx+"link.admin","link=Admin");
+ private final String LINK_TAB_PD =
getProp(casePfx+"link.tab.pd","//a[contains(@id,'admin-subtab-form:portlet-def-link')]");
+ private final String LINK_PD_MAIN =
getProp(casePfx+"link.pd.main","//a[contains(@id,'man-form:def-link')]");
+
+
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
logoutIfPossible();
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java 2009-03-30
13:02:10 UTC (rev 13102)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java 2009-03-31
15:58:16 UTC (rev 13103)
@@ -10,45 +10,44 @@
public class PortletInstancesTestCase extends JBossPortalSeleniumTestCase {
- private static final String TAB_PORTLET_INSTANCES =
"//table[contains(@id,'instancesTable2')]";
- private static final String UL_PAGINATOR = "//ul[@class='pagination
property-container']";
- private static final String SUBMIT_SECURITY_UPDATE =
"//input[contains(@id,'common-edit-security-form:update')]";
- private static final String SUBMIT_SECURITY_CANCEL =
"//input[contains(@id,'common-edit-security-form:cancel')]";
+ public final String casePfx = "portal.port.ins.";
- private static final String LINK_20_PAGE = "link=20";
- private static final String LINK_PREF_WELCOMEPORT =
"//a[contains(@id,'security-JSPPortletInstance')]";
+ private final String TAB_PORTLET_INSTANCES = getProp(casePfx +
"tab.portlet.instances",
"//table[contains(@id,'instancesTable2')]");
+ private final String UL_PAGINATOR = getProp(casePfx + "ul.paginator",
"//ul[@class='pagination property-container']");
+ private final String SUBMIT_SECURITY_UPDATE = getProp(casePfx +
"submit.security.update",
"//input[contains(@id,'common-edit-security-form:update')]");
+ private final String SUBMIT_SECURITY_CANCEL = getProp(casePfx +
"submit.security.cancel",
"//input[contains(@id,'common-edit-security-form:cancel')]");
+ private final String LINK_20_PAGE = getProp(casePfx + "link.20.page",
"link=20");
+ private final String LINK_PREF_WELCOMEPORT = getProp(casePfx +
"link.pref.welcomeport",
"//a[contains(@id,'security-JSPPortletInstance')]");
+ private final String TABLE_PREF_KEY = getProp(casePfx + "table.pref.key",
"//form[contains(@id,'common-edit-pref-form')]/table");
+ private final String SUBMIT_PREF_DELETE = getProp(casePfx +
"submit.pref.delete",
"//input[contains(@id,'common-edit-exisiting-form:row_0')]");
+ private final String LINK_PREF_GUESTNUM = getProp(casePfx +
"link.pref.guestnum",
"//a[contains(@id,'common-edit-pref-form:pref-link-0')]");
+ private final String INPUT_PREF_NEWVAL = getProp(casePfx +
"input.pref.newval",
"//input[contains(@id,'common-append-form:new_value')]");
+ private final String SUBMIT_PREF_UPDATE = getProp(casePfx +
"submit.pref.update",
"//input[contains(@id,'common-append-form:append-button')]");
+ private final String SUBMIT_PREF_SAVE = getProp(casePfx + "submit.pref.save",
"//input[contains(@id,':save')]");
+ private final String INPUT_PREF_UPDATE = getProp(casePfx +
"input.pref.update",
"//input[contains(@id,'common-edit-exisiting-form:update')]");
+ private final String INPUT_PREF_APPEND = getProp(casePfx +
"input.pref.append",
"//input[contains(@id,'common-edit-exisiting-form:pref-input-0')]");
+ private final String SUBMIT_PREF_CANCEL = getProp(casePfx +
"submit.pref.cancel", "//input[contains(@id,':cancel')]");
+ private final String LINK_CURUSER_PREFERENCES = getProp(casePfx +
"link.curuser.preferences","//a[contains(@id,'instances-form:preference-CurrentUsersPortletInstance')]");
+ private final String LINK_DEL_EXCEPTPORT = getProp(casePfx +
"link.del.exceptport",
"//a[contains(@id,'instances-form:delete-GoogleMapPortletInstance')]");
+ private final String SUBMIT_PI_DELETE_CONF = getProp(casePfx +
"submit.pi.delete.conf",
"//input[contains(@id,'confirm-delete-form1:delete')]");
+ private final String SUBMIT_PI_DELETE_CANC = getProp(casePfx +
"submit.pi.delete.canc",
"//input[contains(@id,'confirm-delete-form1:cancel')]");
+ private final String T_LINK_DELETENAME = getProp(casePfx +
"t.link.deletename","//a[contains(@id,''instance-display-form:locale-datatable:{0}:delete-link'')]");
+ private final String T_LINK_MODIFYNAME = getProp(casePfx +
"t.link.modifyname","//a[contains(@id,''instance-display-form:locale-datatable:{0}:edit-link'')]");
+ private final String LINK_COUNTPORT = getProp(casePfx + "link.countport",
"//a[contains(@id,'instances-form:CurrentUsersPortletInstance')]");
+ private final String NAME_COUNTPORT = getProp(casePfx + "name.countport",
"CurrentUsersPortletInstance");
+ private final String SUBMIT_MODIFY_NAME = getProp(casePfx +
"submit.modify.name",
"//input[contains(@id,'add-display-name-form:addDisplay')]");
+ private final String INPUT_NAME = getProp(casePfx + "input.name",
"//input[contains(@id,'add-display-name-form:newName')]");
+ private final String SELECT_LANGUAGE = getProp(casePfx + "select.language",
"//select[contains(@id,'add-display-name-form:locales')]");
+ private final String LINK_ADMIN = getProp(casePfx + "link.admin",
"link=Admin");
+ private final String LINK_TAB_PI = getProp(casePfx + "link.tab.pi",
"//a[contains(@id,'admin-subtab-form:portlet-instance-link')]");
+ private final String LINK_PI_MAIN = getProp(casePfx + "link.pi.main",
"//a[contains(@id,'instance-form1:instance-link')]");
+ private final String TABLE_DISPNAMES = getProp(casePfx + "table.dispnames",
"//table[contains(@id,'instance-display-form:locale-datatable')]");
+ private final String LNK_SEC_BUTTON = getProp(casePfx +
"lnk.sec.button","//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''Security'')]");
+ private final String LNK_PREF_BUTTON = getProp(casePfx +
"lnk.pref.button","//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionPreferences'')]");
+ private final String LNK_DEL_BUTTON = getProp(casePfx +
"lnk.del.button","//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionDeleteInstance'')]");
+ private final String LNK_INSTANCE_BUTTON = getProp(casePfx +
"lnk.instance.button",
"//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td[1]/a[1]");
- private static final String TABLE_PREF_KEY =
"//form[contains(@id,'common-edit-pref-form')]/table";
-
- private static final String SUBMIT_PREF_DELETE =
"//input[contains(@id,'common-edit-exisiting-form:row_0')]";
- private static final String LINK_PREF_GUESTNUM =
"//a[contains(@id,'common-edit-pref-form:pref-link-0')]";
- private static final String INPUT_PREF_NEWVAL =
"//input[contains(@id,'common-append-form:new_value')]";
- private static final String SUBMIT_PREF_UPDATE =
"//input[contains(@id,'common-append-form:append-button')]";
- private static final String SUBMIT_PREF_SAVE =
"//input[contains(@id,':save')]";
- private static final String INPUT_PREF_UPDATE =
"//input[contains(@id,'common-edit-exisiting-form:update')]";
- private static final String INPUT_PREF_APPEND =
"//input[contains(@id,'common-edit-exisiting-form:pref-input-0')]";
- private static final String SUBMIT_PREF_CANCEL =
"//input[contains(@id,':cancel')]";
- private static final String LINK_CURUSER_PREFERENCES =
"//a[contains(@id,'instances-form:preference-CurrentUsersPortletInstance')]";
- private static final String LINK_DEL_EXCEPTPORT =
"//a[contains(@id,'instances-form:delete-GoogleMapPortletInstance')]";
- private static final String SUBMIT_PI_DELETE_CONF =
"//input[contains(@id,'confirm-delete-form1:delete')]";
- private static final String SUBMIT_PI_DELETE_CANC =
"//input[contains(@id,'confirm-delete-form1:cancel')]";
- private static final String T_LINK_DELETENAME =
"//a[contains(@id,''instance-display-form:locale-datatable:{0}:delete-link'')]";
- private static final String T_LINK_MODIFYNAME =
"//a[contains(@id,''instance-display-form:locale-datatable:{0}:edit-link'')]";
- private static final String LINK_COUNTPORT =
"//a[contains(@id,'instances-form:CurrentUsersPortletInstance')]";
- private static final String NAME_COUNTPORT = "CurrentUsersPortletInstance";
- private static final String SUBMIT_MODIFY_NAME =
"//input[contains(@id,'add-display-name-form:addDisplay')]";
- private static final String INPUT_NAME =
"//input[contains(@id,'add-display-name-form:newName')]";
- private static final String SELECT_LANGUAGE =
"//select[contains(@id,'add-display-name-form:locales')]";
- private static final String LINK_ADMIN = "link=Admin";
- private static final String LINK_TAB_PI =
"//a[contains(@id,'admin-subtab-form:portlet-instance-link')]";
- private static final String LINK_PI_MAIN =
"//a[contains(@id,'instance-form1:instance-link')]";
- private static final String TABLE_DISPNAMES =
"//table[contains(@id,'instance-display-form:locale-datatable')]";
- private static final String LNK_SEC_BUTTON =
"//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''Security'')]";
- private static final String LNK_PREF_BUTTON =
"//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionPreferences'')]";
- private static final String LNK_DEL_BUTTON =
"//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionDeleteInstance'')]";
- private static final String LNK_INSTANCE_BUTTON =
"//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td[1]/a[1]";
-
- // private static final String LNK_PREF_WELCOMEPORT =
+ // private final String LNK_PREF_WELCOMEPORT =
// "//a[contains(@id,'security-JSPPortletInstance')]";
@BeforeMethod(groups = { "log" })
@@ -65,11 +64,11 @@
@Test(enabled = true)
public void testAddName() {
- int r = traversePortlets(NAME_COUNTPORT,0);
+ int r = traversePortlets(NAME_COUNTPORT, 0);
clickAndWait(MessageFormat.format(LNK_INSTANCE_BUTTON, r));
-
+
safeSelect(SELECT_LANGUAGE, "English");
-
+
final String name = "Administracning";
selenium.type(INPUT_NAME, name);
clickAndWait(SUBMIT_MODIFY_NAME);
@@ -79,8 +78,8 @@
@Test(enabled = true)
public void testDeleteName() {
// adding the name
- int r = traversePortlets(NAME_COUNTPORT,0);
- clickAndWait(MessageFormat.format(LNK_INSTANCE_BUTTON, r));
+ int r = traversePortlets(NAME_COUNTPORT, 0);
+ clickAndWait(MessageFormat.format(LNK_INSTANCE_BUTTON, r));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select(SELECT_LANGUAGE, "label=Japanese");
@@ -101,9 +100,9 @@
@Test(enabled = true)
public void testModifyName() {
- int r = traversePortlets(NAME_COUNTPORT,0);
+ int r = traversePortlets(NAME_COUNTPORT, 0);
clickAndWait(MessageFormat.format(LNK_INSTANCE_BUTTON, r));
-
+
selenium.select(SELECT_LANGUAGE, "label=Japanese");
final String name = "Adminisimo";
final String nameNew = "Adminiprisimo";
@@ -126,20 +125,18 @@
Assert.assertTrue(findTableRow(TABLE_DISPNAMES, nameNew, 1) >= 0);
}
-
-
@Test(enabled = true)
public void testSecure() {
String instance_name = "JSPPortletInstance";
- //String table = TAB_PORTLET_INSTANCES;
+ // String table = TAB_PORTLET_INSTANCES;
// selenium.click(LINK_20_PAGE);
// selenium.waitForPageToLoad(PAGE_LOAD);
- //int r = findTableRow(table, instance_name, 0);
- int r = traversePortlets(instance_name,0);
+ // int r = findTableRow(table, instance_name, 0);
+ int r = traversePortlets(instance_name, 0);
selenium.click(MessageFormat.format(LNK_SEC_BUTTON, r));
-
+
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("//input[contains(@name,'common-edit-security-form:cars_2')]");
selenium.click("//input[contains(@name,'common-edit-security-form:cars_1')]");
@@ -160,9 +157,9 @@
// selenium.click(LINK_20_PAGE);
// selenium.waitForPageToLoad(PAGE_LOAD);
- //r = findTableRow(table, instance_name, 0);
- r = traversePortlets(instance_name,0);
-
+ // r = findTableRow(table, instance_name, 0);
+ r = traversePortlets(instance_name, 0);
+
selenium.click(MessageFormat.format(LNK_SEC_BUTTON, r));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("//input[contains(@name,'common-edit-security-form:cars_0')]");
@@ -181,8 +178,8 @@
// selenium.setSpeed("5000");
// selenium.click(LINK_20_PAGE);
// selenium.waitForPageToLoad(PAGE_LOAD);
- //r = findTableRow(table, instance_name, 0);
- r = traversePortlets(instance_name,0);
+ // r = findTableRow(table, instance_name, 0);
+ r = traversePortlets(instance_name, 0);
selenium.click(MessageFormat.format(LNK_SEC_BUTTON, r));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("//input[contains(@name,'common-edit-security-form:cars_0')]");
@@ -202,47 +199,65 @@
public void testDeleteInstance() {
// cancel first
String instance_name = "RSS portlet Yahoo finance RHT";
-
- int r = traversePortlets(instance_name,1);
-
- Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON,
r)), instance_name+" portlet not found.");
+ // selenium.setSpeed("5000");
+ int r = traversePortlets(instance_name, 1);
+
+ Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON,
r)), instance_name + " portlet not found.");
clickAndWait(MessageFormat.format(LNK_DEL_BUTTON, r));
-
+
Assert.assertTrue(selenium.isTextPresent("WARNING!"));
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this
portlet instance ?"));
selenium.click(SUBMIT_PI_DELETE_CANC);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// delete
- goToPI();
- r = traversePortlets(instance_name,1);
- Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON,
r)), instance_name+" portlet not found.");
+ goToPI();
+ r = traversePortlets(instance_name, 1);
+ Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON,
r)), instance_name + " portlet not found.");
clickAndWait(MessageFormat.format(LNK_DEL_BUTTON, r));
-
+
Assert.assertTrue(selenium.isTextPresent("WARNING!"));
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this
portlet instance ?"));
selenium.click(SUBMIT_PI_DELETE_CONF);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- r = traversePortlets(instance_name,1);
- Assert.assertFalse(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON,
r)), "previously deleted "+instance_name+" portlet found.");
-
+
+ r = traversePortlets(instance_name, 1);
+ Assert.assertFalse(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON,
r)), "previously deleted " + instance_name + " portlet found.");
+
}
+
+ @Test(enabled = true)
+ public void testPaginator() {
+ int r = countTableRows(TAB_PORTLET_INSTANCES);
+
+ String pages[] = getPages(UL_PAGINATOR);
+ for (String page : pages) {
+ if ("".equals(page.trim()))
+ continue;
+ selenium.click("link=" + page);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ r = countTableRows(TAB_PORTLET_INSTANCES);
+
+ Assert.assertTrue(r>0,"on instances on paginator page");
+ }
+
+ }
+
@Test(enabled = true)
public void testPreferences() {
-
- int r = traversePortlets(NAME_COUNTPORT,0);
- clickAndWait(MessageFormat.format(LNK_PREF_BUTTON, r));
- //selenium.click(LINK_CURUSER_PREFERENCES);
-
+
+ int r = traversePortlets(NAME_COUNTPORT, 0);
+ clickAndWait(MessageFormat.format(LNK_PREF_BUTTON, r));
+ // selenium.click(LINK_CURUSER_PREFERENCES);
+
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUBMIT_PREF_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- r = traversePortlets(NAME_COUNTPORT,0);
- clickAndWait(MessageFormat.format(LNK_PREF_BUTTON, r));
-
+
+ r = traversePortlets(NAME_COUNTPORT, 0);
+ clickAndWait(MessageFormat.format(LNK_PREF_BUTTON, r));
+
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(findTableRow(TABLE_PREF_KEY, "guestNumber", 0) >= 0);
selenium.click(LINK_PREF_GUESTNUM);
@@ -269,8 +284,9 @@
Assert.assertEquals(selenium.getText(TABLE_PREF_KEY + "/tbody/tr[" + r +
"]/td[4]"), "[viliam]");
selenium.click(SUBMIT_PREF_SAVE);
selenium.waitForPageToLoad(PAGE_LOAD);
+
}
-
+
// acquiring link names from paginator
private String[] getPages(String paginator_location) {
@@ -281,32 +297,34 @@
}
/*
- * function for traversing the portles in the portles table. when a string in
- * selected columns is not found, links form paginator are used to look to the next
page
+ * function for traversing the portles in the portles table. when a string
+ * in selected columns is not found, links form paginator are used to look
+ * to the next page
*/
- private int traversePortlets(String instance_name,int row) {
+ private int traversePortlets(String instance_name, int row) {
int r = -1;
-
+
r = findTableRow(TAB_PORTLET_INSTANCES, instance_name, row);
-
+
if (r >= 0)
return r;
-
+
String pages[] = getPages(UL_PAGINATOR);
for (String page : pages) {
if ("".equals(page.trim()))
continue;
selenium.click("link=" + page);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
r = findTableRow(TAB_PORTLET_INSTANCES, instance_name, row);
-
+
if (r >= 0)
break;
}
return r;
}
+
private void goToPI() {
selenium.open(ADDR_PORTAL);
clickIfVisible(LINK_ADMIN);
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/testng.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/testng.xml 2009-03-30
13:02:10 UTC (rev 13102)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/testng.xml 2009-03-31
15:58:16 UTC (rev 13103)
@@ -28,6 +28,36 @@
<class
name="org.jboss.portal.test.selenium.UserInterceptorPortletTestCase"></class></classes>
</test>
+ <test name="org.jboss.portal.test.selenium.DashboardTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class
name="org.jboss.portal.test.selenium.DashboardTestCase"></class></classes>
+ </test>
+
+ <test name="org.jboss.portal.test.selenium.portal.AdminPortalTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class
name="org.jboss.portal.test.selenium.portal.AdminPortalTestCase"></class></classes>
+ </test>
+
+ <test
name="org.jboss.portal.test.selenium.portal.PortletDefinitionsTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class
name="org.jboss.portal.test.selenium.portal.PortletDefinitionsTestCase"></class></classes>
+ </test>
+
+ <test
name="org.jboss.portal.test.selenium.portal.PortletInstancesTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class
name="org.jboss.portal.test.selenium.portal.PortletInstancesTestCase"></class></classes>
+ </test>
+
+ <test
name="org.jboss.portal.test.selenium.portal.PageCoordinationTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class
name="org.jboss.portal.test.selenium.portal.PageCoordinationTestCase"></class></classes>
+ </test>
+
<test name="org.jboss.portal.test.selenium.cms.CMSFileTestCase"
verbose="2" annotations="JDK">
<classes>
@@ -52,30 +82,36 @@
<class
name="org.jboss.portal.test.selenium.cms.CMSFileUploadTestCase"></class></classes>
</test>
- <test name="org.jboss.portal.test.selenium.DashboardTestCase"
+ <test name="org.jboss.portal.test.selenium.CoordinationSamplesTestCase"
verbose="2" annotations="JDK">
<classes>
- <class
name="org.jboss.portal.test.selenium.DashboardTestCase"></class></classes>
+ <class
name="org.jboss.portal.test.selenium.CoordinationSamplesTestCase"></class></classes>
</test>
- <test name="org.jboss.portal.test.selenium.portal.AdminPortalTestCase"
+ <test name="org.jboss.portal.test.selenium.PortalSamplesTestCase"
verbose="2" annotations="JDK">
<classes>
- <class
name="org.jboss.portal.test.selenium.portal.AdminPortalTestCase"></class></classes>
+ <class
name="org.jboss.portal.test.selenium.PortalSamplesTestCase"></class></classes>
</test>
-
- <test
name="org.jboss.portal.test.selenium.portal.PortletDefinitionsTestCase"
+
+ <test name="org.jboss.portal.test.selenium.PortalAjaxSamplesTestCase"
verbose="2" annotations="JDK">
<classes>
- <class
name="org.jboss.portal.test.selenium.portal.PortletDefinitionsTestCase"></class></classes>
+ <class
name="org.jboss.portal.test.selenium.PortalAjaxSamplesTestCase"></class></classes>
</test>
-
- <test
name="org.jboss.portal.test.selenium.portal.PortletInstancesTestCase"
+
+ <test name="org.jboss.portal.test.selenium.EndToEndBeaPortlet"
verbose="2" annotations="JDK">
<classes>
- <class
name="org.jboss.portal.test.selenium.portal.PortletInstancesTestCase"></class></classes>
+ <class
name="org.jboss.portal.test.selenium.EndToEndBeaPortlet"></class></classes>
</test>
+ <test
name="org.jboss.portal.test.selenium.portal.EndtoEndPortalAdminTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class
name="org.jboss.portal.test.selenium.portal.EndtoEndPortalAdminTestCase"></class></classes>
+ </test>
+
<test name="org.jboss.portal.test.selenium.cms.CMSArchiveUploadTestCase"
verbose="2" annotations="JDK">
<classes>