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

fixed issue 586 #587

Merged
merged 3 commits into from
Jan 8, 2020
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
7 changes: 5 additions & 2 deletions public/js/app/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1165,11 +1165,14 @@ var ctrl = angular.module("mockapp.controllers", ['mockapp.services', 'mockapp.f
delay: service.delay,
delayMax: service.delayMax,
txnCount: service.txnCount,
basePath: service.basePath,
basePath: service.basePath
};

$scope.base_URL=rootScope.mockiatoHost + '/virtual' + $scope.servicevo.basePath;

if(service.running)$scope.isServiceRunning='#333';
else $scope.isServiceRunning='rgba(255,0,0,0.73)';

if($scope.servicevo.delayMax === null){
$scope.servicevo.delayMax = 0;
}
Expand Down Expand Up @@ -1322,7 +1325,7 @@ var ctrl = angular.module("mockapp.controllers", ['mockapp.services', 'mockapp.f
message.headerLength = Object.keys(message.headers()).length;
$scope.restClientResponse = message;
});
}
}
}])

.controller('apiTestingController', ['$scope', 'suggestionsService', 'domManipulationService', 'apiTestService',
Expand Down
1 change: 0 additions & 1 deletion public/partials/apitesting.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ <h2>API Testing</h2>
<select ng-model="tabs[selectedTab].method" ng-init="tabs[selectedTab].method = 'GET'">
<option value="GET" ng-value="'GET'">GET</option>
<option value="POST" ng-value="'POST'">POST</option>
<option value="UPDATE" ng-value="'UPDATE'">UPDATE</option>
<option value="DELETE" ng-value="'DELETE'">DELETE</option>
<option value="PATCH" ng-value="'PATCH'">PATCH</option>
<option value="PUT" ng-value="'PUT'">PUT</option>
Expand Down
2 changes: 1 addition & 1 deletion public/partials/includes/restClientRRPairs.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@

<br>
<div class="col-sm-12">
<button type="button" title="Test Request" class="btn btn-primary left-block" ng-click="callApi(rr)">Send&emsp;<span class="glyphicon glyphicon-play"></span></button>
<button type="button" title="Test Request" class="btn btn-primary left-block" ng-disabled="isServiceRunning !== '#333'" ng-click="callApi(rr)">Send&emsp;<span class="glyphicon glyphicon-play"></span></button>
</div>
<br><br><br><br>

Expand Down
3 changes: 2 additions & 1 deletion public/partials/restClient.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<h2>Test Service</h2>
<h2 ng-style="{'color':isServiceRunning}">Test Service</h2>
<p class="text-muted" style='font-size: 10.5px;color: rgba(255,0,0,0.73)' ng-show="isServiceRunning !== '#333'">**This service is stopped.</p>
<p>You can test your mocked service here. There are individual requests below service detail section. To test a request each request section has a <b>Send</b> button.</p>
<br>

Expand Down
3 changes: 2 additions & 1 deletion routes/virtual.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ function registerRRPair(service, rrpair) {
if (rrpair.reqHeaders) {
let matchedHeaders = true;
const expectedHeaders = Object.entries(rrpair.reqHeaders);

logEvent(path, label, 'expected Headers: ' + expectedHeaders);
logEvent(path, label, 'received Headers: ' + Object.entries(req.headers));
expectedHeaders.forEach(function(keyVal) {
// skip content-type header
if (keyVal[0].toLowerCase() !== 'content-type') {
Expand Down