Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some html page bugs fixed #41

Merged
merged 2 commits into from
Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apitester/apitester/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
OAUTH_BASE_URL='http://127.0.0.1:8000'
2 changes: 1 addition & 1 deletion apitester/obp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
3 changes: 3 additions & 0 deletions apitester/runtests/static/runtests/js/runtests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -131,6 +133,7 @@ $(function() {
$('#checkNone').click(function() {
$('.runner').find('input').prop('checked', false);
});

$('#checkAll').click(function() {
$('.runner').find('input').prop('checked', true);
});
Expand Down
10 changes: 5 additions & 5 deletions apitester/runtests/templates/runtests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ <h2>{{ config.name }}</h2>
<div class="col-xs-12 col-sm-2">
<button class="btn btn-default form-control" id="checkAll" />Check all</button>
</div>
<div class="col-xs-12 col-sm-4">
<div class="col-xs-2">
<label>runs num: </label><input type="text" name="numRun" size="1" value=1 />
</div>
</div>
</div>
Expand All @@ -155,16 +156,15 @@ <h2>{{ config.name }}</h2>
{% endif %}
</div>
<div class="col-xs-1">order: <input class="form-control" type="text" name="order" size="1" value="{{ call.order }}" /></div>
<div class="col-xs-1">runs num: <input class="form-control" type="text" name="numRun" size="1" value=1 /></div>
<div class="col-xs-1"><input class="form-control" type="hidden" name="replica_id" size="1" value="{{ call.replica_id }}" /></div>
<div class="col-xs-1">{{ call.method |upper}}<input class="form-control" type="hidden" name="method" size="1" value="{{ call.method }}" /></div>
<div class="col-xs-1 col-sm-1">
<button class="btn btn-default forTest" id="forTest">Test</button>
<button class="btn btn-success forTest" id="forTest">Run</button>
<button class="btn btn-default forCopy" id="forCopy">Copy</button>
</div>
<div class="col-xs-1 col-sm-1">
<button class="btn btn-success forDelete" id="forDelete">Delete</button>
<button class="btn btn-success forSave" id="forSave">Save</button><span style="display: none;margin-left: 5px;background-color:#00cc00">saved.</span>
<button class="btn btn-success forDelete" style="background: red;" id="forDelete">Delete</button>
<button class="btn btn-default forSave" id="forSave">Save</button><span style="display: none;margin-left: 5px;background-color:#00cc00">saved.</span>
</div>
<div class="col-xs-12 col-sm-9 result"></div>

Expand Down
6 changes: 1 addition & 5 deletions apitester/runtests/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,17 +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)
result = self.run_test(config)
except APIError as err:
context['messages'].append(err)
return context
Expand Down