From b9684cba8fc072f3a022b2e19f10d9c0a1fdc5f4 Mon Sep 17 00:00:00 2001 From: testkit Date: Tue, 31 Jul 2012 17:32:46 +0800 Subject: [PATCH] testkit-lite-2.2.0-3 modify index and manualharness to make test widgets display better support readable test case list and test results in browser --- ChangeLog | 3 + MANIFEST | 2 + TODO | 6 +- setup.cfg | 7 +- setup.py | 2 +- testkitlite/engines/default/runner.py | 7 ++ web/index.html | 16 ++-- web/manualharness.html | 42 +++++---- xsd/resultstyle.xsl | 83 ++++++++++++++++++ xsd/tests.css | 159 ++++++++++++++++++++++++++++++++++ 10 files changed, 301 insertions(+), 26 deletions(-) create mode 100644 xsd/resultstyle.xsl create mode 100644 xsd/tests.css diff --git a/ChangeLog b/ChangeLog index 0549cda..5c44d94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ + Tue Jul 26 2012 Zhang Huihui 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 2.2.0-2 - Fix bug: can't be installed by command 'rpm -ivh' - change option -A from --all to --auto-only diff --git a/MANIFEST b/MANIFEST index 29feb24..b65ca5e 100644 --- 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 --- 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 diff --git a/setup.cfg b/setup.cfg index c22cd6c..f20e95e 100644 --- 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 2.2.0-2 +changelog = * Tue Jul 26 2012 Zhang Huihui 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 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 2.2.0-1 diff --git a/setup.py b/setup.py index 0095026..c81a8d9 100644 --- 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']), diff --git a/testkitlite/engines/default/runner.py b/testkitlite/engines/default/runner.py index efd2672..9a648e4 100644 --- a/testkitlite/engines/default/runner.py +++ b/testkitlite/engines/default/runner.py @@ -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 = '' + 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)) diff --git a/web/index.html b/web/index.html index 981b750..69a04a2 100644 --- a/web/index.html +++ b/web/index.html @@ -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 += "

Details

"; - resultXML += "
"; + resultXML += "
"; setTimeout("window.open('','_self','');window.close()", winCloseTimeout); results.document.writeln(resultXML); } @@ -599,7 +602,8 @@ function save_result() - - - - + + + + + diff --git a/web/manualharness.html b/web/manualharness.html index 842b516..3b2eb75 100644 --- a/web/manualharness.html +++ b/web/manualharness.html @@ -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; +} + -
- - + - + + +
+
+ +
+
+      - - -
- +       + +
diff --git a/xsd/resultstyle.xsl b/xsd/resultstyle.xsl new file mode 100644 index 0000000..f860469 --- /dev/null +++ b/xsd/resultstyle.xsl @@ -0,0 +1,83 @@ + + + + + + + + +
+
+
+ + + + +
+

Test Report

+
+
+
+ + +

+ Test Suite: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Case_IDPurposeResultStdout
+ Test Set: + +
+ + + + + + + + + + + N/A + +
+
+
+
+
+ + +
+
\ No newline at end of file diff --git a/xsd/tests.css b/xsd/tests.css new file mode 100644 index 0000000..c3cd42a --- /dev/null +++ b/xsd/tests.css @@ -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 -- 2.7.4