From a8d498df493a032aedd60e46e958540239ce1152 Mon Sep 17 00:00:00 2001 From: PengfeiLi0218 Date: Mon, 7 Jan 2019 22:22:57 +0800 Subject: [PATCH] #38 Run button should be written as "Run" (it's currently "Test") #39 Delete button should be Red, not green Run button should be green #40 BASE_URL should be renamed to OAUTH_BASE_URL --- apitester/apitester/settings.py | 2 +- apitester/obp/views.py | 2 +- apitester/runtests/static/runtests/js/runtests.js | 3 +++ apitester/runtests/templates/runtests/index.html | 10 +++++----- apitester/runtests/views.py | 7 +------ 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/apitester/apitester/settings.py b/apitester/apitester/settings.py index 74d22b7..764cb03 100644 --- a/apitester/apitester/settings.py +++ b/apitester/apitester/settings.py @@ -210,4 +210,4 @@ # Settings here might use parts overwritten in local settings API_ROOT = API_HOST + API_BASE_PATH + API_VERSION -BASE_URL='http://127.0.0.1:8000' \ No newline at end of file +OAUTH_BASE_URL='http://127.0.0.1:8000' \ No newline at end of file diff --git a/apitester/obp/views.py b/apitester/obp/views.py index 447d7ab..45e167f 100644 --- a/apitester/obp/views.py +++ b/apitester/obp/views.py @@ -52,7 +52,7 @@ def get_callback_uri(self, request): initiation at OAuth server """ #base_url = '{}://{}'.format(request.scheme, request.environ['HTTP_HOST']) - base_url = settings.BASE_URL + base_url = settings.OAUTH_BASE_URL uri = base_url + reverse('oauth-authorize') if 'next' in request.GET: uri = '{}?next={}'.format(uri, request.GET['next']) diff --git a/apitester/runtests/static/runtests/js/runtests.js b/apitester/runtests/static/runtests/js/runtests.js index 069a64f..944ab50 100644 --- a/apitester/runtests/static/runtests/js/runtests.js +++ b/apitester/runtests/static/runtests/js/runtests.js @@ -49,11 +49,13 @@ $(function() { } } }); + $('.runner button.forTest').click(function() { var runner = $(this).parent().parent().parent(); $(runner).find('.result').empty(); runTest(runner); }); + $('.runner button.forSave').click(function() { var t = $(this) var runner = $(this).parent().parent().parent(); @@ -131,6 +133,7 @@ $(function() { $('#checkNone').click(function() { $('.runner').find('input').prop('checked', false); }); + $('#checkAll').click(function() { $('.runner').find('input').prop('checked', true); }); diff --git a/apitester/runtests/templates/runtests/index.html b/apitester/runtests/templates/runtests/index.html index d384157..fb67d3e 100644 --- a/apitester/runtests/templates/runtests/index.html +++ b/apitester/runtests/templates/runtests/index.html @@ -129,7 +129,8 @@

{{ config.name }}

-
+
+
@@ -155,16 +156,15 @@

{{ config.name }}

{% endif %}
order:
-
runs num:
{{ call.method |upper}}
- +
- - saved. + + saved.
diff --git a/apitester/runtests/views.py b/apitester/runtests/views.py index 1f05256..dc94115 100644 --- a/apitester/runtests/views.py +++ b/apitester/runtests/views.py @@ -321,18 +321,13 @@ def get_context_data(self, **kwargs): 'success': False, }) - num_runs = int(config['num_runs']) - if not config['found']: msg = 'Unknown path {}!'.format(kwargs['testpath']) context['messages'].append(msg) return context try: - for i in range(num_runs): - result = self.run_test(config) - LOGGER.log(logging.INFO,result) - time.sleep(t) + result = self.run_test(config) except APIError as err: context['messages'].append(err) return context