disable stop-testplan button when test plan completed
This commit is contained in:
parent
25c9af9af1
commit
f030705b35
|
@ -28,26 +28,33 @@ $(function() {
|
|||
chartSelector.initChart();
|
||||
graphButtonListener(chartSelector);
|
||||
UrlContentTypeDistribution("pie-chart", testPlanRunId);
|
||||
$("#stop-testplan").click(function() {
|
||||
if ($("#status").attr("status") == "InRunning") {
|
||||
$.post("stop/" + testPlanRunId, {}, function(data) {
|
||||
if (data.success) {
|
||||
$('#status').attr("status", "Complete");
|
||||
var testStatus = testStatusMap("Complete");
|
||||
$('#status').html("<h4>" + testStatus + '</h4>');
|
||||
} else {
|
||||
information($.i18n("stopTestPlan_fail"));
|
||||
}
|
||||
|
||||
}).error(function(){
|
||||
information($.i18n.prop('failed-connect-server'));
|
||||
});
|
||||
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if(testPlan.currentStatus == "Complete"){
|
||||
$("#stop-testplan").attr('disabled', true);
|
||||
}else{
|
||||
$("#stop-testplan").attr('disabled', false);
|
||||
$("#stop-testplan").click(function() {
|
||||
if ($("#status").attr("status") == "InRunning") {
|
||||
$.post("stop/" + testPlanRunId, {}, function(data) {
|
||||
if (data.success) {
|
||||
$('#status').attr("status", "Complete");
|
||||
var testStatus = testStatusMap("Complete");
|
||||
$('#status').html("<h4>" + testStatus + '</h4>');
|
||||
$("#stop-testplan").attr('disabled', true);
|
||||
} else {
|
||||
information($.i18n("stopTestPlan_fail"));
|
||||
}
|
||||
|
||||
}).error(function(){
|
||||
information($.i18n.prop('failed-connect-server'));
|
||||
});
|
||||
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
function getTestInfo(testPlanId) {
|
||||
var testPlan;
|
||||
|
|
Loading…
Reference in New Issue