fix #104: popup ids are the same in default template

This commit is contained in:
debugtalk
2018-02-26 23:16:36 +08:00
parent 68227f6c0e
commit b3d4eecdfd
4 changed files with 9 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
__title__ = 'HttpRunner' __title__ = 'HttpRunner'
__description__ = 'HTTP test runner, not just about api test and load test.' __description__ = 'HTTP test runner, not just about api test and load test.'
__url__ = 'https://github.com/HttpRunner/HttpRunner' __url__ = 'https://github.com/HttpRunner/HttpRunner'
__version__ = '0.9.6' __version__ = '0.9.6a1'
__author__ = 'debugtalk' __author__ = 'debugtalk'
__author_email__ = 'mail@debugtalk.com' __author_email__ = 'mail@debugtalk.com'
__license__ = 'MIT' __license__ = 'MIT'

View File

@@ -173,8 +173,6 @@ class Runner(object):
finally: finally:
setup_teardown(teardown_actions) setup_teardown(teardown_actions)
return getattr(self.http_client_session, "meta_data", {})
def extract_output(self, output_variables_list): def extract_output(self, output_variables_list):
""" extract output variables """ extract output variables
""" """

View File

@@ -12,12 +12,14 @@ class TestCase(unittest.TestCase):
super(TestCase, self).__init__() super(TestCase, self).__init__()
self.test_runner = test_runner self.test_runner = test_runner
self.testcase_dict = testcase_dict self.testcase_dict = testcase_dict
self.meta_data = {}
def runTest(self): def runTest(self):
""" run testcase and check result. """ run testcase and check result.
""" """
self.meta_data = self.test_runner.run_test(self.testcase_dict) try:
self.test_runner.run_test(self.testcase_dict)
finally:
self.meta_data = getattr(self.test_runner.http_client_session, "meta_data", {})
class TestSuite(unittest.TestSuite): class TestSuite(unittest.TestSuite):
""" create test suite with a testset, it may include one or several testcases. """ create test suite with a testset, it may include one or several testcases.

View File

@@ -177,8 +177,8 @@
<td style="text-align:center;width:6em;">{{ '%0.1f'| format(record.response_time|float) }} ms</td> <td style="text-align:center;width:6em;">{{ '%0.1f'| format(record.response_time|float) }} ms</td>
<td class="detail"> <td class="detail">
<a class="button" href="#popup_log">log</a> <a class="button" href="#popup_log_{{loop.index}}">log</a>
<div id="popup_log" class="overlay"> <div id="popup_log_{{loop.index}}" class="overlay">
<div class="popup"> <div class="popup">
<h2>Request and Response data</h2> <h2>Request and Response data</h2>
<a class="close" href="#">&times;</a> <a class="close" href="#">&times;</a>
@@ -187,8 +187,8 @@
</div> </div>
{% if record.attachment %} {% if record.attachment %}
<a class="button" href="#popup_attachment">traceback</a> <a class="button" href="#popup_attachment_{{loop.index}}">traceback</a>
<div id="popup_attachment" class="overlay"> <div id="popup_attachment_{{loop.index}}" class="overlay">
<div class="popup"> <div class="popup">
<h2>Traceback Message</h2> <h2>Traceback Message</h2>
<a class="close" href="#">&times;</a> <a class="close" href="#">&times;</a>