Author: jbalunas(a)redhat.com
Date: 2008-10-29 17:05:06 -0400 (Wed, 29 Oct 2008)
New Revision: 9464
Added:
trunk/src/test/ftest/
trunk/src/test/ftest/build.xml
trunk/src/test/ftest/examples/
trunk/src/test/ftest/examples/booking/
trunk/src/test/ftest/examples/booking/build.xml
trunk/src/test/ftest/examples/booking/src/
trunk/src/test/ftest/examples/booking/src/org/
trunk/src/test/ftest/examples/booking/src/org/jboss/
trunk/src/test/ftest/examples/booking/src/org/jboss/seam/
trunk/src/test/ftest/examples/booking/src/org/jboss/seam/example/
trunk/src/test/ftest/examples/booking/src/org/jboss/seam/example/booking/
trunk/src/test/ftest/examples/booking/src/org/jboss/seam/example/booking/test/
trunk/src/test/ftest/examples/booking/src/org/jboss/seam/example/booking/test/selenium/
trunk/src/test/ftest/examples/booking/src/org/jboss/seam/example/booking/test/selenium/booking.properties
trunk/src/test/ftest/examples/booking/testng.xml
trunk/src/test/ftest/examples/build.xml
trunk/src/test/ftest/examples/dvdstore/
trunk/src/test/ftest/examples/dvdstore/build.xml
trunk/src/test/ftest/examples/dvdstore/src/
trunk/src/test/ftest/examples/dvdstore/src/org/
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/LoginTest.java
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/Person.java
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/RegistrationTest.java
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SearchTest.java
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/ShoppingCartTest.java
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/dvd.properties
trunk/src/test/ftest/examples/dvdstore/testng.xml
trunk/src/test/ftest/examples/groovybooking/
trunk/src/test/ftest/examples/groovybooking/build.xml
trunk/src/test/ftest/examples/groovybooking/src/
trunk/src/test/ftest/examples/groovybooking/src/org/
trunk/src/test/ftest/examples/groovybooking/src/org/jboss/
trunk/src/test/ftest/examples/groovybooking/src/org/jboss/seam/
trunk/src/test/ftest/examples/groovybooking/src/org/jboss/seam/example/
trunk/src/test/ftest/examples/groovybooking/src/org/jboss/seam/example/groovybooking/
trunk/src/test/ftest/examples/groovybooking/src/org/jboss/seam/example/groovybooking/test/
trunk/src/test/ftest/examples/groovybooking/src/org/jboss/seam/example/groovybooking/test/selenium/
trunk/src/test/ftest/examples/groovybooking/src/org/jboss/seam/example/groovybooking/test/selenium/groovybooking.properties
trunk/src/test/ftest/examples/groovybooking/testng.xml
trunk/src/test/ftest/examples/hibernate/
trunk/src/test/ftest/examples/hibernate/build.xml
trunk/src/test/ftest/examples/hibernate/src/
trunk/src/test/ftest/examples/hibernate/src/org/
trunk/src/test/ftest/examples/hibernate/src/org/jboss/
trunk/src/test/ftest/examples/hibernate/src/org/jboss/seam/
trunk/src/test/ftest/examples/hibernate/src/org/jboss/seam/example/
trunk/src/test/ftest/examples/hibernate/src/org/jboss/seam/example/hibernate/
trunk/src/test/ftest/examples/hibernate/src/org/jboss/seam/example/hibernate/test/
trunk/src/test/ftest/examples/hibernate/src/org/jboss/seam/example/hibernate/test/selenium/
trunk/src/test/ftest/examples/hibernate/src/org/jboss/seam/example/hibernate/test/selenium/hibernate.properties
trunk/src/test/ftest/examples/hibernate/testng.xml
trunk/src/test/ftest/examples/icefaces/
trunk/src/test/ftest/examples/icefaces/build.xml
trunk/src/test/ftest/examples/icefaces/src/
trunk/src/test/ftest/examples/icefaces/src/org/
trunk/src/test/ftest/examples/icefaces/src/org/jboss/
trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/
trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/example/
trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/example/icefaces/
trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/example/icefaces/test/
trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/example/icefaces/test/selenium/
trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/example/icefaces/test/selenium/icefaces.properties
trunk/src/test/ftest/examples/icefaces/testng.xml
trunk/src/test/ftest/examples/jpa/
trunk/src/test/ftest/examples/jpa/build.xml
trunk/src/test/ftest/examples/jpa/src/
trunk/src/test/ftest/examples/jpa/src/org/
trunk/src/test/ftest/examples/jpa/src/org/jboss/
trunk/src/test/ftest/examples/jpa/src/org/jboss/seam/
trunk/src/test/ftest/examples/jpa/src/org/jboss/seam/example/
trunk/src/test/ftest/examples/jpa/src/org/jboss/seam/example/jpa/
trunk/src/test/ftest/examples/jpa/src/org/jboss/seam/example/jpa/test/
trunk/src/test/ftest/examples/jpa/src/org/jboss/seam/example/jpa/test/selenium/
trunk/src/test/ftest/examples/jpa/src/org/jboss/seam/example/jpa/test/selenium/jpa.properties
trunk/src/test/ftest/examples/jpa/testng.xml
trunk/src/test/ftest/examples/nestedbooking/
trunk/src/test/ftest/examples/nestedbooking/build.xml
trunk/src/test/ftest/examples/nestedbooking/src/
trunk/src/test/ftest/examples/nestedbooking/src/org/
trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/
trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/
trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/example/
trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/example/nestedbooking/
trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/example/nestedbooking/test/
trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/example/nestedbooking/test/selenium/
trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/example/nestedbooking/test/selenium/nestedbooking.properties
trunk/src/test/ftest/examples/nestedbooking/testng.xml
trunk/src/test/ftest/examples/spring/
trunk/src/test/ftest/examples/spring/build.xml
trunk/src/test/ftest/examples/spring/src/
trunk/src/test/ftest/examples/spring/src/org/
trunk/src/test/ftest/examples/spring/src/org/jboss/
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/SpringChangePasswordTest.java
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/spring.properties
trunk/src/test/ftest/examples/spring/testng.xml
trunk/src/test/ftest/examples/wicket/
trunk/src/test/ftest/examples/wicket/build.xml
trunk/src/test/ftest/examples/wicket/src/
trunk/src/test/ftest/examples/wicket/src/org/
trunk/src/test/ftest/examples/wicket/src/org/jboss/
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/WicketSimpleBookingTest.java
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/wicket.properties
trunk/src/test/ftest/examples/wicket/testng.xml
trunk/src/test/ftest/ftest.properties
trunk/src/test/ftest/lib/
trunk/src/test/ftest/lib/selenium-java-client-driver.jar
trunk/src/test/ftest/lib/selenium-server-standalone.jar
trunk/src/test/ftest/lib/testng-5.8-jdk15.jar
trunk/src/test/ftest/readme.txt
trunk/src/test/ftest/src/
trunk/src/test/ftest/src/main/
trunk/src/test/ftest/src/main/org/
trunk/src/test/ftest/src/main/org/jboss/
trunk/src/test/ftest/src/main/org/jboss/seam/
trunk/src/test/ftest/src/main/org/jboss/seam/example/
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/AjaxTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/BackButtonTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ConversationTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SimpleBookingTest.java
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java
Log:
Initial implementation of the selenium based functional test suite
Added: trunk/src/test/ftest/build.xml
===================================================================
--- trunk/src/test/ftest/build.xml (rev 0)
+++ trunk/src/test/ftest/build.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,150 @@
+<?xml version="1.0"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+
+<!-- core build file for executing and managing Seam functional tests -->
+<project name="ftest.base.build" default="testall"
basedir=".">
+
+ <!-- Location of Seam -->
+ <dirname property="seam.dir"
file="${ant.file.ftest.base.build}/../../../" />
+
+ <!--Import properties -->
+ <property file="ftest.properties" />
+
+ <property name="ftest.dir" value="${seam.dir}/src/test/ftest"
/>
+
+ <!-- TODO : should the libs be in seam/lib and managed with mvn? -->
+ <property name="lib.dir" value="${ftest.dir}/lib" />
+ <property name="log.dir" value="${ftest.dir}/log" />
+
+ <path id="selenium.server.classpath">
+ <fileset dir="${lib.dir}">
+ <include name="selenium-server-standalone.jar" />
+ </fileset>
+ </path>
+
+ <target name="testall">
+ <antcall target="start.selenium.server">
+ </antcall>
+
+ <!-- Execute tests for all examples-->
+ <testexample name="booking" />
+ <testexample name="dvdstore" />
+ <testexample name="groovybooking" />
+ <testexample name="hibernate" />
+ <testexample name="icefaces" />
+ <testexample name="jpa" />
+ <testexample name="nestedbooking" />
+ <testexample name="spring" />
+ <testexample name="wicket" />
+
+ <antcall target="stop.selenium.server">
+ </antcall>
+ </target>
+
+ <target name="cleanall">
+ <cleanexample name="booking" />
+ <cleanexample name="dvdstore" />
+ <cleanexample name="groovybooking" />
+ <cleanexample name="hibernate" />
+ <cleanexample name="icefaces" />
+ <cleanexample name="jpa" />
+ <cleanexample name="nestedbooking" />
+ <cleanexample name="spring" />
+ <cleanexample name="wicket" />
+ </target>
+
+ <target name="undeployall">
+ <undeployexample name="booking" />
+ <undeployexample name="dvdstore" />
+ <undeployexample name="groovybooking" />
+ <undeployexample name="hibernate" />
+ <undeployexample name="icefaces" />
+ <undeployexample name="jpa" />
+ <undeployexample name="nestedbooking" />
+ <undeployexample name="spring" />
+ <undeployexample name="wicket" />
+ </target>
+
+
+ <target name="start.selenium.server">
+ <java classpathref="selenium.server.classpath"
classname="org.openqa.selenium.server.SeleniumServer" fork="true"
spawn="true">
+ <arg line="-port ${selenium.server.port}" />
+ <arg line="${selenium.server.cmd.args}" />
+ </java>
+
+ <waitfor maxwait="30" maxwaitunit="second">
+ <and>
+ <socket server="${selenium.host}"
port="${selenium.server.port}" />
+ <!-- this url will 403, so we say that it should start counting errors at
404 to skip -->
+ <http
url="http://${selenium.host}:${selenium.server.port}/selenium-server/core/index.html"
errorsBeginAt="404" />
+ </and>
+ </waitfor>
+ </target>
+
+ <target name="stop.selenium.server">
+ <get taskname="selenium-shutdown"
src="http://${selenium.host}:${selenium.server.port}/selenium-server/driver/?cmd=shutDown"
dest="${log.dir}/server.shutdown.dest.log" ignoreerrors="true" />
+ <echo taskname="selenium-shutdown" message="DGF Errors during
shutdown are expected" />
+ </target>
+
+
+ <!-- duplicated from ${seam.dir}/build.xml -->
+ <!-- TODO can we avoid duplication -->
+ <macrodef name="testexample">
+ <attribute name="name" />
+ <attribute name="path" default="examples/@{name}" />
+ <attribute name="message" default="Running functional tests on
@{name} example" />
+ <sequential>
+ <echo>@{message}</echo>
+ <callExample path="@{path}" target="test" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="cleanexample">
+ <attribute name="name" />
+ <attribute name="path" default="examples/@{name}" />
+ <attribute name="message" default="Cleaning @{name} example"
/>
+ <sequential>
+ <echo>@{message}</echo>
+ <callExample path="@{path}" target="clean" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="undeployexample">
+ <attribute name="name" />
+ <attribute name="path" default="examples/@{name}" />
+ <attribute name="message" default="Undeploying @{name} example
from JBoss" />
+ <sequential>
+ <echo>@{message}</echo>
+ <callExample path="@{path}"
target="undeploy.example.jboss" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="callExample">
+ <attribute name="path" />
+ <attribute name="target" />
+ <sequential>
+ <ant dir="@{path}" target="@{target}"
inheritall="false" />
+ </sequential>
+ </macrodef>
+</project>
+
Added: trunk/src/test/ftest/examples/booking/build.xml
===================================================================
--- trunk/src/test/ftest/examples/booking/build.xml (rev 0)
+++ trunk/src/test/ftest/examples/booking/build.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<project name="booking.ftest.build" basedir="."
default="build">
+ <property name="example.name" value="booking"/>
+ <property name="jboss.deploy.target" value="deploy"/>
+ <property name="jboss.deploy.waittime" value="10"/>
+ <property name="jboss.undeploy.target" value="undeploy"/>
+ <property name="example.ready.check.url"
value="seam-booking/home.seam"/>
+
+ <import file="../build.xml" />
+</project>
Added:
trunk/src/test/ftest/examples/booking/src/org/jboss/seam/example/booking/test/selenium/booking.properties
===================================================================
---
trunk/src/test/ftest/examples/booking/src/org/jboss/seam/example/booking/test/selenium/booking.properties
(rev 0)
+++
trunk/src/test/ftest/examples/booking/src/org/jboss/seam/example/booking/test/selenium/booking.properties 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,84 @@
+ #
+ # JBoss, Home of Professional Open Source
+ # Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ # by the @authors tag. See the copyright.txt in the distribution for a
+ # full listing of individual contributors.
+ #
+ # This is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU Lesser General Public License as
+ # published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # This software is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this software; if not, write to the Free
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ # 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ #
+HOME_PAGE /seam-booking/home.seam
+MAIN_PAGE /seam-booking/main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE Re-enter new password
+PASSWORD_VALUE_REQUIRED_MESSAGE //span[text() = 'value is required']
+PASSWORD_LENGTH_MESSAGE length must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=searchCriteria:searchString
+SEARCH_SUBMIT id=searchCriteria:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:checkinDateDecorate:message
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:checkoutDateDecorate:message
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=registration:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=registration:usernameDecorate:message
+REGISTRATION_NAME id=registration:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=registration:nameDecorate:message
+REGISTRATION_PASSWORD id=registration:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=registration:passwordDecorate:message
+REGISTRATION_VERIFY id=registration:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=registration:verifyDecorate:message
+REGISTRATION_SUBMIT id=registration:register
+REGISTRATION_REENTER_MESSAGE Re-enter your password
+REGISTRATION_LENGTH_MESSAGE length must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another
request
+BOOKING_TABLE_ITEM
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text())
\= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text())
\= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID
id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT =
xpath=//table[@id='ConversationListForm:ConversationListDataTable']/tbody/tr
+SPINNER id\=searchCriteria\:SpinnerGif
\ No newline at end of file
Property changes on:
trunk/src/test/ftest/examples/booking/src/org/jboss/seam/example/booking/test/selenium/booking.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/booking/testng.xml
===================================================================
--- trunk/src/test/ftest/examples/booking/testng.xml (rev 0)
+++ trunk/src/test/ftest/examples/booking/testng.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,39 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Booking example" verbose="2"
parallel="false">
+ <test name="Booking example">
+ <parameter name="PROPERTY_FILE"
value="/org/jboss/seam/example/booking/test/selenium/booking.properties" />
+ <classes>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.RegistrationTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.ChangePasswordTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.BackButtonTest" />
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.SimpleBookingTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.ConversationTest"
/>
+ </classes>
+ </test>
+</suite>
\ No newline at end of file
Property changes on: trunk/src/test/ftest/examples/booking/testng.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/build.xml
===================================================================
--- trunk/src/test/ftest/examples/build.xml (rev 0)
+++ trunk/src/test/ftest/examples/build.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<project name="ftest.example.common.build" basedir="."
default="build">
+
+ <!-- Location of Seam -->
+ <dirname property="seam.dir"
file="${ant.file.ftest.example.common.build}/../../../../" />
+
+ <!-- default property setup -->
+ <property file="${seam.dir}/src/test/ftest/ftest.properties" />
+
+ <property name="ftest.dir" value="${seam.dir}/src/test/ftest"
/>
+ <property name="src.dir" value="src" />
+ <property name="common.src.dir" value="${ftest.dir}/src/main"
/>
+ <property name="build.dir" value="build" />
+ <property name="classes.dir" value="${build.dir}/classes"
/>
+ <property name="test.output.dir" value="test-output" />
+ <property name="ftest.lib.dir" value="${ftest.dir}/lib" />
+ <property name="log.dir" value="log" />
+ <property name="test.report.dir" value="test-report" />
+
+ <!-- common path setup -->
+
+ <path id="classpath.build">
+ <fileset dir="${ftest.lib.dir}" includes="**/*.jar" />
+ </path>
+
+ <path id="classpath.test">
+ <path refid="classpath.build" />
+ <path location="${classes.dir}" />
+ </path>
+
+ <!-- common target definitions -->
+
+ <target name="clean" description="Delete all generated
files">
+ <delete dir="${build.dir}" />
+ <delete dir="${test.output.dir}" />
+ <delete dir="${report.dir}" />
+ <delete dir="${log.dir}" />
+ </target>
+
+ <target name="build" depends="build.common"
description="Compiles the Test">
+ <javac srcdir="${src.dir}" destdir="${classes.dir}"
classpathref="classpath.build" debug="true"/>
+ <copy todir="${classes.dir}">
+ <fileset dir="src">
+ <exclude name="**/*.java" />
+ </fileset>
+ </copy>
+ </target>
+
+ <!-- TODO we should compile this once to a common place not build for each example
-->
+ <!-- TODO if needed we should allow examples to exclude/include src under
+ common dvd does not care about booking for example-->
+ <target name="build.common" description="Compiles the common
selenium test code">
+ <mkdir dir="${classes.dir}" />
+ <javac srcdir="${common.src.dir}" destdir="${classes.dir}"
classpathref="classpath.build" debug="true"/>
+ <copy todir="${classes.dir}">
+ <fileset dir="src">
+ <exclude name="**/*.java" />
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="test" depends="build" description="Run
Tests">
+
+ <!-- test examples on jboss server -->
+ <antcall target="test.jboss" />
+
+ <!-- add other containers as we add support -->
+
+ </target>
+
+ <target name="selenium.test" depends="build"
description="Run Tests">
+ <taskdef resource="testngtasks"
classpathref="classpath.test" />
+ <mkdir dir="${test.output.dir}" />
+
+ <!-- execute testng tests -->
+ <testng haltonfailure="false" outputdir="${test.output.dir}"
classpathref="classpath.test">
+ <xmlfileset file="testng.xml" />
+ <sysproperty key="selenium.server.port"
value="${selenium.server.port}" />
+ <sysproperty key="selenium.host" value="${selenium.host}"
/>
+ <sysproperty key="selenium.browser"
value="${selenium.browser}" />
+ <sysproperty key="selenium.browser.url"
value="${selenium.browser.url}" />
+ <sysproperty key="selenium.speed"
value="${selenium.speed}" />
+ <sysproperty key="selenium.timeout"
value="${selenium.timeout}" />
+ </testng>
+ </target>
+
+ <target name="test.jboss" depends="build" description="Run
Tests">
+ <!-- TODO all of these jboss commands must be optional with checks -->
+ <!-- TODO go get JBoss and extract -->
+
+ <!-- TODO start JBoss -->
+
+ <!-- deploy the example-->
+ <antcall target="deploy.example.jboss" />
+
+ <!-- execute testng tests -->
+ <antcall target="selenium.test" />
+
+ <!-- undeploy the example -->
+ <antcall target="undeploy.example.jboss" />
+
+ <!-- TODO stop jboss -->
+
+ <!-- TODO remove jboss -->
+ </target>
+
+ <!-- TODO get this to next level too - how to combine into one report -->
+ <target name="testreport" depends="test"
description="generate html report">
+ <mkdir dir="${test.report.dir}" />
+ <junitreport todir="${test.report.dir}">
+ <fileset dir="${test.output.dir}">
+ <include name="**/*.xml" />
+ <exclude name="**/testng-*.xml" />
+ </fileset>
+ <report format="noframes" todir="${test.report.dir}"
/>
+ </junitreport>
+ <echo>Report available at ${report.dir}/junit-noframes.html</echo>
+ </target>
+
+ <target name="deploy.example.jboss">
+ <echo>Deploying JBoss Example - ${example.name}</echo>
+ <ant antfile="${seam.dir}/examples/${example.name}/build.xml"
target="${jboss.deploy.target}" inheritall="false"
dir="${seam.dir}/examples/${example.name}" />
+
+ <!-- wait for the application to be active -->
+ <!-- TODO is there a better way? -->
+ <waitfor maxwait="${jboss.deploy.waittime}"
maxwaitunit="second">
+ <and>
+ <!-- wait for the application to not throw 404 -->
+ <http url="${selenium.browser.url}/${example.ready.check.url}"
errorsBeginAt="404" />
+ </and>
+ </waitfor>
+ </target>
+
+ <target name="undeploy.example.jboss">
+ <echo>Undeploying JBoss Example - ${example.name}</echo>
+ <ant antfile="${seam.dir}/examples/${example.name}/build.xml"
target="${jboss.undeploy.target}" inheritall="false"
dir="${seam.dir}/examples/${example.name}" />
+ </target>
+
+ <target name="deploy.example.tomcat">
+ <echo>Deploying Tomcat Example - ${example.name}</echo>
+ <ant antfile="${seam.dir}/examples/${example.name}/build.xml"
target="${jboss.deploy.target}" inheritall="false"
dir="${seam.dir}/examples/${example.name}" />
+ </target>
+
+ <target name="undeploy.example.tomcat">
+ <echo>Undeploying Tomcat Example - ${example.name}</echo>
+ <ant antfile="${seam.dir}/examples/${example.name}/build.xml"
target="${jboss.undeploy.target}" inheritall="false"
dir="${seam.dir}/examples/${example.name}" />
+ </target>
+
+</project>
Added: trunk/src/test/ftest/examples/dvdstore/build.xml
===================================================================
--- trunk/src/test/ftest/examples/dvdstore/build.xml (rev 0)
+++ trunk/src/test/ftest/examples/dvdstore/build.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<project name="dvdstore.ftest.build" basedir="."
default="build">
+ <property name="example.name" value="dvdstore" />
+ <property name="jboss.deploy.target" value="deploy" />
+ <property name="jboss.undeploy.target" value="undeploy" />
+ <property name="jboss.deploy.waittime" value="20" />
+ <property name="example.ready.check.url"
value="seam-dvd/home.seam"/>
+
+ <import file="../build.xml" />
+
+</project>
Added:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/LoginTest.java
===================================================================
---
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/LoginTest.java
(rev 0)
+++
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/LoginTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.dvd.test.selenium;
+
+import static org.testng.AssertJUnit.*;
+
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * This class tests user authentication. Majority of other tests depends on
+ * these methods.
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class LoginTest extends SeleniumDvdTest {
+
+ @BeforeMethod
+ public void setUp() {
+ startBrowser();
+ }
+
+ @Test(groups = { "login.basic" })
+ public void basicLoginTest() {
+ String username = "user1";
+ String password = "password";
+ assertTrue("Login failed.", login(username, password));
+ }
+
+ @Test(groups = { "login.basic" })
+ public void invalidLoginTest() {
+ String username = "nonExistingUser";
+ String password = "invalidPassword";
+ assertFalse("Logged in despite invalid credentials.", login(username,
+ password));
+ }
+
+ @Test(groups = { "login.admin" })
+ public void adminLoginTest() {
+ String username = "manager";
+ String password = "password";
+ assertTrue("Login failed.", login(username, password));
+ assertTrue("Navigation failed", browser.getLocation().contains(
+ getProperty("ADMIN_URL")));
+ }
+}
Property changes on:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/LoginTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/Person.java
===================================================================
---
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/Person.java
(rev 0)
+++
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/Person.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,213 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.dvd.test.selenium;
+
+/**
+ * This class is used by Registration tests
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class Person {
+
+ private String username;
+ private String password;
+ private String verify;
+ private String firstName;
+ private String lastName;
+ private String address;
+ private String address2;
+ private String city;
+ private String state;
+ private String zip;
+ private String email;
+ private String phone;
+ private String cardType;
+ private String cardNumber;
+
+ public String getCardType() {
+ return cardType;
+ }
+
+ public void setCardType(String cardType) {
+ this.cardType = cardType;
+ }
+
+ public String getCardNumber() {
+ return cardNumber;
+ }
+
+ public void setCardNumber(String cardNumber) {
+ this.cardNumber = cardNumber;
+ }
+
+ public Person() {
+ }
+
+ public Person(String address, String address2, String cardNumber,
+ String cardType, String city, String email, String firstName,
+ String lastName, String password, String phone, String state,
+ String username, String verify, String zip) {
+ this.address = address;
+ this.address2 = address2;
+ this.cardNumber = cardNumber;
+ this.cardType = cardType;
+ this.city = city;
+ this.email = email;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.password = password;
+ this.phone = phone;
+ this.state = state;
+ this.username = username;
+ this.verify = verify;
+ this.zip = zip;
+ }
+
+ public Person(String address, String cardNumber, String cardType,
+ String city, String email, String firstName, String lastName,
+ String password, String phone, String state, String username,
+ String verify, String zip) {
+ this(address, address, cardNumber, cardType, city, email, firstName,
+ lastName, password, phone, state, username, verify, zip);
+ }
+
+ public Person(String address, String address2, String city, String email,
+ String firstName, String lastName, String password, String phone,
+ String state, String username, String verify, String zip) {
+ this(address, address2, "MasterCard", "000-0000-0000", city,
email,
+ firstName, lastName, password, phone, state, username, verify,
+ zip);
+ }
+
+ public Person(String address, String city, String email, String firstName,
+ String lastName, String password, String phone, String state,
+ String username, String verify, String zip) {
+ this(address, address, "MasterCard", "000-0000-0000", city,
email,
+ firstName, lastName, password, phone, state, username, verify,
+ zip);
+ }
+
+ public Person(String username, String password, String verify) {
+ super();
+ this.password = password;
+ this.username = username;
+ this.verify = verify;
+ }
+
+ public String getVerify() {
+ return verify;
+ }
+
+ public void setVerify(String verify) {
+ this.verify = verify;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getAddress2() {
+ return address2;
+ }
+
+ public void setAddress2(String address2) {
+ this.address2 = address2;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getZip() {
+ return zip;
+ }
+
+ public void setZip(String zip) {
+ this.zip = zip;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+}
Property changes on:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/Person.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/RegistrationTest.java
===================================================================
---
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/RegistrationTest.java
(rev 0)
+++
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/RegistrationTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,171 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.dvd.test.selenium;
+
+import static org.testng.AssertJUnit.*;
+
+import java.text.MessageFormat;
+import java.util.Date;
+
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.thoughtworks.selenium.Wait;
+
+/**
+ * This class tests the registration functionality of dvdstore example
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class RegistrationTest extends SeleniumDvdTest {
+
+ // suffix is needed to allow test to be run repeatedly
+ private String suffix = Long.toString(new Date().getTime() % 10000000);
+
+ @BeforeMethod
+ public void setUp() {
+ startBrowser();
+ browser.open(getProperty("HOME_PAGE"));
+ new Wait() {
+ public boolean until() {
+ return browser.isElementPresent(getProperty("REGISTRATION"));
+ }
+ }.wait("Unable to load home page.");
+ browser.click(getProperty("REGISTRATION"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertTrue("Unable to load registration page.", browser.getLocation()
+ .contains(getProperty("REGISTRATION_FIRST_PAGE_URL")));
+ }
+
+ /**
+ * Tries to register user
+ */
+ @Test
+ public void basicRegistrationTest() {
+ Person person = new Person("742 Evergreen Terrace",
"012-3456-7890",
+ "Visa", "Springfield", "homer(a)example.com",
"Homer", "Simpson",
+ "password", "9185551212", "US",
"homer" + suffix, "password",
+ "01234");
+
+ fillFirstPage(person);
+ assertTrue("Unable to load account page.", browser.getLocation()
+ .contains(getProperty("REGISTRATION_SECOND_PAGE_URL")));
+ fillSecondPage(person);
+ assertTrue("Unable to load card page.",
browser.getLocation().contains(
+ getProperty("REGISTRATION_THIRD_PAGE_URL")));
+ fillThirdPage(person);
+ assertTrue("Unable to load confirmation page.", browser.getLocation()
+ .contains(getProperty("REGISTRATION_CONFIRMATION_PAGE_URL")));
+ assertTrue("Registration failed.", browser.isTextPresent(MessageFormat
+ .format(getProperty("REGISTRATION_CONFIRMATION_MESSAGE"),
+ person.getUsername())));
+ assertTrue("User should be logged in after succesful registration.",
+ isLoggedIn(browser));
+ }
+
+ /**
+ * Tests whether validation of input fields works fine.
+ */
+ @Test
+ public void firstPageInvalidValuesTest() {
+ Person person = new Person("t", "t", "t");
+ fillFirstPage(person);
+ assertTrue("Navigation failed.", browser.getLocation().contains(
+ getProperty("REGISTRATION_FIRST_PAGE_URL")));
+ assertEquals("Error messages expected.", 2, browser
+ .getXpathCount(getProperty("REGISTRATION_LENGTH_MESSAGE")));
+ }
+
+ /**
+ * Tests password verification.
+ */
+ @Test
+ public void verifyPasswordTest() {
+ Person person = new Person("tester", "password",
"password1");
+ fillFirstPage(person);
+ assertTrue("Navigation failed.", browser.getLocation().contains(
+ getProperty("REGISTRATION_FIRST_PAGE_URL")));
+ assertTrue("Password verify message expected.", browser
+
.isElementPresent(getProperty("REGISTRATION_VERIFY_MESSAGE")));
+ }
+
+ /**
+ * Tries to register user that already exists. Test assumes that user1 is
+ * already registered.
+ */
+ @Test
+ public void duplicateUserTest() {
+ Person person = new Person("user1", "password",
"password");
+ fillFirstPage(person);
+ assertTrue("Navigation failed.", browser.getLocation().contains(
+ getProperty("REGISTRATION_FIRST_PAGE_URL")));
+ assertTrue(
+ "Duplicate user error message expected.",
+ browser
+
.isElementPresent(getProperty("REGISTRATION_DUPLICATE_USER_MESSAGE")));
+ }
+
+ private void fillFirstPage(Person person) {
+ browser
+ .type(getProperty("REGISTRATION_USERNAME"), person
+ .getUsername());
+ browser
+ .type(getProperty("REGISTRATION_PASSWORD"), person
+ .getPassword());
+ browser.type(getProperty("REGISTRATION_VERIFY"), person.getVerify());
+ browser.click(getProperty("REGISTRATION_FIRST_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+
+ private void fillSecondPage(Person person) {
+ browser.type(getProperty("REGISTRATION_FIRST_NAME"), person
+ .getUsername());
+ browser.type(getProperty("REGISTRATION_LAST_NAME"), person
+ .getLastName());
+ browser.type(getProperty("REGISTRATION_ADDRESS"),
person.getAddress());
+ browser
+ .type(getProperty("REGISTRATION_ADDRESS2"), person
+ .getAddress2());
+ browser.type(getProperty("REGISTRATION_CITY"), person.getCity());
+ browser.type(getProperty("REGISTRATION_STATE"), person.getState());
+ browser.type(getProperty("REGISTRATION_ZIP"), person.getZip());
+ browser.type(getProperty("REGISTRATION_EMAIL"), person.getEmail());
+ browser.type(getProperty("REGISTRATION_PHONE"), person.getPhone());
+ browser.click(getProperty("REGISTRATION_SECOND_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+
+ private void fillThirdPage(Person person) {
+ browser.select(getProperty("REGISTRATION_CARD_TYPE_SELECT"), person
+ .getCardType());
+ browser.type(getProperty("REGISTRATION_CARD_NUMBER"), person
+ .getCardNumber());
+ fillThirdPage();
+ }
+
+ private void fillThirdPage() {
+ browser.click(getProperty("REGISTRATION_THIRD_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+}
Property changes on:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/RegistrationTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SearchTest.java
===================================================================
---
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SearchTest.java
(rev 0)
+++
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SearchTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.dvd.test.selenium;
+
+import static org.testng.AssertJUnit.*;
+
+import org.testng.annotations.Test;
+
+/**
+ * This class tests search functionality of the example
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class SearchTest extends SeleniumDvdTest {
+
+ /**
+ * This test does simple search for dvd.
+ */
+ @Test(groups = { "search" }, dependsOnGroups = { "login.basic"
})
+ public void testSearch() {
+ String searchString = "top gun";
+ browser.click(getProperty("SHOP"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertTrue("Navigation failed.", browser.getLocation().contains(
+ getProperty("SHOP_URL")));
+ browser.type(getProperty("SEARCH_FIELD"), searchString);
+ browser.click(getProperty("SEARCH_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertEquals("Unexpected number of results. One result expected.", 1,
+ browser.getXpathCount(getProperty("SEARCH_RESULT_ITEM")));
+ browser.click(getProperty("SEARCH_RESULT_FIRST_ROW_LINK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertTrue("Navigation failure.", browser.getLocation().contains(
+ getProperty("DVD_URL")));
+ }
+
+ /**
+ * This test does simple search in two windows verifying they do not affect
+ * each other
+ */
+ @Test(dependsOnMethods = { "testSearch" }, dependsOnGroups = {
"login.basic" })
+ public void testMultipleWindowSearch() {
+ String searchString1 = "Forrest Gump";
+ String searchString2 = "The Shawshank Redemption";
+
+ // browser.openWindow(getProperty("HOME_PAGE"), "1");
+ browser.openWindow(getProperty("HOME_PAGE"), "1");
+ browser.selectWindow("1");
+ browser.waitForPageToLoad(TIMEOUT);
+ assertTrue("User should be logged in by now.", isLoggedIn(browser));
+ // if (!isLoggedIn(browser)) {
+ // login(browser, USERNAME, PASSWORD);
+ // }
+ // search for dvd in first window
+ browser.openWindow(getProperty("HOME_PAGE"), "2");
+ browser.selectWindow("2");
+ browser.waitForPageToLoad(TIMEOUT);
+ assertTrue("User should be logged in by now.", isLoggedIn(browser));
+ // if (!isLoggedIn(browser)) {
+ // login(browser, USERNAME, PASSWORD);
+ // }
+ browser.click(getProperty("SHOP"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.type(getProperty("SEARCH_FIELD"), searchString1);
+ browser.click(getProperty("SEARCH_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertEquals("Unexpected search result in first window.",
+ searchString1, browser
+
.getText(getProperty("SEARCH_RESULT_FIRST_ROW_LINK")));
+ // search for dvd in second window
+ browser.selectWindow("1");
+ browser.click(getProperty("SHOP"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.type(getProperty("SEARCH_FIELD"), searchString2);
+ browser.click(getProperty("SEARCH_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertEquals("Unexpected search result in second window.",
+ searchString2, browser
+
.getText(getProperty("SEARCH_RESULT_FIRST_ROW_LINK")));
+ browser.selectWindow("2");
+ browser.refresh();
+ browser.waitForPageToLoad(TIMEOUT);
+ assertEquals("Unexpected search result in first window after
refresh.",
+ searchString1, browser
+
.getText(getProperty("SEARCH_RESULT_FIRST_ROW_LINK")));
+
+ }
+}
Property changes on:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SearchTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java
===================================================================
---
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java
(rev 0)
+++
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.dvd.test.selenium;
+
+import static org.testng.AssertJUnit.fail;
+
+import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+
+import com.thoughtworks.selenium.Selenium;
+import com.thoughtworks.selenium.Wait;
+
+/**
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public abstract class SeleniumDvdTest extends SeamSeleniumTest {
+
+ protected final String DEFAULT_USERNAME = "user1";
+ protected final String DEFAULT_PASSWORD = "password";
+
+ @BeforeMethod
+ public void setUp() {
+ startBrowser();
+ login(DEFAULT_USERNAME, DEFAULT_PASSWORD);
+ }
+
+ public boolean login(String username, String password) {
+ browser.open(getProperty("HOME_PAGE"));
+ new Wait() {
+ public boolean until() {
+ return browser.isElementPresent(getProperty("LOGIN_SUBMIT"));
+ }
+ }.wait("Login page not loaded.");
+ if (isLoggedIn(browser)) {
+ fail("User already logged in.");
+ }
+ browser.type(getProperty("LOGIN_USERNAME"), username);
+ browser.type(getProperty("LOGIN_PASSWORD"), password);
+ browser.click(getProperty("LOGIN_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ return isLoggedIn(browser);
+ }
+
+ @AfterMethod
+ public void tearDown() {
+ logout(browser);
+ stopBrowser(browser);
+ }
+
+ public void logout(Selenium browser) {
+ if (isLoggedIn(browser)) {
+ browser.click(getProperty("LOGOUT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+ }
+
+ public boolean isLoggedIn(Selenium browser) {
+ return browser.isElementPresent(getProperty("LOGOUT"));
+ }
+
+
+}
Property changes on:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/ShoppingCartTest.java
===================================================================
---
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/ShoppingCartTest.java
(rev 0)
+++
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/ShoppingCartTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,147 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.dvd.test.selenium;
+
+import static org.testng.AssertJUnit.*;
+
+import java.math.BigDecimal;
+import java.text.MessageFormat;
+import java.text.NumberFormat;
+import java.text.ParseException;
+import java.util.Currency;
+import java.util.Locale;
+
+import org.testng.annotations.Test;
+
+/**
+ * This class tests shopping cart
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class ShoppingCartTest extends SeleniumDvdTest {
+
+ @Test(dependsOnGroups = { "search" })
+ public void simpleCartTest() {
+ String[] dvds = new String[] { "Top Gun", "Pulp Fiction",
+ "Forrest Gump" };
+ for (String dvd : dvds) {
+ addDVDToCart(dvd);
+ }
+ browser.click(getProperty("CART"));
+ browser.waitForPageToLoad(TIMEOUT);
+ for (String dvd : dvds) {
+ assertTrue("Expected item not present in cart.", browser
+ .isElementPresent(MessageFormat.format(
+ getProperty("CART_TABLE_ROW_BY_NAME"), dvd)));
+ }
+ }
+
+ @Test(dependsOnMethods = { "simpleCartTest" })
+ public void testCartCostCalculation() throws ParseException {
+ String[] dvds = new String[] { "Top Gun", "Pulp Fiction",
"Top Gun" };
+ NumberFormat nf = NumberFormat.getCurrencyInstance();
+ nf.setCurrency(Currency.getInstance(Locale.US));
+ BigDecimal expectedSum = BigDecimal.ZERO;
+ for (String dvd : dvds) {
+ addDVDToCart(dvd);
+ }
+ browser.click(getProperty("CART"));
+ browser.waitForPageToLoad(TIMEOUT);
+ int items = browser.getXpathCount(getProperty("CART_TABLE_ITEM"))
+ .intValue();
+ assertNotSame("Cart should not be empty.", 0, items);
+ for (int i = 0; i < items; i++) {
+ BigDecimal quantity = BigDecimal.valueOf(Double.parseDouble(browser
+ .getValue(MessageFormat.format(
+ getProperty("CART_TABLE_QUANTITY_BY_ID"), i))));
+ BigDecimal price = BigDecimal.valueOf(nf.parse(
+ browser.getText(MessageFormat.format(
+ getProperty("CART_TABLE_PRICE_BY_ID"), i)))
+ .doubleValue());
+ BigDecimal priceForCurrentRow = price.multiply(quantity);
+ expectedSum = expectedSum.add(priceForCurrentRow);
+ }
+ BigDecimal actualSum = BigDecimal.valueOf((nf.parse(browser
+ .getText(getProperty("CART_SUBTOTAL"))).doubleValue()));
+ assertEquals("Price sum in cart is incorrect.", 0, expectedSum
+ .compareTo(actualSum));
+ }
+
+ @Test(dependsOnMethods = { "simpleCartTest" })
+ public void testRemovingCartItem() {
+ String dvd = "Top Gun";
+ addDVDToCart(dvd);
+ browser.click(getProperty("CART"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertTrue("DVD is not in the cart.", browser
+ .isElementPresent(MessageFormat.format(
+ getProperty("CART_TABLE_ROW_BY_NAME"), dvd)));
+ browser.check(MessageFormat.format(
+ getProperty("CART_TABLE_CHECKBOX_BY_NAME"), dvd));
+ browser.click(getProperty("CART_TABLE_UPDATE_BUTTON"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertFalse("Cart item was not removed.", browser
+ .isElementPresent(MessageFormat.format(
+ getProperty("CART_TABLE_ROW_BY_NAME"), dvd)));
+ }
+
+ /**
+ * This method tries purchasing more copies of The Bourne Identity than are
+ * available in stock
+ */
+ @Test(dependsOnMethods = { "simpleCartTest" })
+ public void testExceedingAvailableItemLimit() {
+ String dvd = "The Bourne Identity";
+ String amount = "300";
+ addDVDToCart(dvd);
+ browser.click(getProperty("CART"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.type(getProperty("CART_TABLE_FIRST_ROW_QUANTITY"), amount);
+ browser.click(getProperty("CART_TABLE_UPDATE_BUTTON"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.click(getProperty("CART_PURCHASE_BUTTON"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.click(getProperty("CART_CONFIRM_BUTTON"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertTrue("Message not displayed.", browser
+ .isElementPresent(MessageFormat.format(
+ getProperty("CART_NOT_ENOUGH_COPIES_LEFT"), dvd)));
+ assertTrue(
+ "Order should not be completed.",
+ browser
+
.isElementPresent(getProperty("CART_UNABLE_TO_COMPLETE_ORDER_MESSAGE")));
+ }
+
+ private void addDVDToCart(String dvdName) {
+ assertTrue("User should be logged in.", isLoggedIn(browser));
+ browser.click(getProperty("SHOP"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.type(getProperty("SEARCH_FIELD"), dvdName);
+ browser.click(getProperty("SEARCH_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.check(getProperty("SEARCH_RESULT_FIRST_ROW_CHECKBOX"));
+ browser.click(getProperty("SEARCH_RESULT_UPDATE_BUTTON"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+}
Property changes on:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/ShoppingCartTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/dvd.properties
===================================================================
---
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/dvd.properties
(rev 0)
+++
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/dvd.properties 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,78 @@
+ #
+ # JBoss, Home of Professional Open Source
+ # Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ # by the @authors tag. See the copyright.txt in the distribution for a
+ # full listing of individual contributors.
+ #
+ # This is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU Lesser General Public License as
+ # published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # This software is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this software; if not, write to the Free
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ # 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ #
+HOME_PAGE /seam-dvd/
+HOME_PAGE_TITLE JBoss DVD Store
+LOGOUT id=LogoutForm:Logout
+REGISTRATION id=LoginForm:CreateAccount
+REGISTRATION_FIRST_PAGE_URL newuser/account
+REGISTRATION_SECOND_PAGE_URL newuser/contact
+REGISTRATION_THIRD_PAGE_URL newuser/card
+REGISTRATION_CONFIRMATION_PAGE_URL newuser/complete
+REGISTRATION_USERNAME id=NewAccountForm:userName
+REGISTRATION_USERNAME_MESSAGE id=NewAccountForm:MessageForUserName
+REGISTRATION_PASSWORD id=NewAccountForm:password
+REGISTRATION_PASSWORD_MESSAGE id=NewAccountForm:MessageForPassword
+REGISTRATION_VERIFY id=NewAccountForm:passwordVerify
+REGISTRATION_FIRST_SUBMIT id=NewAccountForm:ContinueButton
+REGISTRATION_SECOND_SUBMIT id=NewAccountForm:ContinueButton
+REGISTRATION_THIRD_SUBMIT id=NewAccountForm:SubmitNewCustomerButton
+REGISTRATION_FIRST_NAME id=NewAccountForm:firstName
+REGISTRATION_LAST_NAME id=NewAccountForm:lastName
+REGISTRATION_ADDRESS id=NewAccountForm:address1
+REGISTRATION_ADDRESS2 = id=NewAccountForm:Address2
+REGISTRATION_CITY id=NewAccountForm:city
+REGISTRATION_STATE id=NewAccountForm:state
+REGISTRATION_ZIP id=NewAccountForm:zip
+REGISTRATION_EMAIL id=NewAccountForm:email
+REGISTRATION_PHONE id=NewAccountForm:phone
+REGISTRATION_CONFIRMATION_MESSAGE Registered new customer {0}
+REGISTRATION_CARD_TYPE_SELECT id=NewAccountForm:CreditCardMenu
+REGISTRATION_CARD_NUMBER id=NewAccountForm:creditCard
+REGISTRATION_LENGTH_MESSAGE xpath=//*[contains(normalize-space(text()), 'length must
be between')]
+REGISTRATION_VERIFY_MESSAGE xpath=//*[normalize-space(text()) =
'passwordVerify']
+REGISTRATION_DUPLICATE_USER_MESSAGE xpath=//*[normalize-space(text()) =
'userName']
+LOGIN_USERNAME id=LoginForm:Username
+LOGIN_PASSWORD id=LoginForm:Password
+LOGIN_SUBMIT id=LoginForm:Login
+SHOP id=Shop
+SHOP_URL seam-dvd/browse
+CART id=Cart
+SEARCH_FIELD id=SearchForm:Query
+SEARCH_SUBMIT id=SearchForm:Search
+SEARCH_RESULT_ITEM
xpath=//table[@id='SearchResultsForm:SearchResultsTable']/tbody/tr
+SEARCH_RESULT_FIRST_ROW_LINK id=SearchResultsForm:SearchResultsTable:0:TitleLink
+SEARCH_RESULT_FIRST_ROW_CHECKBOX
id=SearchResultsForm:SearchResultsTable:0:AddToCartCheckbox
+SEARCH_RESULT_UPDATE_BUTTON id=SearchResultsForm:SearchUpdateButton
+CART_TABLE_ROW_BY_NAME
xpath\=//table[@id\="cartdetails\:CartDetailsForm\:CartItemsTable"]/tbody/tr[normalize-space(td[2]//text())
\= "{0}"]
+CART_TABLE_CHECKBOX_BY_NAME
xpath\=//table[@id\="cartdetails\:CartDetailsForm\:CartItemsTable"]/tbody/tr[normalize-space(td[2]//text())
\= "{0}"]/td[1]/input
+CART_TABLE_UPDATE_BUTTON id=cartdetails:CartDetailsForm:UpdateCartButton
+CART_TABLE_ITEM
xpath=//table[@id='cartdetails:CartDetailsForm:CartItemsTable']/tbody/tr
+CART_TABLE_QUANTITY_BY_ID
id=cartdetails:CartDetailsForm:CartItemsTable:{0}:QuantityValueText
+CART_TABLE_PRICE_BY_ID id=cartdetails:CartDetailsForm:CartItemsTable:{0}:PriceValueText
+CART_TABLE_FIRST_ROW_QUANTITY
id=cartdetails:CartDetailsForm:CartItemsTable:0:QuantityValueText
+CART_PURCHASE_BUTTON id=cartdetails:purchaseaction:PurchaseActionForm:PurchaseButton
+CART_SUBTOTAL id=cartdetails:CartSubtotalValue
+CART_CONFIRM_BUTTON id=orderdetail:ConfirmOrCancelForm:Confirm
+CART_NOT_ENOUGH_COPIES_LEFT xpath\=//*[normalize-space(text()) \= "There were not
enough copies of {0} in stock to fulfill your order."]
+CART_UNABLE_TO_COMPLETE_ORDER_MESSAGE xpath=//*[normalize-space(text()) = 'Your order
could not be completed.']
+DVD_URL seam-dvd/dvd
+ADMIN_URL seam-dvd/admin/admin
\ No newline at end of file
Property changes on:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/dvd.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/dvdstore/testng.xml
===================================================================
--- trunk/src/test/ftest/examples/dvdstore/testng.xml (rev 0)
+++ trunk/src/test/ftest/examples/dvdstore/testng.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,38 @@
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="DVD example" verbose="2"
parallel="false">
+ <test name="DVD example">
+ <parameter name="PROPERTY_FILE"
+ value="/org/jboss/seam/example/dvd/test/selenium/dvd.properties"
/>
+ <classes>
+ <class
+ name="org.jboss.seam.example.dvd.test.selenium.LoginTest" />
+ <class
+ name="org.jboss.seam.example.dvd.test.selenium.RegistrationTest"
/>
+ <class
+ name="org.jboss.seam.example.dvd.test.selenium.SearchTest" />
+ <class
+ name="org.jboss.seam.example.dvd.test.selenium.ShoppingCartTest"
/>
+ </classes>
+ </test>
+</suite>
\ No newline at end of file
Property changes on: trunk/src/test/ftest/examples/dvdstore/testng.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/groovybooking/build.xml
===================================================================
--- trunk/src/test/ftest/examples/groovybooking/build.xml (rev 0)
+++ trunk/src/test/ftest/examples/groovybooking/build.xml 2008-10-29 21:05:06 UTC (rev
9464)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<project name="groovybooking.ftest.build" basedir="."
default="build">
+ <property name="example.name" value="groovybooking" />
+ <property name="jboss.deploy.target" value="jbosswar.deploy"
/>
+ <property name="jboss.deploy.waittime" value="10" />
+ <property name="jboss.undeploy.target" value="undeploy" />
+ <property name="example.ready.check.url"
value="jboss-seam-groovy/home.seam" />
+
+ <import file="../build.xml" />
+
+ <target name="undeploy.example.jboss">
+ <echo>Undeploying JBoss Example - ${example.name}</echo>
+ <ant antfile="${seam.dir}/examples/${example.name}/build.xml"
target="jbosswar.undeploy" inheritall="false"
dir="${seam.dir}/examples/${example.name}" />
+ <ant antfile="${seam.dir}/examples/${example.name}/build.xml"
target="${jboss.undeploy.target}" inheritall="false"
dir="${seam.dir}/examples/${example.name}" />
+ </target>
+
+</project>
Added:
trunk/src/test/ftest/examples/groovybooking/src/org/jboss/seam/example/groovybooking/test/selenium/groovybooking.properties
===================================================================
---
trunk/src/test/ftest/examples/groovybooking/src/org/jboss/seam/example/groovybooking/test/selenium/groovybooking.properties
(rev 0)
+++
trunk/src/test/ftest/examples/groovybooking/src/org/jboss/seam/example/groovybooking/test/selenium/groovybooking.properties 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,84 @@
+ #
+ # JBoss, Home of Professional Open Source
+ # Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ # by the @authors tag. See the copyright.txt in the distribution for a
+ # full listing of individual contributors.
+ #
+ # This is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU Lesser General Public License as
+ # published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # This software is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this software; if not, write to the Free
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ # 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ #
+HOME_PAGE /jboss-seam-groovy/home.seam
+MAIN_PAGE /jboss-seam-groovy/main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE verify
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//*[@id='setpassword:Message']
+PASSWORD_LENGTH_MESSAGE length must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=main:searchString
+SEARCH_SUBMIT id=main:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:Message
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:Message
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='main:messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=register:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=register:usernameDecorate:message
+REGISTRATION_NAME id=register:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=register:nameDecorate:message
+REGISTRATION_PASSWORD id=register:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=register:passwordDecorate:message
+REGISTRATION_VERIFY id=register:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=register:verifyDecorate:message
+REGISTRATION_SUBMIT id=register:register
+REGISTRATION_REENTER_MESSAGE verify
+REGISTRATION_LENGTH_MESSAGE length must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another
request
+BOOKING_TABLE_ITEM
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text())
\= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text())
\= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID
id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT =
xpath=//table[@id='ConversationListForm:ConversationListDataTable']/tbody/tr
+SPINNER id\=main\:Spinner
\ No newline at end of file
Property changes on:
trunk/src/test/ftest/examples/groovybooking/src/org/jboss/seam/example/groovybooking/test/selenium/groovybooking.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/groovybooking/testng.xml
===================================================================
--- trunk/src/test/ftest/examples/groovybooking/testng.xml (rev
0)
+++ trunk/src/test/ftest/examples/groovybooking/testng.xml 2008-10-29 21:05:06 UTC (rev
9464)
@@ -0,0 +1,40 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Groovybooking example" verbose="2"
parallel="false">
+ <test name="GroovyBooking example">
+ <parameter name="PROPERTY_FILE"
+
value="/org/jboss/seam/example/groovybooking/test/selenium/groovybooking.properties"
/>
+ <classes>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.RegistrationTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.ChangePasswordTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.BackButtonTest" />
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.SimpleBookingTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.ConversationTest"
/>
+ </classes>
+ </test>
+</suite>
\ No newline at end of file
Property changes on: trunk/src/test/ftest/examples/groovybooking/testng.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/hibernate/build.xml
===================================================================
--- trunk/src/test/ftest/examples/hibernate/build.xml (rev 0)
+++ trunk/src/test/ftest/examples/hibernate/build.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<project name="hibernate.ftest.build" basedir="."
default="build">
+ <property name="example.name" value="hibernate"/>
+ <property name="jboss.deploy.target" value="jboss"/>
+ <property name="jboss.deploy.waittime" value="10"/>
+ <property name="jboss.undeploy.target"
value="jboss.undeploy"/>
+ <property name="example.ready.check.url"
value="jboss-seam-hibernate/home.seam"/>
+
+ <import file="../build.xml" />
+</project>
Added:
trunk/src/test/ftest/examples/hibernate/src/org/jboss/seam/example/hibernate/test/selenium/hibernate.properties
===================================================================
---
trunk/src/test/ftest/examples/hibernate/src/org/jboss/seam/example/hibernate/test/selenium/hibernate.properties
(rev 0)
+++
trunk/src/test/ftest/examples/hibernate/src/org/jboss/seam/example/hibernate/test/selenium/hibernate.properties 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,84 @@
+ #
+ # JBoss, Home of Professional Open Source
+ # Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ # by the @authors tag. See the copyright.txt in the distribution for a
+ # full listing of individual contributors.
+ #
+ # This is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU Lesser General Public License as
+ # published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # This software is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this software; if not, write to the Free
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ # 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ #
+HOME_PAGE /jboss-seam-hibernate/home.seam
+MAIN_PAGE /jboss-seam-hibernate/main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE verify
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//*[@id='setpassword:Message']
+PASSWORD_LENGTH_MESSAGE length must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=main:searchString
+SEARCH_SUBMIT id=main:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:Message
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:Message
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='main:messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=register:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=register:usernameDecorate:message
+REGISTRATION_NAME id=register:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=register:nameDecorate:message
+REGISTRATION_PASSWORD id=register:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=register:passwordDecorate:message
+REGISTRATION_VERIFY id=register:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=register:verifyDecorate:message
+REGISTRATION_SUBMIT id=register:register
+REGISTRATION_REENTER_MESSAGE verify
+REGISTRATION_LENGTH_MESSAGE length must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another
request
+BOOKING_TABLE_ITEM
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text())
\= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text())
\= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID
id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT =
xpath=//table[@id='ConversationListForm:ConversationListDataTable']/tbody/tr
+SPINNER id\=main\:Spinner
\ No newline at end of file
Property changes on:
trunk/src/test/ftest/examples/hibernate/src/org/jboss/seam/example/hibernate/test/selenium/hibernate.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/hibernate/testng.xml
===================================================================
--- trunk/src/test/ftest/examples/hibernate/testng.xml (rev 0)
+++ trunk/src/test/ftest/examples/hibernate/testng.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,40 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Hibernate example" verbose="2"
parallel="false">
+ <test name="Hibernate example">
+ <parameter name="PROPERTY_FILE"
+
value="/org/jboss/seam/example/hibernate/test/selenium/hibernate.properties"
/>
+ <classes>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.RegistrationTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.ChangePasswordTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.BackButtonTest" />
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.SimpleBookingTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.ConversationTest"
/>
+ </classes>
+ </test>
+</suite>
\ No newline at end of file
Property changes on: trunk/src/test/ftest/examples/hibernate/testng.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/icefaces/build.xml
===================================================================
--- trunk/src/test/ftest/examples/icefaces/build.xml (rev 0)
+++ trunk/src/test/ftest/examples/icefaces/build.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<project name="icefaces.ftest.build" basedir="."
default="build">
+ <property name="example.name" value="icefaces"/>
+ <property name="jboss.deploy.target" value="deploy"/>
+ <property name="jboss.deploy.waittime" value="10"/>
+ <property name="jboss.undeploy.target" value="undeploy"/>
+ <property name="example.ready.check.url"
value="seam-icefaces/home.seam"/>
+
+ <import file="../build.xml" />
+</project>
Added:
trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/example/icefaces/test/selenium/icefaces.properties
===================================================================
---
trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/example/icefaces/test/selenium/icefaces.properties
(rev 0)
+++
trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/example/icefaces/test/selenium/icefaces.properties 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,84 @@
+ #
+ # JBoss, Home of Professional Open Source
+ # Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ # by the @authors tag. See the copyright.txt in the distribution for a
+ # full listing of individual contributors.
+ #
+ # This is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU Lesser General Public License as
+ # published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # This software is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this software; if not, write to the Free
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ # 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ #
+HOME_PAGE /seam-icefaces/home.seam
+MAIN_PAGE /seam-icefaces/main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE verify
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//*[@id='setpassword:Message']
+PASSWORD_LENGTH_MESSAGE length must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=searchCriteria:searchString
+SEARCH_SUBMIT id=searchCriteria:findHotels
+NO_HOTELS_FOUND id=searchResults:NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'searchResults:hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=searchResults:hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDate_calendarInputtext
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:Message
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDate_calendarInputtext
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:Message
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:_1
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:_2
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=registration:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=registration:usernameDecorate:message
+REGISTRATION_NAME id=registration:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=registration:nameDecorate:message
+REGISTRATION_PASSWORD id=registration:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=registration:passwordDecorate:message
+REGISTRATION_VERIFY id=registration:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=registration:verifyDecorate:message
+REGISTRATION_SUBMIT id=registration:register
+REGISTRATION_REENTER_MESSAGE verify
+REGISTRATION_LENGTH_MESSAGE length must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another
request
+BOOKING_TABLE_ITEM
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/span/text())
\= "{0}"][normalize-space(td[1]/span/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/span/text())
\= "{0}"][normalize-space(td[1]/span/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID
id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT =
xpath=//table[@id='ConversationListForm:ConversationListDataTable']/tbody/tr
+SPINNER id\=searchCriteria\:Spinner\:connection-working
\ No newline at end of file
Property changes on:
trunk/src/test/ftest/examples/icefaces/src/org/jboss/seam/example/icefaces/test/selenium/icefaces.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/icefaces/testng.xml
===================================================================
--- trunk/src/test/ftest/examples/icefaces/testng.xml (rev 0)
+++ trunk/src/test/ftest/examples/icefaces/testng.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,42 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Icefaces example" verbose="2"
parallel="false">
+ <test name="Icefaces example">
+ <parameter name="PROPERTY_FILE"
value="/org/jboss/seam/example/icefaces/test/selenium/icefaces.properties"
/>
+ <classes>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.RegistrationTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.ChangePasswordTest"
/>
+ <class
name="org.jboss.seam.example.common.test.booking.selenium.BackButtonTest">
+ <methods>
+ <include
name="backbuttoningAfterLogoutTest"></include>
+ </methods>
+ </class>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.SimpleBookingTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.ConversationTest"
/>
+ </classes>
+ </test>
+</suite>
\ No newline at end of file
Property changes on: trunk/src/test/ftest/examples/icefaces/testng.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/jpa/build.xml
===================================================================
--- trunk/src/test/ftest/examples/jpa/build.xml (rev 0)
+++ trunk/src/test/ftest/examples/jpa/build.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<project name="jpa.ftest.build" basedir="."
default="build">
+ <property name="example.name" value="jpa"/>
+ <property name="jboss.deploy.target" value="jboss"/>
+ <property name="jboss.deploy.waittime" value="10"/>
+ <property name="jboss.undeploy.target"
value="jboss.undeploy"/>
+ <property name="example.ready.check.url"
value="jboss-seam-jpa/home.seam"/>
+
+ <import file="../build.xml" />
+</project>
Added:
trunk/src/test/ftest/examples/jpa/src/org/jboss/seam/example/jpa/test/selenium/jpa.properties
===================================================================
---
trunk/src/test/ftest/examples/jpa/src/org/jboss/seam/example/jpa/test/selenium/jpa.properties
(rev 0)
+++
trunk/src/test/ftest/examples/jpa/src/org/jboss/seam/example/jpa/test/selenium/jpa.properties 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,84 @@
+ #
+ # JBoss, Home of Professional Open Source
+ # Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ # by the @authors tag. See the copyright.txt in the distribution for a
+ # full listing of individual contributors.
+ #
+ # This is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU Lesser General Public License as
+ # published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # This software is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this software; if not, write to the Free
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ # 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ #
+HOME_PAGE /jboss-seam-jpa/home.seam
+MAIN_PAGE /jboss-seam-jpa/main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE verify
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//*[@id='setpassword:Message']
+PASSWORD_LENGTH_MESSAGE length must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=main:searchString
+SEARCH_SUBMIT id=main:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:Message
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:Message
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='main:messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=register:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=register:usernameDecorate:message
+REGISTRATION_NAME id=register:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=register:nameDecorate:message
+REGISTRATION_PASSWORD id=register:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=register:passwordDecorate:message
+REGISTRATION_VERIFY id=register:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=register:verifyDecorate:message
+REGISTRATION_SUBMIT id=register:register
+REGISTRATION_REENTER_MESSAGE verify
+REGISTRATION_LENGTH_MESSAGE length must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another
request
+BOOKING_TABLE_ITEM
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text())
\= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text())
\= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID
id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT =
xpath=//table[@id='ConversationListForm:ConversationListDataTable']/tbody/tr
+SPINNER id\=main\:SpinnerGif
\ No newline at end of file
Property changes on:
trunk/src/test/ftest/examples/jpa/src/org/jboss/seam/example/jpa/test/selenium/jpa.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/jpa/testng.xml
===================================================================
--- trunk/src/test/ftest/examples/jpa/testng.xml (rev 0)
+++ trunk/src/test/ftest/examples/jpa/testng.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,39 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="JPA example" verbose="2"
parallel="false">
+ <test name="JPA example">
+ <parameter name="PROPERTY_FILE"
value="/org/jboss/seam/example/jpa/test/selenium/jpa.properties" />
+ <classes>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.RegistrationTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.ChangePasswordTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.BackButtonTest" />
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.SimpleBookingTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.ConversationTest"
/>
+ </classes>
+ </test>
+</suite>
\ No newline at end of file
Property changes on: trunk/src/test/ftest/examples/jpa/testng.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/nestedbooking/build.xml
===================================================================
--- trunk/src/test/ftest/examples/nestedbooking/build.xml (rev 0)
+++ trunk/src/test/ftest/examples/nestedbooking/build.xml 2008-10-29 21:05:06 UTC (rev
9464)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<project name="nestedbooking.ftest.build" basedir="."
default="build">
+ <property name="example.name" value="nestedbooking"/>
+ <property name="jboss.deploy.target" value="deploy"/>
+ <property name="jboss.deploy.waittime" value="10"/>
+ <property name="jboss.undeploy.target" value="undeploy"/>
+ <property name="example.ready.check.url"
value="seam-nested-booking/home.seam"/>
+
+ <import file="../build.xml" />
+</project>
Added:
trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/example/nestedbooking/test/selenium/nestedbooking.properties
===================================================================
---
trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/example/nestedbooking/test/selenium/nestedbooking.properties
(rev 0)
+++
trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/example/nestedbooking/test/selenium/nestedbooking.properties 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,83 @@
+ #
+ # JBoss, Home of Professional Open Source
+ # Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ # by the @authors tag. See the copyright.txt in the distribution for a
+ # full listing of individual contributors.
+ #
+ # This is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU Lesser General Public License as
+ # published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # This software is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this software; if not, write to the Free
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ # 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ #
+HOME_PAGE /seam-nested-booking/home.seam
+MAIN_PAGE /seam-nested-booking/main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE Re-enter new password
+PASSWORD_VALUE_REQUIRED_MESSAGE //*[@id='setpassword:PasswordDecorate:message' or
@id='setpassword:VerifyDecorate:message']
+PASSWORD_LENGTH_MESSAGE length must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=main:searchString
+SEARCH_SUBMIT id=main:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:checkinDateDecorate:message
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:checkoutDateDecorate:message
+HOTEL_SMOKING id=booking:smokingDecorate:smoking:
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=register:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=register:usernameDecorate:message
+REGISTRATION_NAME id=register:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=register:nameDecorate:message
+REGISTRATION_PASSWORD id=register:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=register:passwordDecorate:message
+REGISTRATION_VERIFY id=register:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=register:verifyDecorate:message
+REGISTRATION_SUBMIT id=register:register
+REGISTRATION_REENTER_MESSAGE Re-enter your password
+REGISTRATION_LENGTH_MESSAGE length must be between
+REGISTRATION_SUCCESSFUL_MESSAGE
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another
request
+BOOKING_TABLE_ITEM
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text())
\= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text())
\= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID
id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT =
xpath=//table[@id='ConversationListForm:ConversationListDataTable']/tbody/tr
+SPINNER id\=main\:SpinnerGif
\ No newline at end of file
Property changes on:
trunk/src/test/ftest/examples/nestedbooking/src/org/jboss/seam/example/nestedbooking/test/selenium/nestedbooking.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/nestedbooking/testng.xml
===================================================================
--- trunk/src/test/ftest/examples/nestedbooking/testng.xml (rev
0)
+++ trunk/src/test/ftest/examples/nestedbooking/testng.xml 2008-10-29 21:05:06 UTC (rev
9464)
@@ -0,0 +1,34 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Nested booking example" verbose="2"
parallel="false">
+ <test name="Nested booking example">
+ <parameter name="PROPERTY_FILE"
value="/org/jboss/seam/example/nestedbooking/test/selenium/nestedbooking.properties"
/>
+ <classes>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.RegistrationTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.ChangePasswordTest"
/>
+ <class
name="org.jboss.seam.example.common.test.booking.selenium.BackButtonTest" />
+ </classes>
+ </test>
+</suite>
\ No newline at end of file
Property changes on: trunk/src/test/ftest/examples/nestedbooking/testng.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/spring/build.xml
===================================================================
--- trunk/src/test/ftest/examples/spring/build.xml (rev 0)
+++ trunk/src/test/ftest/examples/spring/build.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<project name="spring.ftest.build" basedir="."
default="build">
+ <property name="example.name" value="spring"/>
+ <property name="jboss.deploy.target" value="jbosswar"/>
+ <property name="jboss.deploy.waittime" value="10"/>
+ <property name="jboss.undeploy.target"
value="jbosswar.undeploy"/>
+ <property name="example.ready.check.url"
value="jboss-seam-spring/home.seam"/>
+
+ <import file="../build.xml" />
+</project>
Added:
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/SpringChangePasswordTest.java
===================================================================
---
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/SpringChangePasswordTest.java
(rev 0)
+++
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/SpringChangePasswordTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.spring.test.selenium;
+
+import org.jboss.seam.example.common.test.booking.selenium.SeleniumBookingTest;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import static org.testng.AssertJUnit.*;
+
+/**
+ * This class tests change password funcionality.
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class SpringChangePasswordTest extends SeleniumBookingTest {
+
+ private final static String LONG_TEXT = "testertestertest";
+ private final static String SHORT_TEXT = "tt";
+ // overriding default values
+ private final String USERNAME = "gavin";
+ private final String PASSWORD = "foobar";
+
+ @BeforeMethod
+ public void setUp() {
+ startBrowser();
+ assertTrue("Login failed.", login(USERNAME, PASSWORD));
+ }
+
+ /**
+ * Verifies that changing password works well. If clean-up part of this
+ * method fails it may affect other methods.
+ */
+ @Test
+ public void changePasswordTest() {
+ String newPassword = "password";
+ changePassword(newPassword, PASSWORD);
+ assertTrue("Password change failed.", browser
+ .isTextPresent(getProperty("PASSWORD_UPDATED_MESSAGE")));
+ logout();
+ assertTrue("Login failed.", login(USERNAME, newPassword));
+ // cleanup - set default password
+ changePassword(PASSWORD, newPassword);
+ assertTrue("Password change failed.", browser
+ .isTextPresent(getProperty("PASSWORD_UPDATED_MESSAGE")));
+ logout();
+ assertTrue("Login failed.", login(USERNAME, PASSWORD));
+ }
+
+ @Test
+ public void usingIncorrectOldPasswordTest() {
+ changePassword("password", "foobar1");
+ assertTrue("Password verification failed", browser
+ .isTextPresent(getProperty("PASSWORD_REENTER_MESSAGE")));
+ }
+
+ @Test
+ public void usingEmptyPasswordsTest() {
+ changePassword("", "");
+ assertEquals("Password verification failed", 2, browser
+
.getXpathCount(getProperty("PASSWORD_VALUE_REQUIRED_MESSAGE")));
+ }
+
+ @Test
+ public void usingLongPasswordTest() {
+ changePassword(LONG_TEXT, LONG_TEXT);
+ assertTrue("Password verification failed", browser
+ .isTextPresent(getProperty("PASSWORD_LENGTH_MESSAGE")));
+ }
+
+ @Test
+ public void usingShortPasswordTest() {
+ changePassword(SHORT_TEXT, SHORT_TEXT);
+ assertTrue("Password verification failed", browser
+ .isTextPresent(getProperty("PASSWORD_LENGTH_MESSAGE")));
+ }
+
+ public void changePassword(String newPassword, String oldpassword) {
+ browser.click(getProperty("SETTINGS"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.type(getProperty("PASSWORD_PASSWORD"), newPassword);
+ browser.type(getProperty("PASSWORD_VERIFY"), oldpassword);
+ browser.click(getProperty("PASSWORD_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+}
Added:
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/spring.properties
===================================================================
---
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/spring.properties
(rev 0)
+++
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/spring.properties 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,86 @@
+ #
+ # JBoss, Home of Professional Open Source
+ # Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ # by the @authors tag. See the copyright.txt in the distribution for a
+ # full listing of individual contributors.
+ #
+ # This is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU Lesser General Public License as
+ # published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # This software is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this software; if not, write to the Free
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ # 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ #
+HOME_PAGE /jboss-seam-spring/home.seam
+MAIN_PAGE /jboss-seam-spring/main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE Re-enter new password
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//*[@id='setpassword:Message']
+PASSWORD_LENGTH_MESSAGE length must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=main:searchString
+SEARCH_SUBMIT id=main:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:Messages
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:Messages
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='main:messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=register:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=register:usernameDecorate:message
+REGISTRATION_NAME id=register:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=register:nameDecorate:message
+REGISTRATION_PASSWORD id=register:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=register:passwordDecorate:message
+REGISTRATION_VERIFY id=register:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=register:verifyDecorate:message
+REGISTRATION_SUBMIT id=register:register
+REGISTRATION_REENTER_MESSAGE verify
+REGISTRATION_LENGTH_MESSAGE length must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another
request
+BOOKING_TABLE_ITEM
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text())
\= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK
xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text())
\= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID
id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT =
xpath=//table[@id='ConversationListForm:ConversationListDataTable']/tbody/tr
+SPINNER id=main:Spinner
+# ajax not present in spring example - false required
+USE_AJAX_SEARCH FALSE
Property changes on:
trunk/src/test/ftest/examples/spring/src/org/jboss/seam/example/spring/test/selenium/spring.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/spring/testng.xml
===================================================================
--- trunk/src/test/ftest/examples/spring/testng.xml (rev 0)
+++ trunk/src/test/ftest/examples/spring/testng.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,38 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Spring example" verbose="2"
parallel="false">
+ <test name="Spring example">
+ <parameter name="PROPERTY_FILE"
value="/org/jboss/seam/example/spring/test/selenium/spring.properties" />
+ <classes>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.RegistrationTest"
/>
+ <class
+
name="org.jboss.seam.example.spring.test.selenium.SpringChangePasswordTest"
/>
+ <class
name="org.jboss.seam.example.common.test.booking.selenium.BackButtonTest" />
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.SimpleBookingTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.ConversationTest"
/>
+ </classes>
+ </test>
+</suite>
\ No newline at end of file
Property changes on: trunk/src/test/ftest/examples/spring/testng.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/wicket/build.xml
===================================================================
--- trunk/src/test/ftest/examples/wicket/build.xml (rev 0)
+++ trunk/src/test/ftest/examples/wicket/build.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<project name="wicket" basedir="." default="build">
+ <property name="example.name" value="wicket"/>
+ <property name="jboss.deploy.target" value="deploy"/>
+ <property name="jboss.deploy.waittime" value="10"/>
+ <property name="jboss.undeploy.target" value="undeploy"/>
+ <property name="example.ready.check.url"
value="seam-wicket/home.seam"/>
+
+ <import file="../build.xml" />
+</project>
Added:
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/WicketSimpleBookingTest.java
===================================================================
---
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/WicketSimpleBookingTest.java
(rev 0)
+++
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/WicketSimpleBookingTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.wicket.test.selenium;
+
+import org.jboss.seam.example.common.test.booking.selenium.SimpleBookingTest;
+
+/**
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class WicketSimpleBookingTest extends SimpleBookingTest {
+
+ @Override
+ protected void populateBookingFields(int bed, int smoking,
+ String creditCard, String creditCardName) {
+ super.populateBookingFields(bed, smoking, creditCard, creditCardName);
+ populateBookingFields();
+ }
+
+ protected void populateBookingFields() {
+ browser
+ .select(getProperty("HOTEL_CREDIT_CARD_EXPIRY_MONTH"),
+ "index=1");
+ browser.select(getProperty("HOTEL_CREDIT_CARD_EXPIRY_YEAR"),
"index=1");
+ }
+}
Added:
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/wicket.properties
===================================================================
---
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/wicket.properties
(rev 0)
+++
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/wicket.properties 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,85 @@
+ #
+ # JBoss, Home of Professional Open Source
+ # Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ # by the @authors tag. See the copyright.txt in the distribution for a
+ # full listing of individual contributors.
+ #
+ # This is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU Lesser General Public License as
+ # published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # This software is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this software; if not, write to the Free
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ # 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ #
+HOME_PAGE /seam-wicket
+MAIN_PAGE /seam-wicket
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD identifier=username
+LOGIN_PASSWORD_FIELD identifier=password
+LOGIN_SUBMIT identifier=login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Search Hotels
+PASSWORD_REENTER_MESSAGE must be equal
+PASSWORD_VALUE_REQUIRED_MESSAGE //span[@name='message']//span
+PASSWORD_LENGTH_MESSAGE length must be between
+PASSWORD_PASSWORD identifier=passwordBorder:password
+PASSWORD_VERIFY identifier=verifyBorder:verify
+PASSWORD_SUBMIT id=change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=searchString
+SEARCH_SUBMIT identifier=:submit
+NO_HOTELS_FOUND xpath=//table[@id ='hotels']/tbody[count(./*) = 0]
+SEARCH_RESULT_TABLE xpath=//table[@id ='hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK xpath=//table[@id
='hotels']/tbody/tr[1]/td[5]/a
+BOOKING_BOOK id=bookHotel
+BOOKING_CANCEL id=cancel
+HOTEL_BED_FIELD identifier=bedsBorder:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA index=
+HOTEL_CHECKIN_DATE_FIELD identifier=checkinDateBorder:checkinDate:date
+HOTEL_CHECKIN_DATE_MESSAGE xpath=//span[@id='message']//span
+HOTEL_CHECKOUT_DATE_FIELD identifier=checkoutDateBorder:checkoutDate:date
+HOTEL_CHECKOUT_DATE_MESSAGE xpath=//span[@id='message']//span
+HOTEL_SMOKING_1 id=smokingBorder:smoking_true
+HOTEL_SMOKING_2 id=smokingBorder:smoking_false
+HOTEL_CREDIT_CARD identifier=creditCardBorder:creditCard
+HOTEL_CREDIT_CARD_NAME identifier=creditCardNameBorder:creditCardName
+HOTEL_CREDIT_CARD_EXPIRY_MONTH identifier=creditCardExpiryBorder:creditCardExpiryMonth
+HOTEL_CREDIT_CARD_EXPIRY_YEAR identifier=creditCardExpiryBorder:creditCardExpiryYear
+HOTEL_PROCEED id=proceed
+HOTEL_CANCEL id=cancel
+HOTEL_CONFIRM id=confirm
+HOTEL_MESSAGE
xpath=//span[@wicket:id='messages']//span[@wicket:id='message']
+REGISTRATION identifier=register
+REGISTRATION_USERNAME identifier=usernameDecorate:username
+REGISTRATION_NAME identifier=nameDecorate:name
+REGISTRATION_PASSWORD identifier=passwordDecorate:password
+REGISTRATION_VERIFY identifier=verifyDecorate:verify
+REGISTRATION_SUBMIT id=register
+REGISTRATION_REENTER_MESSAGE Password and Verify Password must be equal.
+REGISTRATION_LENGTH_MESSAGE length must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another
request
+BOOKING_TABLE_ITEM
xpath\=//table[@id\="bookings"]/tbody/tr[normalize-space(td[6]/span/text()) \=
"{0}"][normalize-space(td[1]/span/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK
xpath\=//table[@id\="bookings"]/tbody/tr[normalize-space(td[6]/span/text()) \=
"{0}"][normalize-space(td[1]/span/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+#WORKSPACE_BOOKING_TEXT Book hotel: {0}
+#WORKSPACE_VIEW_TEXT View hotel: {0}
+#WORKSPACE_TABLE_LINK_BY_ID
id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+#WORKSPACE_TABLE_ROW_COUNT =
xpath=//table[@id='ConversationListForm:ConversationListDataTable']/tbody/tr
+SPINNER xpath=//span[contains(@id, 'ajax-indicator')]
+# ajax is used in wicket example but search button has to be clicked
+USE_AJAX_SEARCH TRUE
+USE_SEARCH_BUTTON TRUE
\ No newline at end of file
Property changes on:
trunk/src/test/ftest/examples/wicket/src/org/jboss/seam/example/wicket/test/selenium/wicket.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/examples/wicket/testng.xml
===================================================================
--- trunk/src/test/ftest/examples/wicket/testng.xml (rev 0)
+++ trunk/src/test/ftest/examples/wicket/testng.xml 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,36 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Wicket example" verbose="2"
parallel="false">
+ <test name="Wicket example">
+ <parameter name="PROPERTY_FILE"
value="/org/jboss/seam/example/wicket/test/selenium/wicket.properties" />
+ <classes>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.RegistrationTest"
/>
+ <class
+
name="org.jboss.seam.example.common.test.booking.selenium.ChangePasswordTest"
/>
+ <class
+
name="org.jboss.seam.example.wicket.test.selenium.WicketSimpleBookingTest">
+ </class>
+ </classes>
+ </test>
+</suite>
\ No newline at end of file
Property changes on: trunk/src/test/ftest/examples/wicket/testng.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/ftest/ftest.properties
===================================================================
--- trunk/src/test/ftest/ftest.properties (rev 0)
+++ trunk/src/test/ftest/ftest.properties 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,39 @@
+ #
+ # JBoss, Home of Professional Open Source
+ # Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ # by the @authors tag. See the copyright.txt in the distribution for a
+ # full listing of individual contributors.
+ #
+ # This is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU Lesser General Public License as
+ # published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # This software is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this software; if not, write to the Free
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ # 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ #
+
+#Build properties for running and executing functional tests
+
+# Selenium testng specific
+selenium.server.port=14444
+selenium.host=localhost
+selenium.browser=*firefox
+selenium.browser.port=8080
+selenium.browser.url=http://127.0.0.1:8080
+selenium.speed=0
+selenium.timeout=30000
+
+# enter any commands wanted for the testng run
+selenium.testng.jvmargs=-Dfoo
+
+# enter any commands wanted for the selenium server
+# -log selenium.server.log will create a debug log
+selenium.server.cmd.args=
Added: trunk/src/test/ftest/lib/selenium-java-client-driver.jar
===================================================================
(Binary files differ)
Property changes on: trunk/src/test/ftest/lib/selenium-java-client-driver.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/test/ftest/lib/selenium-server-standalone.jar
===================================================================
(Binary files differ)
Property changes on: trunk/src/test/ftest/lib/selenium-server-standalone.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/test/ftest/lib/testng-5.8-jdk15.jar
===================================================================
(Binary files differ)
Property changes on: trunk/src/test/ftest/lib/testng-5.8-jdk15.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/test/ftest/readme.txt
===================================================================
--- trunk/src/test/ftest/readme.txt (rev 0)
+++ trunk/src/test/ftest/readme.txt 2008-10-29 21:05:06 UTC (rev 9464)
@@ -0,0 +1,76 @@
+#
+ # JBoss, Home of Professional Open Source
+ # Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ # by the @authors tag. See the copyright.txt in the distribution for a
+ # full listing of individual contributors.
+ #
+ # This is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU Lesser General Public License as
+ # published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # This software is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this software; if not, write to the Free
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ # 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ #
+
+Core functional test framework for Seam.
+
+UNDER DEVELOPMENT NOT COMPLETE
+
+How To:
+----------
+* Follow specific instructions for your OS
+* Set jboss.home in $SEA</build.properties
+* execute "ant testall" in the $SEAM/src/test/ftest directory
+
+
+Known Limitations:
+---------------------
+* Only tested on Linux with Firefox
+* jboss.home must be set in $SEAM/build.properties
+* JBoss AS must be started (preferably with nothing deployed)
+
+Windows Setup
+--------------
+TBD
+
+Unix/Linux Setup
+-----------------
+*must set to the location of your firefox browser like this:
+ export LD_LIBRARY_PATH=/jboss/projects/seam/automation/firefox:$LD_LIBRARY_PATH
+ export PATH=/jboss/projects/seam/automation/firefox:$PATH
+
+Mac OS Setup
+--------------
+TBD
+
+TODO's:
+-------
+* There are several TODO's in the source code
+* Write up detailed instructions for adding tests, containers, etc...
+* Add the ability to download,extract,started, stop, remove containers (jboss 4.2.X,
JBoss 5, tomcat 6)
+* Consolidate the test reports
+* Expose more options to users for tweaking
+* headless env and selenium RC integration for CI
+* Test and update for more Browsers, Operating Systems, and Containers
+* set up a project file for these tests, or update the existing?
+* Describe how to debug the tests using eclipse
+ - start server, sel server, and in eclipse set props in ftest.prop file and testng
plugin
+* We currently have 3 required jars in the $SEAM/src/test/ftest/lib directory
+ - When the build system is updated these will be removed and dependencies will
+ be handled as the rest of the source is.
+ - We are trying to keep the ftest builds as separate from seam builds as possible.
+ - FYI selenium versions are "1.0-beta-1" and testng.jar is 5.8-200803291025
+
+OPEN QUESTIONS:
+-----------------
+* I'm not sure I like the package name for the common example test code
+* I don't like how we are using property files for all the variables
+ - Jozef - can we move them to the values in an interface, or some other way
Added:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/AjaxTest.java
===================================================================
---
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/AjaxTest.java
(rev 0)
+++
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/AjaxTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.common.test.booking.selenium;
+
+import org.testng.annotations.Test;
+/**
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class AjaxTest extends SeleniumBookingTest {
+
+ @Test
+ public void ajaxSearchFloodTest() {
+ String[] hotels = new String[] { "Marriott Courtyard", "Conrad
Miami",
+ "Marriot Downtown", "Ritz Carlton",
"NonExistingHotel" };
+ for (int i = 0; i < 30; i++) {
+ for (String hotel : hotels) {
+
+ browser.type(getProperty("SEARCH_STRING_FIELD"),
"");
+ enterSearchQuery(hotel);
+ }
+ }
+ }
+}
Property changes on:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/AjaxTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/BackButtonTest.java
===================================================================
---
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/BackButtonTest.java
(rev 0)
+++
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/BackButtonTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.common.test.booking.selenium;
+
+import org.testng.annotations.Test;
+
+import static org.testng.AssertJUnit.*;
+
+/**
+ * This tests verifies that the example can cleanly handle backbuttoning in
+ * various situations
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class BackButtonTest extends SeleniumBookingTest {
+
+ String hotelName = "Mar";
+
+ /**
+ * Tries whether backbuttoning after logout is cleanly handled.
+ */
+ @Test
+ public void backbuttoningAfterLogoutTest() {
+ enterSearchQuery(hotelName);
+ logout();
+ // goBack() does not work with konqueror
+ browser.goBack();
+ browser.waitForPageToLoad(TIMEOUT);
+ if (isLoggedIn()) {
+ browser.click(getProperty("SETTINGS"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertEquals("Backbuttoning failed.",
getProperty("PAGE_TITLE"),
+ browser.getTitle());
+ assertFalse("Backbuttoning handled bad way.", isLoggedIn());
+ }
+ }
+
+ /**
+ * Tries whether backbuttoning after logout is cleanly handled. Using ajax
+ * functionality after logout.
+ */
+ @Test
+ public void backbuttoningAfterLogoutWithAjaxTest() {
+ enterSearchQuery(hotelName);
+ logout();
+ // goBack() does not work with konqueror
+ // browser.refresh();
+ // browser.waitForPageToLoad(TIMEOUT);
+ browser.goBack();
+ browser.waitForPageToLoad(TIMEOUT);
+ if (isLoggedIn()) {
+ browser.click(getProperty("SEARCH_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertEquals("Backbuttoning failed.",
getProperty("PAGE_TITLE"),
+ browser.getTitle());
+ assertFalse("User should not be logged in by now.", isLoggedIn());
+ }
+ }
+
+ /**
+ * Verifies that backbuttoning after ending conversation is handled cleanly.
+ */
+ @Test
+ public void backbuttoningAfterConversationEndTest() {
+ // start booking
+ enterSearchQuery(hotelName);
+ browser.click(getProperty("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.click(getProperty("BOOKING_BOOK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // cancel booking
+ browser.click(getProperty("HOTEL_CANCEL"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.goBack();
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.refresh();
+ browser.waitForPageToLoad(TIMEOUT);
+ assertTrue("Conversation failure.", browser
+ .isTextPresent(getProperty("CONVERSATION_TIMEOUT_MESSAGE")));
+ }
+}
Property changes on:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/BackButtonTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.java
===================================================================
---
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.java
(rev 0)
+++
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.common.test.booking.selenium;
+
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import static org.testng.AssertJUnit.*;
+
+/**
+ * This class tests change password funcionality.
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class ChangePasswordTest extends SeleniumBookingTest {
+
+ private final static String LONG_TEXT = "testertestertest";
+ private final static String SHORT_TEXT = "tt";
+ // overriding default values
+ private final String USERNAME = "gavin";
+ private final String PASSWORD = "foobar";
+
+ @Override
+ @BeforeMethod
+ public void setUp() {
+ startBrowser();
+ assertTrue("Login failed.", login(USERNAME, PASSWORD));
+ }
+
+ /**
+ * Verifies that changing password works well. If clean-up part of this
+ * method fails it may affect other methods.
+ */
+ @Test
+ public void changePasswordTest() {
+ changePassword("password");
+ assertTrue("Password change failed.", browser
+ .isTextPresent(getProperty("PASSWORD_UPDATED_MESSAGE")));
+ logout();
+ assertTrue("Login failed.", login(USERNAME, "password"));
+ // cleanup - set default password
+ changePassword(PASSWORD);
+ assertTrue("Password change failed.", browser
+ .isTextPresent(getProperty("PASSWORD_UPDATED_MESSAGE")));
+ logout();
+ assertTrue("Login failed.", login(USERNAME, PASSWORD));
+ }
+
+ @Test
+ public void usingDifferentPasswordsTest() {
+ changePassword("password", "password1");
+ assertTrue("Password verification failed", browser
+ .isTextPresent(getProperty("PASSWORD_REENTER_MESSAGE")));
+ }
+
+ @Test
+ public void usingEmptyPasswordsTest() {
+ changePassword("", "");
+ assertEquals("Password validation failed", 2, browser
+
.getXpathCount(getProperty("PASSWORD_VALUE_REQUIRED_MESSAGE")));
+ }
+
+ @Test
+ public void usingLongPasswordTest() {
+ changePassword(LONG_TEXT, LONG_TEXT);
+ assertTrue("Password validation failed", browser
+ .isTextPresent(getProperty("PASSWORD_LENGTH_MESSAGE")));
+ }
+
+ @Test
+ public void usingShortPasswordTest() {
+ changePassword(SHORT_TEXT, SHORT_TEXT);
+ assertTrue("Password validation failed", browser
+ .isTextPresent(getProperty("PASSWORD_LENGTH_MESSAGE")));
+ }
+
+ public void changePassword(String newPassword) {
+ changePassword(newPassword, newPassword);
+ }
+
+ public void changePassword(String newPassword, String verify) {
+ browser.click(getProperty("SETTINGS"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.type(getProperty("PASSWORD_PASSWORD"), newPassword);
+ browser.type(getProperty("PASSWORD_VERIFY"), verify);
+ browser.click(getProperty("PASSWORD_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+}
Property changes on:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ConversationTest.java
===================================================================
---
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ConversationTest.java
(rev 0)
+++
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ConversationTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.common.test.booking.selenium;
+
+import java.text.MessageFormat;
+
+import org.testng.annotations.Test;
+
+import static org.testng.AssertJUnit.*;
+
+/**
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class ConversationTest extends SeleniumBookingTest {
+
+ private final String hotel1 = "Hotel Rouge";
+ private final String hotel2 = "Doubletree";
+
+ /**
+ * Opens two windows and tries switching over workspaces to make sure
+ * conversations work properly.
+ */
+ @Test
+ public void testConversations() {
+ // Start booking in window 1
+ browser.openWindow(getProperty("MAIN_PAGE"), "1");
+ browser.openWindow(getProperty("MAIN_PAGE"), "2");
+ browser.selectWindow("1");
+ browser.refresh();
+ browser.waitForPageToLoad(TIMEOUT);
+ if (!isLoggedIn()) {
+ login();
+ }
+ enterSearchQuery(hotel1);
+ browser.click(getProperty("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.click(getProperty("BOOKING_BOOK"));
+ // Find hotel in window 2
+ browser.selectWindow("2");
+ if (!isLoggedIn()) {
+ login();
+ }
+ enterSearchQuery(hotel2);
+ browser.click(getProperty("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // Reload window 1 to check whether both workspaces are displayed
+ browser.selectWindow("1");
+ browser.refresh();
+ browser.waitForPageToLoad(TIMEOUT);
+ assertEquals("#1 workspace not present in workspace table",
+ MessageFormat.format(getProperty("WORKSPACE_BOOKING_TEXT"),
+ hotel1), browser.getText(MessageFormat.format(
+ getProperty("WORKSPACE_TABLE_LINK_BY_ID"), 0)));
+ assertEquals("#2 workspace not present in workspace table",
+ MessageFormat
+ .format(getProperty("WORKSPACE_VIEW_TEXT"), hotel2),
+ browser.getText(MessageFormat.format(
+ getProperty("WORKSPACE_TABLE_LINK_BY_ID"), 1)));
+ // Switch window 1 to second workspace
+ browser.click(MessageFormat.format(
+ getProperty("WORKSPACE_TABLE_LINK_BY_ID"), 1));
+ browser.waitForPageToLoad(TIMEOUT);
+ // Switch window 1 back to first workspace
+ browser.click(MessageFormat.format(
+ getProperty("WORKSPACE_TABLE_LINK_BY_ID"), 1));
+ browser.waitForPageToLoad(TIMEOUT);
+ // End conversation in window 2
+ browser.selectWindow("2");
+ browser.click(getProperty("BOOKING_CANCEL"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // Second workspace should disappear
+ browser.selectWindow("1");
+ browser.refresh();
+ browser.waitForPageToLoad(TIMEOUT);
+ assertEquals("Workspace failure.", 1, browser
+ .getXpathCount(getProperty("WORKSPACE_TABLE_ROW_COUNT")));
+ }
+}
Property changes on:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/ConversationTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.java
===================================================================
---
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.java
(rev 0)
+++
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.common.test.booking.selenium;
+
+import java.text.MessageFormat;
+import java.util.Date;
+
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import static org.testng.AssertJUnit.*;
+
+/**
+ * This class tests registration
+ *
+ * @author jbalunas
+ * @author jharting
+ */
+public class RegistrationTest extends SeleniumBookingTest {
+
+ private final String LONG_TEXT = "testertestertest";
+ private final String SHORT_TEXT = "tes";
+ // private final static int USER_COUNT = 3;
+ private String suffix;
+
+ public RegistrationTest() {
+ Date date = new Date();
+ // suffix is needed to allow tests to be run repeatedly
+ suffix = Long.toString(date.getTime() % 10000000);
+ }
+
+ @Override
+ @BeforeMethod
+ public void setUp() {
+ startBrowser();
+ assertTrue("Login failed.", login());
+ }
+
+ @Override
+ @AfterMethod
+ public void tearDown() {
+ browser.stop();
+ }
+
+ @Test
+ public void testVerify() {
+ register("tester", "tester", "password",
"password1");
+ // assertTrue("Error message expected.",
+ // browser.isElementPresent(get("REGISTRATION_VERIFY_MESSAGE")));
+ assertTrue("Password verification failed.", browser
+ .isTextPresent(getProperty("REGISTRATION_REENTER_MESSAGE")));
+ }
+
+ @Test
+ public void testLongText() {
+ register(LONG_TEXT, "tester", "password",
"password");
+ assertTrue("Username validation failed.", browser
+ .isTextPresent(getProperty("REGISTRATION_LENGTH_MESSAGE")));
+ }
+
+ @Test
+ public void testShortText() {
+ register(SHORT_TEXT, "tester", "password",
"password");
+ assertTrue("Username validation failed.", browser
+ .isTextPresent(getProperty("REGISTRATION_LENGTH_MESSAGE")));
+ }
+
+ @Test
+ public void testDuplicateUser() {
+ String username = "tester" + suffix;
+ register(username, "tester", "password",
"password");
+ assertTrue("Navigation after succesful registration failed.", browser
+ .getLocation().contains(getProperty("HOME_PAGE")));
+ // assertTrue("Registration failed.",
+ //
browser.isTextPresent(MessageFormat.format(get("REGISTRATION_SUCCESSFUL_MESSAGE"),
+ // username)));
+ register(username, "tester", "password",
"password");
+ assertTrue("Registered 2 users with the same username.", browser
+ .isTextPresent(MessageFormat.format(
+ getProperty("REGISTRATION_USER_EXISTS_MESSAGE"),
username)));
+ }
+
+ @Test
+ public void standardRegistrationTest() {
+ String username = "homer" + suffix;
+ String name = "Homer Simpson";
+ String password = "password";
+ register(username, name, password, password);
+ assertTrue("Navigation after succesful registration failed.", browser
+ .getLocation().contains(getProperty("HOME_PAGE")));
+ // assertTrue("Registration failed.",
+ //
browser.isTextPresent(MessageFormat.format(get("REGISTRATION_SUCCESSFUL_MESSAGE"),
+ // username)));
+ // try logging in to verify registration
+ assertTrue("Login failed.", login(username, password));
+ }
+
+ private void register(String username, String name, String password,
+ String verify) {
+ browser.open(getProperty("HOME_PAGE"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertEquals("Unable to load home page.",
getProperty("PAGE_TITLE"), browser
+ .getTitle());
+ browser.click(getProperty("REGISTRATION"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.type(getProperty("REGISTRATION_USERNAME"), username);
+ browser.type(getProperty("REGISTRATION_NAME"), name);
+ browser.type(getProperty("REGISTRATION_PASSWORD"), password);
+ browser.type(getProperty("REGISTRATION_VERIFY"), verify);
+ browser.click(getProperty("REGISTRATION_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+
+}
Property changes on:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.java
===================================================================
---
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.java
(rev 0)
+++
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.common.test.booking.selenium;
+
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
+
+import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+
+import com.thoughtworks.selenium.Wait;
+
+/**
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class SeleniumBookingTest extends SeamSeleniumTest {
+
+ private final String DEFAULT_USERNAME = "demo";
+ private final String DEFAULT_PASSWORD = "demo";
+
+ @Override
+ @BeforeMethod
+ public void setUp() {
+ startBrowser();
+ assertTrue("Login failed.", login());
+ }
+
+ @Override
+ @AfterMethod
+ public void tearDown() {
+ logout();
+ browser.stop();
+ }
+
+ public boolean login() {
+ return login(DEFAULT_USERNAME, DEFAULT_PASSWORD);
+ }
+
+ public boolean login(String username, String password) {
+ if (isLoggedIn()) {
+ fail("User already logged in.");
+ }
+ browser.open(getProperty("HOME_PAGE"));
+ browser.waitForPageToLoad(TIMEOUT);
+ if (!browser.getTitle().equals(getProperty("PAGE_TITLE"))) {
+ return false;
+ }
+ browser.type(getProperty("LOGIN_USERNAME_FIELD"), username);
+ browser.type(getProperty("LOGIN_PASSWORD_FIELD"), password);
+ browser.click(getProperty("LOGIN_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ return isLoggedIn();
+ }
+
+ public void logout() {
+ if (isLoggedIn()) {
+ browser.click(getProperty("LOGOUT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+ }
+
+ public boolean isLoggedIn() {
+ return browser.isElementPresent(getProperty("LOGOUT"));
+ }
+
+ public void enterSearchQuery(String query) {
+ if (getProperty("USE_AJAX_SEARCH").equalsIgnoreCase("FALSE"))
{
+ enterSearchQueryWithoutAJAX(query);
+ } else {
+ if
(getProperty("USE_SEARCH_BUTTON").equalsIgnoreCase("TRUE")) {
+ enterSearchQueryUsingAJAX(query, true);
+ } else {
+ enterSearchQueryUsingAJAX(query, false);
+ }
+ }
+ }
+
+ public void enterSearchQueryUsingAJAX(String query, boolean click) {
+ browser.type(getProperty("SEARCH_STRING_FIELD"), "");
+ browser.type(getProperty("SEARCH_STRING_FIELD"), query.substring(0,
query
+ .length() - 1));
+ browser.typeKeys(getProperty("SEARCH_STRING_FIELD"),
query.substring(query
+ .length() - 1));
+ if (click) {
+ browser.click(getProperty("SEARCH_SUBMIT"));
+ }
+ new Wait() {
+ public boolean until() {
+ return !browser.isVisible(getProperty("SPINNER"));
+ }
+ }.wait("Spinner hasn't come out.");
+ new Wait() {
+ public boolean until() {
+ return
(browser.isElementPresent(getProperty("SEARCH_RESULT_TABLE")) || browser
+ .isElementPresent(getProperty("NO_HOTELS_FOUND")));
+ }
+ }.wait("Search results not found.");
+ }
+
+ public void enterSearchQueryWithoutAJAX(String query) {
+ browser.type(getProperty("SEARCH_STRING_FIELD"), "");
+ browser.type(getProperty("SEARCH_STRING_FIELD"), query);
+ browser.click(getProperty("SEARCH_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+}
Property changes on:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SimpleBookingTest.java
===================================================================
---
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SimpleBookingTest.java
(rev 0)
+++
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SimpleBookingTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,193 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.common.test.booking.selenium;
+
+import java.text.MessageFormat;
+
+import org.testng.annotations.Test;
+
+import static org.testng.AssertJUnit.*;
+
+/**
+ * This class tests booking functionality of the example.
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class SimpleBookingTest extends SeleniumBookingTest {
+
+ private final String EXPECTED_NAME = "Demo User";
+ private final String CREDIT_CARD = "0123456789012345";
+ private final String CREDIT_CARD_NAME = "visa";
+
+ /**
+ * Tries searching for non existing hotel.
+ */
+ @Test(enabled = true)
+ public void invalidSearchStringTest() {
+ enterSearchQuery("NonExistingHotel");
+ assertTrue("Search failed.", browser
+ .isElementPresent(getProperty("NO_HOTELS_FOUND")));
+ }
+
+ /**
+ * Simply books hotel.
+ */
+ @Test(enabled = true)
+ public void simpleBookingTest() {
+ String hotelName = "Swissotel";
+ int confirmationNumber;
+ confirmationNumber = bookHotel(hotelName);
+ assertTrue("Booking with confirmation number " + confirmationNumber
+ + " not found.",
browser.isElementPresent(MessageFormat.format(
+ getProperty("BOOKING_TABLE_ITEM"), confirmationNumber,
hotelName)));
+ }
+
+ /**
+ * Tries booking hotel with incorrect dates.
+ */
+ @Test(enabled = true)
+ public void invalidDatesTest() {
+ String hotelName = "Swissotel";
+ enterSearchQuery(hotelName);
+ browser.click(getProperty("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // hotel page
+ browser.click(getProperty("BOOKING_BOOK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // booking page
+ String checkIn =
browser.getValue(getProperty("HOTEL_CHECKIN_DATE_FIELD"));
+ String checkOut =
browser.getValue(getProperty("HOTEL_CHECKOUT_DATE_FIELD"));
+ populateBookingFields();
+ // switch check in and check out date
+ browser.type(getProperty("HOTEL_CHECKIN_DATE_FIELD"), checkOut);
+ browser.type(getProperty("HOTEL_CHECKOUT_DATE_FIELD"), checkIn);
+ browser.type(getProperty("HOTEL_CREDIT_CARD"), CREDIT_CARD);
+ browser.type(getProperty("HOTEL_CREDIT_CARD_NAME"), CREDIT_CARD_NAME);
+ browser.click(getProperty("HOTEL_PROCEED"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertTrue("Date verification #1 failed.", browser
+ .isTextPresent(getProperty("BOOKING_INVALID_DATE_MESSAGE1")));
+ assertTrue("Check-out date error message expected.", browser
+
.isElementPresent(getProperty("HOTEL_CHECKOUT_DATE_MESSAGE")));
+ // set check in to past
+ browser.type(getProperty("HOTEL_CHECKIN_DATE_FIELD"),
"01/01/1970");
+ browser.click(getProperty("HOTEL_PROCEED"));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertTrue("Date verification #2 failed.", browser
+ .isTextPresent(getProperty("BOOKING_INVALID_DATE_MESSAGE2")));
+ assertTrue("Checkin-date error message expected.", browser
+ .isElementPresent(getProperty("HOTEL_CHECKIN_DATE_MESSAGE")));
+ }
+
+ /**
+ * This test verifies that user gets right confirmation number when
+ * canceling order.
https://jira.jboss.org/jira/browse/JBSEAM-3288
+ */
+ @Test(enabled = true)
+ public void testJBSEAM3288() {
+ String[] hotelNames = new String[] { "Doubletree", "Hotel
Rouge",
+ "Conrad Miami" };
+ int[] confirmationNumbers = new int[3];
+ // make 3 bookings
+ for (int i = 0; i < 3; i++) {
+ int confirmationNumber = bookHotel(hotelNames[i]);
+ assertNotSame("Booking process failed.", -1, confirmationNumber);
+ confirmationNumbers[i] = confirmationNumber;
+ }
+ // assert that there bookings are listed in hotel booking list
+ for (int i = 0; i < 3; i++) {
+ assertTrue("Expected booking #" + i + " not present",
browser
+ .isElementPresent(MessageFormat.format(
+ getProperty("BOOKING_TABLE_ITEM"),
confirmationNumbers[i],
+ hotelNames[i])));
+ }
+ // cancel all the reservations
+ for (int i = 2; i >= 0; i--) {
+
browser.click(MessageFormat.format(getProperty("BOOKING_TABLE_ITEM_LINK"),
+ confirmationNumbers[i], hotelNames[i]));
+ browser.waitForPageToLoad(TIMEOUT);
+ assertTrue("Booking canceling failed", browser
+ .isTextPresent(MessageFormat.format(
+ getProperty("BOOKING_CANCELLED_MESSAGE"),
+ confirmationNumbers[i])));
+ }
+
+ }
+
+ protected int bookHotel(String hotelName, int bed, int smoking,
+ String creditCard, String creditCardName) {
+ if (!isLoggedIn())
+ return -1;
+ if (!browser.isElementPresent(getProperty("SEARCH_SUBMIT"))) {
+ browser.open(getProperty("MAIN_PAGE"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+ enterSearchQuery(hotelName);
+ browser.click(getProperty("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // booking page
+ // assertEquals("Booking failed.", get("PAGE_TITLE"),
+ // browser.getTitle());
+ browser.click(getProperty("BOOKING_BOOK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // hotel page
+ populateBookingFields(bed, smoking, creditCard, creditCardName);
+ browser.click(getProperty("HOTEL_PROCEED"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // confirm page
+ browser.click(getProperty("HOTEL_CONFIRM"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // main page
+ String message = browser.getText(getProperty("HOTEL_MESSAGE"));
+ if (message.matches(MessageFormat.format(
+ getProperty("BOOKING_CONFIRMATION_MESSAGE"), EXPECTED_NAME,
hotelName))) {
+ String[] messageParts = message.split(" ");
+ int confirmationNumber = Integer
+ .parseInt(messageParts[messageParts.length - 1]);
+ return confirmationNumber;
+ } else {
+ return -1;
+ }
+ }
+
+ protected int bookHotel(String hotelName) {
+ return bookHotel(hotelName, 2, 0, CREDIT_CARD, CREDIT_CARD_NAME);
+ }
+
+ protected void populateBookingFields(int bed, int smoking,
+ String creditCard, String creditCardName) {
+ browser.select(getProperty("HOTEL_BED_FIELD"),
+ getProperty("HOTEL_BED_FIELD_SELECT_CRITERIA") + bed);
+ if (smoking == 1) {
+ browser.check(getProperty("HOTEL_SMOKING_1"));
+ } else {
+ browser.check(getProperty("HOTEL_SMOKING_2"));
+ }
+ browser.type(getProperty("HOTEL_CREDIT_CARD"), creditCard);
+ browser.type(getProperty("HOTEL_CREDIT_CARD_NAME"), creditCardName);
+ }
+
+ protected void populateBookingFields() {
+ }
+}
Property changes on:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/selenium/SimpleBookingTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java
===================================================================
---
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java
(rev 0)
+++
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java 2008-10-29
21:05:06 UTC (rev 9464)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.seam.example.common.test.selenium;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import static org.testng.AssertJUnit.*;
+
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+
+import com.thoughtworks.selenium.DefaultSelenium;
+import com.thoughtworks.selenium.Selenium;
+import com.thoughtworks.selenium.Wait;
+
+/**
+ * Base class for all Seam based selenium tests.
+ * @author jbalunas
+ *
+ */
+public abstract class SeamSeleniumTest {
+
+ private static String HOST;
+ private static int PORT;
+ private static String BROWSER;
+ private static String BROWSER_URL;
+ private static String SPEED;
+ public static String TIMEOUT;
+ private static String PROPERTY_FILE;
+ private static Properties properties = new Properties();
+ private static boolean propertiesLoaded = false;
+
+ protected Selenium browser;
+
+ @BeforeTest
+ @Parameters( { "selenium.host", "selenium.server.port",
"selenium.browser",
+ "selenium.browser.url", "selenium.speed",
"selenium.timeout",
+ "PROPERTY_FILE" })
+ public void setParameters(String host, String port, String browser,
+ String browserUrl, String speed, String timeout, String propertyFile) {
+ HOST = host;
+ PORT = Integer.parseInt(port);
+ BROWSER = browser;
+ BROWSER_URL = browserUrl;
+ SPEED = speed;
+ TIMEOUT = timeout;
+ PROPERTY_FILE = propertyFile;
+ }
+
+ @BeforeMethod
+ public void setUp() {
+ startBrowser();
+ }
+
+ @AfterMethod
+ public void tearDown() {
+ stopBrowser(browser);
+ }
+
+ public void startBrowser() {
+ browser = new DefaultSelenium(HOST, PORT, BROWSER, BROWSER_URL);
+ browser.start();
+ browser.allowNativeXpath("false");
+ browser.setSpeed(SPEED);
+ }
+
+ public void stopBrowser(Selenium browser) {
+ browser.stop();
+ }
+
+ public String getProperty(String key) {
+ if (!propertiesLoaded) {
+ try {
+
properties.load(SeamSeleniumTest.class.getResourceAsStream(PROPERTY_FILE));
+ propertiesLoaded = true;
+ } catch (IOException e) {
+ e.printStackTrace();
+ fail("Property file not found.");
+ }
+ }
+ return properties.getProperty(key, "Property not found: " + key);
+ }
+}
Property changes on:
trunk/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.java
___________________________________________________________________
Name: svn:executable
+ *