From dcfecf3d1544300fa49cd086f98081b62742438c Mon Sep 17 00:00:00 2001 From: testkit Date: Mon, 15 Oct 2012 21:34:58 +0800 Subject: [PATCH] testkit-lite 2.2.5-1 - add BLOCK logic for webapi's result --- ChangeLog | 2 ++ setup.cfg | 6 +++-- setup.py | 2 +- testkit-lite | 5 ++-- web/index.html | 77 +++++++++++++++++++++++++++++++--------------------------- 5 files changed, 51 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index edec074..f291bea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ + Tue Oct 10 2012 Zhang Huihui 2.2.5-1 + - add BLOCK logic for webapi's result Tue Sep 29 2012 Zhang Huihui 2.2.4-4 - update pdf files Tue Sep 28 2012 Zhang Huihui 2.2.4-3 diff --git a/setup.cfg b/setup.cfg index f5467b6..cbfb5a2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,13 +2,15 @@ install-scripts = /usr/bin install-lib = /usr/lib/python2.7/site-packages [bdist_rpm] -release = 4 +release = 1 packager = huihuix.zhang@intel.com requires = python pre_install = preinstall install_script = fakeinstall post_install = postinstall -changelog = * Tue Sep 29 2012 Zhang Huihui 2.2.4-4 +changelog = * Tue Oct 10 2012 Zhang Huihui 2.2.5-1 + - add BLOCK logic for webapi's result + Tue Sep 29 2012 Zhang Huihui 2.2.4-4 - update pdf files Tue Sep 28 2012 Zhang Huihui 2.2.4-3 - add Known Issues section in README diff --git a/setup.py b/setup.py index 0c8c79d..e51cfbd 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ else: setup(name='testkit-lite', description='command line test execution framework', - version='2.2.4', + version='2.2.5', long_description='', author='Zhang, Huihui', author_email='huihuix.zhang@intel.com', diff --git a/testkit-lite b/testkit-lite index 489643e..6f232ec 100755 --- a/testkit-lite +++ b/testkit-lite @@ -96,7 +96,7 @@ except Exception, e: # detect version option if "--version" in sys.argv: - print "[ testkit-lite v2.2.4-4 ]" + print "[ testkit-lite v2.2.5-1 ]" sys.exit(1) #get test engine, now we only got default engine @@ -181,7 +181,8 @@ Note: \n\ 2) TestLog is stored to %s/latest\n\ 3) %%prog enables both auto and manual tests by default\n\ 4) Obviously -A and -M are conflict options\n\ - 5) -e option does not support -D mode" % (LOG_DIR) + 5) -e option does not support -D mode\n\ + 6) The test cases' order in the result files might be arbitrary, when running same tests.xml with same options. This is caused by python's API 'getiterator' from module 'xml.etree.ElementTree'" % (LOG_DIR) except: usage = None diff --git a/web/index.html b/web/index.html index 47a59cc..cc0cfdd 100644 --- a/web/index.html +++ b/web/index.html @@ -55,7 +55,7 @@ var last_test_page = ""; var current_page_uri = ""; - var activetest = true; + var activetest = true; var manualcases = function() { this.casesid = ""; @@ -253,7 +253,8 @@ if (runTime < timeout) setTimeout("CheckResult()", pollTime); else - report('FAIL', "Test time out"); + // timeout, set result to BLOCK + report('BLOCK', "Test time out"); } function CheckResult() { @@ -315,14 +316,15 @@ for (i = 0; i < fails.length; i++) { var desccell = fails[i].childNodes[1]; if (desccell) - message += "###Test###" - + desccell.innerText; + message += "###Test Start###" + + desccell.innerText + + "###Test End###"; var msgcell = fails[i].childNodes[2]; if (msgcell) - message += "###Error###" - + msgcell.innerText; + message += "###Error1 Start###" + + msgcell.innerText + + "###Error1 End###"; } - report('FAIL', message); } } else if (locator_key == "test_name") { @@ -345,10 +347,13 @@ for (i = 0; i < fails.length; i++) { var desccell = fails[i].childNodes[1]; if (desccell) - message += "###Test###" + desccell.innerText; + message += "###Test Start###" + + desccell.innerText + "###Test End###"; var msgcell = fails[i].childNodes[2]; if (msgcell) - message += "###Error###" + msgcell.innerText; + message += "###Error2 Start###" + + msgcell.innerText + + "###Error2 End###"; } } report('FAIL', message); @@ -368,7 +373,7 @@ else report('FAIL', otxt.trim()); } else - report('FAIL', 'No body tag'); + report('BLOCK', 'No body tag'); }, error : function() { check_timeout(); @@ -379,7 +384,7 @@ } else check_timeout(); // not complete } catch (e) { - report('FAIL', message); + report('BLOCK', message); } } @@ -407,12 +412,12 @@ iTest++; - //alert("Reporting result:" + result + "; and if continue testing:" + activetest); - if(activetest){ - doTest(); - }else{ - activetest = true; - } + //alert("Reporting result:" + result + "; and if continue testing:" + activetest); + if (activetest) { + doTest(); + } else { + activetest = true; + } } function doTest() { @@ -472,14 +477,14 @@ test_page = current_page_uri; // Don't load the same test page again - //alert("Testing page: " + test_page + "; Previous_page: " + last_test_page); - //alert("No: " + iTest); - if (test_page == last_test_page){ - activetest = false; - //alert("Continue:" + activetest); - CheckResult(); - continue; - } + //alert("Testing page: " + test_page + "; Previous_page: " + last_test_page); + //alert("No: " + iTest); + if (test_page == last_test_page) { + activetest = false; + //alert("Continue:" + activetest); + CheckResult(); + continue; + } if ((current_page_uri.indexOf("2DTransforms") != -1) || (current_page_uri.indexOf("3DTransforms") != -1)) { @@ -487,19 +492,19 @@ } oTestFrame.src = current_page_uri; last_test_page = test_page; - //alert("Prepare onload.collback"); - if (oTestFrame.attachEvent){ - oTestFrame.attachEvent("onload", function(){ - CheckResult(); - }); - } else { - oTestFrame.onload = function(){ - CheckResult(); - }; - } + //alert("Prepare onload.collback"); + if (oTestFrame.attachEvent) { + oTestFrame.attachEvent("onload", function() { + CheckResult(); + }); + } else { + oTestFrame.onload = function() { + CheckResult(); + }; + } return; - + } doManualTest(); -- 2.7.4