[Yanel-commits] rev 37617 - in public/yanel/trunk/src/realms/use-cases/yanel/config/src/test: . canoo canoo/definitions canoo/dtd canoo/includes canoo/tests

michi at wyona.com michi at wyona.com
Thu Jul 17 08:32:48 CEST 2008


Author: michi
Date: 2008-07-17 08:32:48 +0200 (Thu, 17 Jul 2008)
New Revision: 37617

Added:
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/README.txt
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/build.properties
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/build.xml
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/definitions/
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/definitions/login.xml
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/definitions/logout.xml
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/dtd/
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/dtd/Project.dtd
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/includes/
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/includes/config.xml
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/tests/
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/tests/allTests.xml
   public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/tests/exists-homepage.xml
Log:
more trests added

Added: public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/README.txt
===================================================================
--- public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/README.txt	                        (rev 0)
+++ public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/README.txt	2008-07-17 06:32:48 UTC (rev 37617)
@@ -0,0 +1,41 @@
+Canoo Webtests for Yanel Usecases Tests Realm
+=============================================
+
+How to install and run the tests
+--------------------------------
+
+1. download and install canoo webtest package
+   http://webtest.canoo.com/webtest/build.zip
+
+2. unzip build.zip e.g. to /home/USER/canoo
+
+3. edit (local.)build.properties
+   webtest.home=/home/USER/canoo
+
+4. start tomcat
+
+5. type ant to run the tests
+
+
+
+How to add new tests
+--------------------
+
+1. download and install the webtestrecorder firefox plugin
+   http://webtestrecorder.canoo.com/install.html
+
+2. record a test in the browser
+
+3. make a copy of one of the test files under /tests
+
+4. edit the file and replace the actual test code with the recorded code
+
+5. clean up the code if necessary
+
+
+
+Known bugs
+----------
+
+the recorder plugin has a problem with XHTML strict.
+somehow it doesn't record all events (e.g. clickButton).

Added: public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/build.properties
===================================================================
--- public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/build.properties	                        (rev 0)
+++ public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/build.properties	2008-07-17 06:32:48 UTC (rev 37617)
@@ -0,0 +1,15 @@
+# file system path of canoo webtest package
+webtest.home=/home/USER/canoo
+
+# url of webapp (and realm)
+# IMPORTANT: Please note that SSL seems to be a problem with the "Canoo" client!
+# {protocol}://{host}:{port}/{basepath}
+webtest.config.host=localhost
+webtest.config.port=8080
+webtest.config.protocol=http
+#webtest.config.port=8443
+#webtest.config.protocol=https
+webtest.config.basepath=yanel
+
+# See configuration conf/realms.xml (source) or WEB-INF/classes/realms.xml (binary)
+realm.prefix=test/use-cases/

Added: public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/build.xml
===================================================================
--- public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/build.xml	                        (rev 0)
+++ public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/build.xml	2008-07-17 06:32:48 UTC (rev 37617)
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+
+<!--
+This is the canoo webtest build file.
+-->
+
+<project name="example" default="wt.full">
+
+  <property file="local.build.properties"/>
+  <property file="build.properties"/>
+
+  <!-- <import file="definitions.xml" description="Import custom definitions (if any)"/> -->
+  <import file="${webtest.home}/webtest.xml" description="Import all functionalities for a full build"/>
+
+  <property name="wt.testInWork" value="tests/allTests.xml"/>
+
+<!--
+  Activate this if you are behind a proxy and want to test a server outside your local network
+  See http://ant.apache.org/manual/OptionalTasks/setproxy.html
+  <setproxy proxyhost="myProxy" proxyport="1234"/>
+-->
+
+</project>

