~dhillon-v10/qa-regression-testing/mago-packages-checking

« back to all changes in this revision

Viewing changes to report.xsl

  • Committer: Vikram Dhillon
  • Date: 2010-01-12 02:42:18 UTC
  • Revision ID: dhillonv10@gmail.com-20100112024218-7ntl2wrpbxqjb3kx
Initial commit: getting in the data from mago

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="ISO-8859-1"?>
 
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
3
  <xsl:template match="/">
 
4
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
 
5
      <head>
 
6
        <title>
 
7
    Mago Tests Report
 
8
</title>
 
9
<style>
 
10
 
 
11
body
 
12
{
 
13
        line-height: 1.6em;
 
14
    margin: 45px;
 
15
        font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
 
16
        font-size: 12px;
 
17
}
 
18
p
 
19
{
 
20
 
 
21
}
 
22
 
 
23
h4
 
24
{
 
25
line-height: 20%;
 
26
color: #039;
 
27
}
 
28
 
 
29
h1
 
30
{
 
31
line-height: 20%;
 
32
color: #34679D;
 
33
}
 
34
 
 
35
#mago-table
 
36
{
 
37
        font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
 
38
        font-size: 12px;
 
39
        margin: 45px;
 
40
        text-align: left;
 
41
        border-collapse: collapse;
 
42
}
 
43
#mago-table th
 
44
{
 
45
        font-size: 13px;
 
46
        font-weight: normal;
 
47
        padding: 8px;
 
48
        background: #B3B3E6;
 
49
        border-bottom: 5px solid #fff;
 
50
        color: #039;
 
51
}
 
52
#mago-table td
 
53
{
 
54
        padding: 8px;
 
55
        background: #eef; 
 
56
        border-bottom: 1px solid #fff;
 
57
        color: #669;
 
58
        border-top: 1px solid transparent;
 
59
}
 
60
#mago-table tr:hover td
 
61
{
 
62
        background: #d0dafd;
 
63
        color: #339;
 
64
}
 
65
 
 
66
dd {
 
67
    color: #34679D;
 
68
    font-weight: bold;
 
69
    margin-left: 0;
 
70
}
 
71
 
 
72
dt {
 
73
    color: #666;
 
74
    margin-left: 2em;
 
75
}
 
76
 
 
77
td.result-pass {
 
78
    color: green !important;
 
79
}
 
80
 
 
81
td.result-fail {
 
82
    color: red !important;
 
83
}
 
84
 
 
85
td.result-error {
 
86
    color: orange !important;
 
87
}
 
88
 
 
89
</style>
 
90
    <script type="text/javascript">
 
91
     function ReverseDisplay(d) {
 
92
        if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
 
93
        else { document.getElementById(d).style.display = "none"; }
 
94
      }
 
95
    </script>
 
96
      </head>
 
97
      <body>
 
98
          <h1>Mago Tests Report</h1>
 
99
          <p>
 
100
                  This are the results from a run of Mago Desktop Tests.
 
101
                  If you find false positives, please, report bugs against <a href="https://launchpad.net/mago/+filebug">Mago</a> project.
 
102
              </p>
 
103
                      <dl>
 
104
              <dd>Suite</dd>
 
105
                          <dt><xsl:value-of select="suite/@name" /></dt>
 
106
                          <dd>Class</dd>
 
107
                          <dt><xsl:value-of select="suite/class" /></dt>
 
108
              <dd>Description</dd>
 
109
                          <dt><xsl:value-of select="suite/description"/></dt>
 
110
                          </dl>
 
111
              <table id="mago-table">
 
112
                <thead>
 
113
                  <tr>
 
114
                    <th>TestCase Name</th>
 
115
                    <th>Description</th>  
 
116
                    <th>Method</th>
 
117
                    <th>Status</th>
 
118
                    <th>Time Elapsed (s)</th>
 
119
                    <th>Message</th>
 
120
                    <th>Screenshot</th>
 
121
                    <th>Stacktrace</th>
 
122
                  </tr>
 
123
                </thead>
 
