testkit-lite-2.2.0-3 testkit-lite-ww30release-2.2.0-3
authortestkit <testkit@elva-desktop.(none)>
Tue, 31 Jul 2012 09:32:46 +0000 (17:32 +0800)
committertestkit <testkit@elva-desktop.(none)>
Tue, 31 Jul 2012 09:32:46 +0000 (17:32 +0800)
  modify index and manualharness to make test widgets display better
  support readable test case list and test results in browser

ChangeLog
MANIFEST
TODO
setup.cfg
setup.py
testkitlite/engines/default/runner.py
web/index.html
web/manualharness.html
xsd/resultstyle.xsl [new file with mode: 0644]
xsd/tests.css [new file with mode: 0644]

index 0549cda..5c44d94 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+ Tue Jul 26 2012 Zhang Huihui <huihuix.zhang@intel.com> 2.2.0-3
+  - modify index and manualharness to make test widgets display better
+  - add suppor to view test result in XSL format
  Tue Jul 12 2012 Zhang Huihui <huihuix.zhang@intel.com> 2.2.0-2
   - Fix bug: can't be installed by command 'rpm -ivh'
   - change option -A from --all to --auto-only
index 29feb24..b65ca5e 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -27,3 +27,5 @@ web/index.html
 web/jquery.js
 web/manualharness.html
 xsd/test_definition.xsd
+xsd/tests.css
+xsd/resultstyle.xsl
diff --git a/TODO b/TODO
index 6423a35..dd7a1b0 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,5 +1,7 @@
 TODO:
 ========
-1. add --verbose and logging level.
-2. support html view when execute manual test
+1. add --verbose and logging level
+2. remove text result
+3. add --version option
+4. support both core and webapi packages
 
index c22cd6c..f20e95e 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -2,13 +2,16 @@
 install-scripts = /usr/bin
 install-lib = /usr/lib/python2.7/site-packages
 [bdist_rpm]
-release = 2
+release = 3
 packager = huihuix.zhang@intel.com
 requires = python
 pre_install = preinstall
 install_script = fakeinstall
 post_install = postinstall
-changelog = * Tue Jul 12 2012 Zhang Huihui <huihuix.zhang@intel.com> 2.2.0-2
+changelog = * Tue Jul 26 2012 Zhang Huihui <huihuix.zhang@intel.com> 2.2.0-3
+  - modify index and manualharness to make test widgets display better
+  - add suppor to view test result in XSL format
+ Tue Jul 12 2012 Zhang Huihui <huihuix.zhang@intel.com> 2.2.0-2
   - Fix bug: can't be installed by command "rpm -ivh"
   - change option A from "all" to "auto-only"
  Tue Jul 7 2012 Zhang Huihui <huihuix.zhang@intel.com> 2.2.0-1
index 0095026..c81a8d9 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,7 @@ import glob
 from distutils.core import setup
 
 if platform.system() == "Linux":
