ATokeley
15 years agoContributor
Generating testcase reports from SOAPUI projects
Hi Guys,
I've implemented a workaround for creating more readable versions of my test suites for members of my team who don't want to open soapui in order to check the latest set of test cases in my projects. I have a scheduled task that grabs the latest versions of my files from source control, uses an xslt to transform the SOAPUI project xml files and then publishes them to a shared web server which my team can access at any time.
I created this process as not all team members want to launch SOAPUI when reviewing testcases and also, it meant we could easily print out lists of the testcases for review/audits.
I wasn't able to find a process for doing this. However I've yet to really give the reports aspect of SOAPUI a proper run-through.
Anyway, I thought I'd share the xslt with you guys. A) so you could feedback on any issues you find and B) in case it's something other may find useful.
Excuse the styling. I'm not a designer. It was just meant to be quick and easy.
Cheers,
- Richard
I've implemented a workaround for creating more readable versions of my test suites for members of my team who don't want to open soapui in order to check the latest set of test cases in my projects. I have a scheduled task that grabs the latest versions of my files from source control, uses an xslt to transform the SOAPUI project xml files and then publishes them to a shared web server which my team can access at any time.
I created this process as not all team members want to launch SOAPUI when reviewing testcases and also, it meant we could easily print out lists of the testcases for review/audits.
I wasn't able to find a process for doing this. However I've yet to really give the reports aspect of SOAPUI a proper run-through.
Anyway, I thought I'd share the xslt with you guys. A) so you could feedback on any issues you find and B) in case it's something other may find useful.
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Edited by XMLSpy® -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:con="http://eviware.com/soapui/config">
<xsl:output method="html" encoding ="utf-8"/>
<xsl:template match="/">
<html>
<head>
<script type="text/javascript">
function toggleDiv(divid){
var ele = document.getElementById(divid);
if(ele.style.display == 'none')
{
ele.style.display = 'block';
}
else
{
ele.style.display = 'none';
}
}
</script>
<style type="text/css">
h1 {
font-family: Helvetica,sans-serif,Arial;
background: fixed url(http://photos2.meetupstatic.com/photos/sponsor/5/6/2/3/iab120x90_82051.jpeg) no-repeat top right;
background-color:#33A2D2;
color:white;
margin-top: 2%;
padding-top: 10px;
padding-left: 10px;
font-size: 140%;
height:40px;
}
h2.ex {
font-size: 90%;
color:white;
font-family: Helvetica,Arial,sans-serif;
font-weight: 200;
line-height: 2.0;
text-decoration: none;
margin-top: 0%;
margin-right: 0%;
margin-bottom: 0%;
background-color:#797F85;
padding-left: 14px;
padding-bottom: 0px;
cursor:hand;
}
li.tc {
font-size: 90%;
font-family: Arial,Helvetica,sans-serif;
line-height: 1.4;
margin-top: 0%;
margin-bottom: 0%;
padding-left: 7px;
margin-left: -35px;
list-style-type:none;
}
ol.step {
font-size: 90%;
font-family: Arial,Helvetica,sans-serif;
line-height: 1.0;
margin-top: 0%;
margin-bottom: 0%;
padding-left: 7px;
margin-left: 25px;
}
p.descSuite {
font-size: 90%;
font-family: Arial,Helvetica,sans-serif;
line-height: 1.4;
border: 1px dotted grey;
background-color:#F0F0F0;
margin-top: -15px;
margin-bottom: 20px;
margin-left: 10px;
padding-left: 7px;
}
p.descTc {
font-size: 90%;
font-family: Arial,Helvetica,sans-serif;
line-height: 1.4;
border: 1px dotted grey;
background-color:#F0F0F0;
margin-top: 0px;
margin-bottom: 10px;
margin-left: 10px;
padding-left: 7px;
}
p.warn {
font-size: 90%;
font-family: Arial,Helvetica,sans-serif;
color:blue;
font-weight: 300;
margin-top: 10px;
}
div.help {
font-size: 90%;
font-family: Arial,Helvetica,sans-serif;
line-height: 1.4;
border: 1px dotted grey;
margin-top: 0%;
margin-bottom: 2%;
margin-left: 10px;
padding: 5px;
background-color:#FFFF99;
font-size:80%;
}
</style>
</head>
<body>
<xsl:apply-templates/>
<div class="help">This report is generated automatically by a scheduled job running on Richard Fortune's machine. The SOAPUI project files it references are located in sourcecontrol SVN (https://svn.xxx.xxxxxx.xx/svn/network/TEST). These reports are generated daily as the projects they reference are subject to updates.</div>
</body>
</html>
</xsl:template>
<xsl:template match="con:soapui-project">
<div><h1>Project Name : <xsl:value-of select="@name"/></h1></div>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="con:testSuite">
<xsl:if test="con:description=''">
<p class="warn"> (RICHARD - PLEASE PROVIDE A DESCRIPTION!!)</p>
</xsl:if>
<div id="content" onmousedown="toggleDiv('{position()}');"><h2 class="ex">TestSuite: <xsl:value-of select="@name"/></h2></div>
<br>
<p class="descSuite"><b>Suite Description: </b><xsl:value-of select="con:description"/></p>
</br>
<div style="display:none" id="{position()}"><xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="con:testCase">
<ul>
<li class="tc"><b>
(#<xsl:value-of select="position()-3"/>) Testcase: </b><xsl:value-of select="@name"/>
</li>
<xsl:if test="con:description=''">
<p class="warn">(Gentle reminder Richard - PLEASE PROVIDE A DESCRIPTION!!)</p>
</xsl:if>
<p class="descTc">
<strong><i>Description:</i></strong> <xsl:value-of select="con:description"/>
</p>
<ol class="step">
<xsl:for-each select="con:testStep"><li>TestStep: <xsl:value-of select="@name"/> </li></xsl:for-each>
</ol>
</ul>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="*"></xsl:template>
</xsl:stylesheet>
Excuse the styling. I'm not a designer. It was just meant to be quick and easy.
Cheers,
- Richard