Added: public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/definitions/login.xml
===================================================================
--- public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/definitions/login.xml	                        (rev 0)
+++ public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/definitions/login.xml	2008-07-17 06:32:48 UTC (rev 37617)
@@ -0,0 +1,16 @@
+<!-- 
+Like all files of this folder, this content will be executed in target wt.defineMacros
+and therefore made be available for the tests (here the macro <fillParticipantData .../>)
+-->
+<macrodef name="login" description="Login">
+  <sequential>
+    <invoke description="Get the page: Login to realm" url="${realm.prefix}"/>
+    <setInputField name="yanel.login.username" value="lenya"/>
+    <setInputField name="yanel.login.password" value="levi"/>
+    <clickButton name="submit"/>
+<!--
+    <clickButton name="Senden"/>
+-->
+    <verifyText description="Verify that text is contained in the page" text="Willkommen"/>
+  </sequential>
+</macrodef>

Added: public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/definitions/logout.xml
===================================================================
--- public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/definitions/logout.xml	                        (rev 0)
+++ public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/definitions/logout.xml	2008-07-17 06:32:48 UTC (rev 37617)
@@ -0,0 +1,11 @@
+<!-- 
+Like all files of this folder, this content will be executed in target wt.defineMacros
+and therefore made be available for the tests (here the macro <fillParticipantData .../>)
+-->
+<macrodef name="logout" description="Logout">
+  <sequential>
+    <invoke description="Get the page: Logout from realm" 
+        url="${realm.prefix}?yanel.usecase=logout"/>
+    <verifyText description="Verify that text is contained in the page" text="Login"/>
+  </sequential>
+</macrodef>

Added: public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/dtd/Project.dtd
===================================================================
--- public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/dtd/Project.dtd	                        (rev 0)
+++ public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/dtd/Project.dtd	2008-07-17 06:32:48 UTC (rev 37617)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<!--
+This file is generated automatically from the information contained in the folder includes.
+Do not edit it else you risk to lose your changes.
+-->
+
+<!ENTITY config SYSTEM "../includes/config.xml">
+

Added: public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/includes/config.xml
===================================================================
--- public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/includes/config.xml	                        (rev 0)
+++ public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/includes/config.xml	2008-07-17 06:32:48 UTC (rev 37617)
@@ -0,0 +1,12 @@
+<config host="${webtest.config.host}"
+        port="${webtest.config.port}"
+        protocol="${webtest.config.protocol}"
+        basepath="${webtest.config.basepath}">
+  <header name="Accept-Language" value="en"/>
+
+<!--
+  <option name="JavaScriptEnabled" value="false"/>
+-->
+  <option name="JavaScriptEnabled" value="true"/>
+  <option name="ThrowExceptionOnScriptError" value="false"/>
+</config>

Added: public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/tests/allTests.xml
===================================================================
--- public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/tests/allTests.xml	                        (rev 0)
+++ public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/tests/allTests.xml	2008-07-17 06:32:48 UTC (rev 37617)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+
+<project name="RealmTest-allTests" default="test">
+  <target name="test" description="runs all the tests">
+    <!-- note: the order of the tests matters because some tests depend on others -->
+
+    <ant antfile="exists-homepage.xml"/>
+  </target>
+</project>

Added: public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/tests/exists-homepage.xml
===================================================================
--- public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/tests/exists-homepage.xml	                        (rev 0)
+++ public/yanel/trunk/src/realms/use-cases/yanel/config/src/test/canoo/tests/exists-homepage.xml	2008-07-17 06:32:48 UTC (rev 37617)
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!DOCTYPE project SYSTEM "../dtd/Project.dtd">
+
+<project name="realm.homepage" default="test">
+
+  <import file="../definitions.xml"/>
+
+  <target name="test" depends="wt.defineMacros">
+    <webtest name="Homepage">
+      &config;
+      <!--<login/>-->
+      <invoke description="Get the page: " url="/${realm.prefix}"/>
+      <verifyText description="Verify that text is contained in the page" text="Test Links"/>
+      <!--<logout/>-->
+    </webtest>
+  </target>
+
+</project>



More information about the Yanel-commits mailing list