124
                <tbody>
 
125
                    <xsl:for-each select="descendant::case">  
 
126
                      <tr>
 
127
                        <td>
 
128
                          <xsl:value-of select="@name"/>
 
129
                        </td>
 
130
                        <td>
 
131
                          <xsl:value-of select="child::description"/>
 
132
                        </td>
 
133
                        <td>
 
134
                          <xsl:value-of select="child::method"/>
 
135
                        </td>
 
136
                        <xsl:for-each select="descendant::result">  
 
137
                        <xsl:choose>
 
138
                          <xsl:when test="child::error/child::text() = 1">
 
139
                            <td class="result-error">Script Error</td>
 
140
                          </xsl:when>
 
141
                          <xsl:when test="child::pass/child::text() = 0">
 
142
                            <td class="result-fail">Test Failed</td>
 
143
                          </xsl:when>
 
144
                          <xsl:otherwise>
 
145
                            <td class="result-pass">Passed</td>
 
146
                          </xsl:otherwise>
 
147
                        </xsl:choose>
 
148
                        <td>
 
149
                            <xsl:value-of select="child::time/child::text()"/>
 
150
                        </td>
 
151
                        <td>
 
152
                            <xsl:value-of select="child::message/child::text()"/>
 
153
                        </td>
 
154
                        <td>
 
155
                            <xsl:apply-templates select="child::screenshot" mode="link"/>
 
156
                        </td>
 
157
                        <td>
 
158
                            <xsl:if test="child::pass/child::text() != 1 or child::error/child::text() = 1">
 
159
                                <xsl:call-template name="stacktemplate">
 
160
                                    <xsl:with-param name="stackid">
 
161
                                        <xsl:value-of select="translate(../@name, ' ', '_')" />
 
162
                                    </xsl:with-param>
 
163
                                    <xsl:with-param name="stacktext">
 
164
                                        <xsl:value-of select="child::stacktrace/child::text()" />
 
165
                                    </xsl:with-param>
 
166
                                </xsl:call-template>
 
167
                            </xsl:if>
 
168
                        </td>
 
169
                        </xsl:for-each>
 
170
                      </tr>
 
171
                  </xsl:for-each>
 
172
                  
 
173
                  <xsl:for-each select="suite/result">
 
174
                      <tr></tr>
 
175
                      <tr>
 
176
                          <td colspan="7"><font color="red"><h2><b>The suite had an error in the setup, teardown or cleanup methods.</b></h2></font></td>
 
177
                          <td>
 
178
                            <xsl:call-template name="stacktemplate">
 
179
                                <xsl:with-param name="stackid">
 
180
                                    <xsl:value-of select="string('testsuite_stacktrace')" />
 
181
                                </xsl:with-param>
 
182
                                <xsl:with-param name="stacktext">
 
183
                                    <xsl:value-of select="child::stacktrace/child::text()" />
 
184
                                </xsl:with-param>
 
185
                            </xsl:call-template>
 
186
                        </td>                        
 
187
                      </tr>
 
188
                  </xsl:for-each>
 
189
                </tbody>
 
190
              </table>
 
191
              <p>
 
192
                <!-- *** Last Paragraph Space *** -->
 
193
              </p>
 
194
      </body>
 
195
    </html>
 
196
  </xsl:template>
 
197
  <xsl:template match="screenshot" mode="link">
 
198
    <a href="{text()}">
 
199
      <xsl:value-of select="text()"/>
 
200
    </a>
 
201
  </xsl:template>
 
202
  <xsl:template name="stacktemplate">
 
203
      <xsl:param name="stackid" />
 
204
      <xsl:param name="stacktext" />
 
205
      <a href="javascript:ReverseDisplay('{$stackid}')">
 
206
          [Show/Hide Stacktrace]
 
207
      </a>
 
208
      <div id="{$stackid}" style="display:none;">
 
209
       <pre>
 
210
          <xsl:value-of select="$stacktext" />
 
211
      </pre>
 
212
      </div>
 
213
 </xsl:template>
 
214
</xsl:stylesheet>