-    data_files = [('/opt/testkit/lite/xsd', ['xsd/test_definition.xsd']),
+    data_files = [('/opt/testkit/lite/xsd', ['xsd/test_definition.xsd', 'xsd/tests.css', 'xsd/resultstyle.xsl']),
             ('/opt/testkit/lite/', ['LICENSE']),
             ('/opt/testkit/lite/', ['README']),
             ('/opt/testkit/web/', ['web/jquery.js', 'web/index.html', 'web/manualharness.html']),
index efd2672..9a648e4 100644 (file)
@@ -125,6 +125,13 @@ class TRunner:
                 if _e(resultfile):
                    # report the result using xml mode
                     print "[ generate the result(XML): %s ]" % resultfile
+                    # add XSL support to testkit-lite
+                    first_line = os.popen("head -n 1 %s" % resultfile).readlines()
+                    first_line = '<?xml-stylesheet type="text/xsl" href="./resultstyle.xsl"?>' + first_line[0]
+                    os.system("sed -i '1c " + first_line + "' " + resultfile)
+                    os.system("cp /opt/testkit/lite/xsd/tests.css " + resultdir)
+                    os.system("cp /opt/testkit/lite/xsd/resultstyle.xsl " + resultdir)
+                    
                     print "[ generate the result(TXT): %s ]" % textfile
                     print self.textreport.report(resultfile)
                     open(textfile, "w+").write(self.textreport.report(resultfile))
index 981b750..69a04a2 100644 (file)
@@ -466,7 +466,9 @@ function doTest()
         if (test_page == last_test_page)
             return;
 
-
+       if((current_page_uri.indexOf("2DTransforms") != -1) || (current_page_uri.indexOf("3DTransforms") != -1)) {
+                parent.document.getElementById("testframe").height = 500000 + "px";
+        }  
         oTestFrame.src = current_page_uri;
        last_test_page = test_page;
 
@@ -481,6 +483,7 @@ function doManualTest(){
         var iTemp1 = 0, iTemp2 = 0;
         while(iTemp1 < Tests.length) {
                 if ($(Tests[iTemp1]).attr('execution_type') == 'manual'){
+                       parent.document.getElementById("statusframe").height = 385 + "px";
                         manualcaseslist[iTemp2] = new manualcases();
                         manualcaseslist[iTemp2].casesid = $(Tests[iTemp1]).attr('id');
                         manualcaseslist[iTemp2].index = iTemp1;
@@ -573,7 +576,7 @@ table#results td {\
     }
 
     resultXML += "<h2>Details</h2>";
-    resultXML += "<form method='post' id='resultform'> <textarea id='results' style='width: 100%; height: 800px;' name='filecontent'>" + save_result() + "</textarea></form>";
+    resultXML += "<form method='post' id='resultform'> <textarea id='results' style='width: 80%; height: 90%;' name='filecontent' disabled='disabled'>" + save_result() + "</textarea></form>";
     setTimeout("window.open('','_self','');window.close()", winCloseTimeout);
     results.document.writeln(resultXML);
 }
@@ -599,7 +602,8 @@ function save_result()
 </head>
 <script>
 </script> 
-<frameset id="main" rows="100,*" onload='init()'>
-<frame frameborder="1" id="statusframe" scrolling="auto" />
-<frame frameborder="0" id="testframe" scrolling="auto" />
-</frameset>
+<body id="main" onload='init()' >                                      
+<iframe frameborder="1" height="100px" width="100%" id="statusframe" ></iframe>
+<iframe frameborder="1" height="2500px" width="100%" id="testframe" ></iframe>
+</body> 
+</html>
index 842b516..3b2eb75 100644 (file)
@@ -26,17 +26,23 @@ body {
 }
 
 div#manualharness {
-        box-sizing:border-box;
-        width:100%;
-        border:0px;
-        text-align: left;
-        background: teal;
-        color: white;
+       box-sizing:border-box;
+       width:100%;
+       border:0px;
+       text-align: left;
+       background: teal;
+       color: white;
 }
 
 textarea#casesinfo{
         width: 99%;
+        font-size: 20px;
 }
+
+input,lable,select{
+       font-size: 28px;
+}
+
 </style>
 <script src="jquery.js"></script>
 <script>
@@ -222,18 +228,24 @@ function failLabel(){
 </script>
 </head>
 <body onload="initManual()">
-<div id="manualharness">
-<input type="button" id="prevbutton" value="<< Prev" onclick="prevTest()"/>
-<select id="caseslist" onchange="listUpdate()">
+<div id="manualharness" >
+<input type="button" style="width:12%" id="prevbutton" value="<< Prev" onclick="prevTest()"/>
+<select id="caseslist" style="width:61%" onchange="listUpdate()">
 </select>
-<input type="button" id="runbutton" value="Run" onclick="runTest()"/>
+<input type="button" style="width:12%" id="nextbutton" value="Next >>" onclick="nextTest()"/>
+<input type="button" style="width:14%" id="runbutton" value="Run" onclick="runTest()"/>
+</div>
+<div width=100%>
+<textarea id="casesinfo" rows=12 disabled='disabled' />
+</textarea>
+</div>
+<div style="width:100%;text-align:right;background-color:#cccccc;">
 <input type="radio" id="passradio" value="Pass" onclick="passRadio()"/><label onclick="passLabel()">Pass</label>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <input type="radio" id="failradio" value="Fail" onclick="failRadio()"/><label onclick="failLabel()">Fail</label>
-<input type="button" id="nextbutton" value="Next >>" onclick="nextTest()"/>
-<input type="button" id="submitbutton" value="Submit" onclick="submitTest()"/>
-<input type="button" id="completebutton" value="Complete" onclick="completeTest()"/><br>
-<textarea id="casesinfo" readonly="readonly" rows=5 />
-</textarea>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+<input type="button" style="width:12%" id="submitbutton" value="Save" onclick="submitTest()"/>
+<input type="button" style="width:12%" id="completebutton" value="Done" onclick="completeTest()"/><br>
 </div>
 </body>
 </html>
diff --git a/xsd/resultstyle.xsl b/xsd/resultstyle.xsl
new file mode 100644 (file)
index 0000000..f860469
--- /dev/null
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+       <xsl:output method="html" version="1.0" encoding="UTF-8"
+               indent="yes" />
+       <xsl:template match="/">
+               <html>
+                       <STYLE type="text/css">
+                               @import "tests.css";
+                       </STYLE>
+
+                       <body>
+                               <div id="page">
+                                       <div id="index_page">
+                                               <div id="title">
+                                                       <table>
+                                                               <tr>
+                                                                       <td class="title">
+                                                                               <h1 align="center">Test Report</h1>
+                                                                       </td>
+                                                               </tr>
+                                                       </table>
+                                               </div>
+                                               <div id="suite">
+                                                       <xsl:for-each select="test_definition/suite">
+                                                               <xsl:sort select="@name" />
+                                                               <p>
+                                                                       Test Suite:
+                                                                       <xsl:value-of select="@name" />
+                                                               </p>
+                                                               <table>
+                                                                       <tr>
+                                                                               <th>Case_ID</th>
+                                                                               <th>Purpose</th>
+                                                                               <th>Result</th>
+                                                                               <th>Stdout</th>
+                                                                       </tr>
+                                                                       <xsl:for-each select=".//set">
+                                                                               <xsl:sort select="@name" />
+                                                                               <tr>
+                                                                                       <td colspan="4">
+                                                                                               Test Set:
+                                                                                               <xsl:value-of select="@name" />
+                                                                                       </td>
+                                                                               </tr>
+                                                                               <xsl:for-each select=".//testcase">
+                                                                                       <xsl:sort select="@id" />
+                                                                                       <tr>
+                                                                                               <td>
+                                                                                                       <xsl:value-of select="@id" />
+                                                                                               </td>
+                                                                                               <td>
+                                                                                                       <xsl:value-of select="@purpose" />
+                                                                                               </td>
+
+                                                                                               <xsl:if test="@result = 'FAIL'">
+                                                                                                       <td class="red_rate">
+                                                                                                               <xsl:value-of select="@result" />
+                                                                                                       </td>
+                                                                                               </xsl:if>
+                                                                                               <xsl:if test="@result != 'FAIL'">
+                                                                                                       <td class="green_rate">
+                                                                                                               <xsl:value-of select="@result" />
+                                                                                                       </td>
+                                                                                               </xsl:if>
+                                                                                               <td>
+                                                                                                       <xsl:value-of select=".//result_info/stdout" />
+                                                                                                       <xsl:if test=".//result_info/stdout = ''">
+                                                                                                               N/A
+                                                                                                       </xsl:if>
+                                                                                               </td>
+                                                                                       </tr>
+                                                                               </xsl:for-each>
+                                                                       </xsl:for-each>
+                                                               </table>
+                                                       </xsl:for-each>
+                                               </div>
+                                       </div>
+                               </div>
+                       </body>
+               </html>
+       </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/xsd/tests.css b/xsd/tests.css
new file mode 100644 (file)
index 0000000..c3cd42a
--- /dev/null
@@ -0,0 +1,159 @@
+@charset "UTF-8";
+/* CSS Document */
+
+/* @group General styles */
+
+/* @group reset */
+html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,code,del,dfn,em,img,q,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,input
+       {
+       margin: 0;
+       padding: 0;
+       border: 0;
+       font-weight: inherit;
+       font-style: inherit;
+       font-size: 0.96em;
+       font-family: arial;
+       vertical-align: baseline;
+}
+
+p {
+       text-align: left;
+}
+
+table {
+       border-collapse: separate;
+       border-spacing: 0;
+}
+
+caption,th,td {
+       text-align: left;
+       font-weight: normal;
+}
+
+table,td,th {
+       vertical-align: middle;
+}
+
+table {
+       margin-bottom: 1.4em;
+       width: 100%;
+}
+
+th {
+       border-bottom: 1px solid #eee;
+       background-color: #0000FF;
+}
+
+th a,th {
+       color: #fff;
+}
+
+th {
+       font-weight: bold;
+       vertical-align: bottom;
+}
+
+th:first-child {
+       border-left-style: none;
+}
+
+td:first-child {
+       border-left: none;
+}
+
+th,td,caption {
+       padding: 4px 10px 4px 5px;
+}
+
+td {
+       border-left: 1px solid #ccc;
+       border-top: 1px solid #ccc;
+       font-weight: normal;
+       
+       border-bottom: 1px solid #eee;
+       background-color: #99BBFF;
+}
+
+td.title{
+       background-color: #FFF;
+}
+
+td.yellow_rate {
+       background-color: #ffcc00;
+}
+
+td.green_rate {
+       background-color: #33cc33;
+}
+
+td.dgreen_rate {
+       background-color: #339933;
+}
+
+td.red_rate {
+       background-color: #FF3333;
+}
+
+tr td:first-child {
+       border-left: none;
+}
+
+/* @group basic typography */
+h1,h2,h3 {
+       font-family: Arial, sans-serif;
+       font-weight: bold;
+}
+
+h1 {
+       font-size: 2em;
+       line-height: 1;
+       color: #000;
+       margin-bottom: 0.75em;
+       padding-top: 0.25em;
+}
+
+h1 em {
+       font-style: normal;
+       color: #909090;
+}
+
+h2 {
+       font-size: 1.6666em;
+       line-height: 1;
+       color: #000;
+       margin: 1.0em 0 0.5em 0;
+       border-top: 1px solid #ccc;
+       padding-top: 20px;
+}
+
+h2 small {
+       font-size: .55em;
+       font-weight: normal;
+       margin-left: 1em;
+       display: inline-block;
+       vertical-align: middle;
+}
+
+h3 {
+       font-size: 1.3333em;
+       line-height: 1.125;
+       color: #000;
+       margin-bottom: 1em;
+}
+
+h4 {
+       font-size: 1.2em;
+       line-height: 1.25;
+       margin-bottom: 1.25em;
+}
+
+h5 {
+       font-size: 1em;
+       font-weight: bold;
+       margin-bottom: 1.5em;
+}
+
+h6 {
+       font-size: 1em;
+       font-weight: bold;
+}
\ No newline at end of file