summaryrefslogtreecommitdiffstats
path: root/uitest/test.xml
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-09-04 14:49:30 +0300
committerArtur Signell <artur@vaadin.com>2012-09-09 11:23:12 +0300
commitb2b384b531eff28e1fe33bdb91f77edd509970a8 (patch)
treed3c4cfb8bf30388b5fa985ce3f265da07503e097 /uitest/test.xml
parentf73ff78c95ef6184e8365ada272bbbc147bdcd10 (diff)
downloadvaadin-framework-b2b384b531eff28e1fe33bdb91f77edd509970a8.tar.gz
vaadin-framework-b2b384b531eff28e1fe33bdb91f77edd509970a8.zip
Support running TestBench tests with the vaadin-uitest war (#9299)
Server is now launched using jetty-runner instead of a custom DemoLauncher
Diffstat (limited to 'uitest/test.xml')
-rw-r--r--uitest/test.xml100
1 files changed, 56 insertions, 44 deletions
diff --git a/uitest/test.xml b/uitest/test.xml
index b65926ff5b..fca4d1c299 100644
--- a/uitest/test.xml
+++ b/uitest/test.xml
@@ -1,12 +1,15 @@
<?xml version="1.0"?>
-<project xmlns:antcontrib="antlib:net.sf.antcontrib"
- xmlns:ivy="antlib:org.apache.ivy.ant"
- name="Run Vaadin Testbench Tests" basedir="." default="run-and-clean-up">
-
- <property name="project.root" value=".."/>
+<project xmlns:antcontrib="antlib:net.sf.antcontrib" xmlns:ivy="antlib:org.apache.ivy.ant" name="Run Vaadin Testbench Tests" basedir="." default="run-and-clean-up">
+
+ <property name="project.root" value=".." />
<!-- Import common targets -->
- <import file="../build/common.xml" />
-
+ <!--<import file="../build/common.xml" />-->
+ <!-- ant contrib required for flow control (for loop, if, property override) -->
+ <!-- Note that we have to use a namespace to avoid clash when running sub-ant. -->
+ <ivy:resolve file="${project.root}/build/ivy/ivy.xml" conf="taskdefs" />
+ <ivy:cachepath pathid="taskdefs.classpath" conf="taskdefs" />
+ <taskdef uri="antlib:net.sf.antcontrib" resource="net/sf/antcontrib/antlib.xml" classpathref="taskdefs.classpath" />
+
<!-- ================================================================== -->
<!-- Configuration -->
<!-- ================================================================== -->
@@ -16,7 +19,7 @@
<property name="browsers-mac" value="osx-firefox3,osx-opera10,osx-googlechrome8,osx-safari4,osx-safari5" />
<property name="browsers" value="${browsers-windows}" />
-
+
<!-- Number of times to retry a test if it fails -->
<property name="retries" value="2" />
@@ -29,38 +32,35 @@
<!-- Host running Testbench Hub -->
<property name="com.vaadin.testbench.tester.host" value="testbench-hub.intra.itmill.com" />
- <property name="com.vaadin.testbench.screenshot.block.error" value="0.025"/>
- <property name="com.vaadin.testbench.debug" value="false"/>
-
- <!-- Temporary output directory, created and removed by this script -->
- <fail unless="test-output-dir" message="The 'test-output-dir' property must be defined." />
-
- <property name="class-dir" value="${test-output-dir}/classes" />
-
- <target name="initialize" depends="common.init-deps">
- <ivy:resolve conf="emma"/>
- <ivy:cachepath pathid="emma.lib" conf="emma" />
- <!-- classpath must include test bench jar and its dependencies -->
- <path id="classpath">
- <fileset dir="${com.vaadin.testbench.lib.dir}" includes="**/*.jar" />
- <path refid="emma.lib" />
- </path>
- </target>
+ <property name="com.vaadin.testbench.screenshot.block.error" value="0.025" />
+ <property name="com.vaadin.testbench.debug" value="false" />
+
+
+ <target name="initialize">
+ <!-- classpath must include test bench jar and its dependencies -->
+ <path id="classpath">
+ <fileset dir="${com.vaadin.testbench.lib.dir}" includes="**/*.jar" />
+ </path>
+ </target>
<!-- fileset containing all TestBench tests to run -->
<fileset dir=".." id="html-test-files">
- <include name="uitest/**/**.html" />
+ <include name="uitest/**/AbsoluteLayoutClip**.html" />
<exclude name="uitest/integration-testscripts/**" />
</fileset>
<!-- This target converts HTML tests files to java junit tests. One test file for each browser is created. -->
<target name="create-tests" depends="initialize, remove-temp-testclasses">
+ <!-- Temporary output directory, created and removed by this script -->
+ <fail unless="test-output-dir" message="The 'test-output-dir' property must be defined." />
+ <property name="class-dir" value="${test-output-dir}/classes" />
+
<pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
<java classname="com.vaadin.testbench.util.TestConverter" classpathref="classpath" fork="true">
<sysproperty key="com.vaadin.testbench.test.retries" value="${retries}" />
- <jvmarg value="-Duser.language=en"/>
- <jvmarg value="-Duser.country=US"/>
+ <jvmarg value="-Duser.language=en" />
+ <jvmarg value="-Duser.country=US" />
<arg value="${test-output-dir}" />
<arg value="${browsers}" />
<arg line="${testfiles}" />
@@ -92,7 +92,7 @@
<fileset dir="${test-output-dir}" id="tests-fileset">
<include name="**/**.java" />
</fileset>
-
+
<antcontrib:for threadCount="30" parallel="true" keepgoing="true" param="target">
<path>
<fileset refid="tests-fileset" />
@@ -113,8 +113,8 @@
<path refid="classpath" />
<pathelement path="${class-dir}" />
</classpath>
-
- <formatter usefile="false" type="plain"/>
+
+ <formatter usefile="false" type="plain" />
<jvmarg value="-Dcom.vaadin.testbench.tester.host=${com.vaadin.testbench.tester.host}" />
<jvmarg value="-Dcom.vaadin.testbench.deployment.url=${com.vaadin.testbench.deployment.url}" />
@@ -167,17 +167,29 @@
<!-- The default target. -->
<target name="run-and-clean-up" depends="check-parameters,remove-error-screens,run-tests" />
- <!-- Also starts the server. -->
- <target name="test-package">
- <parallel>
- <daemons>
- <ant antfile="vaadin-server.xml" inheritall="true" inheritrefs="true" target="deploy-and-start" />
- </daemons>
- <sequential>
- <ant antfile="vaadin-server.xml" target="wait-for-startup" />
- <antcall inheritall="true" inheritrefs="true" target="run-and-clean-up" />
- <move file="${testing.testarea}/${package.name}/war.ec" todir="../build/result" failonerror="false" />
- </sequential>
- </parallel>
- </target>
+
+ <!-- Starts the server and runs all TestBench tests -->
+ <target name="test-package">
+ <fail unless="war.file" message="No 'war.file' parameter given." />
+ <property name="test-output-dir" location="result/testbench-junit-classes" />
+ <property name="retries" value="2" />
+
+ <!-- Parameters for the test.xml script. -->
+ <fail unless="com.vaadin.testbench.tester.host" message="The 'com.vaadin.testbench.tester.host' property must be defined." />
+ <fail unless="com.vaadin.testbench.deployment.url" message="The 'com.vaadin.testbench.deployment.url' property must be defined." />
+ <fail unless="com.vaadin.testbench.lib.dir" message="The 'com.vaadin.testbench.lib.dir' property must be defined." />
+ <property name="com.vaadin.testbench.screenshot.block.error" value="0.025" />
+ <property name="com.vaadin.testbench.debug" value="false" />
+
+
+ <parallel>
+ <daemons>
+ <ant antfile="vaadin-server.xml" inheritall="true" inheritrefs="true" target="deploy-and-start" />
+ </daemons>
+ <sequential>
+ <ant antfile="vaadin-server.xml" target="wait-for-startup" />
+ <antcall inheritall="true" inheritrefs="true" target="run-and-clean-up" />
+ </sequential>
+ </parallel>
+ </target>
</project>