Creating a schedule for multiple testsuites
Accessing the label of a schedule
Creating a schedule for multiple testsuites
In a continuous integration environment, you need multiple testsuites to run in one go. Molybdenums allows you to group arbitrary testsuites to so called schedules. A schedule is a simple XML file referencing test suites via file: or http: protocol, absolute or relative. It looks like this:
<?xml version="1.0"?> <schedule> <suite uri="actions/testActionResolving.xml"/> <suite uri="async/async.xml"/> <suite uri="components/componentTest.xml"/> <suite uri="dogfood.xml"/> <suite uri="gui/guiTest.xml"/> <!-- etc. --> </schedule>
If you don't want to maintain your schedules manually, you can assemble them automatically from testcases on your file system. This is how it looks in ANT:
<!--assembling, you could introduce multiple profiles here -->
<fileset id="schedule" dir="${basedir}/testcases">
<include name="**/*.xml" />
</fileset>
<property name="schedule-list" refid="schedule" />
<!-- write to file -->
<property environment="env"/>
<mkdir dir="${build.dir}/testcases/"/>
<echo file="${build.dir}/testcases/schedule.xml"
message="<schedule><suite uri='${schedule-list}'/></schedule>" />
<replace file="${build.dir}/testcases/schedule.xml"
token=";"
value="'/>${env.line.separator}<suite uri='" />
Accessing the label of a schedule
Single testsuites or schedules grouping multiple suites can have a label. Typically you want to create it from your CI server marking a set of testscripts and eventually more (testcases, testdata, config files etc.) as related and referring to a well defined state later on.
A label can be stored in any Variable using the "storeEval" command and accessing "treeView.label" (a javascript expression):
<selenium-testsuite label="build_trunk_4711" loops="1">
<test name="testAccessingLabel" desc="outputs label given in scheulde" open="true">
<command command="storeEval" target="treeView.label" value="myLabel" desc=""/>
<command command="echo" target="Label is: ${myLabel}" value="" desc=""/>
<tags/>
</test>
</selenium-testsuite>
outputs
Tests
testAccessingLabel (19:15:23 - 19:15:23 | 132 ms)Details
testAccessingLabel (19:15:23 - 19:15:23 | 132 ms)
storeEvaltreeView.labelmyLabel (19:15:23 - 19:15:23 | 81 ms)
echoLabel is: ${myLabel} (19:15:23 - 19:15:23 | 51 ms){bgColor:yellow}
Message
Label is: build_trunk_4711
Resolved variables in target:
myLabel='build_trunk_4711'
{bgColor}
