remove recordScript bugs

This commit is contained in:
luqiong 2014-09-03 18:11:49 +08:00
parent 06a1d745f2
commit 39b11dcf18
7 changed files with 41 additions and 31 deletions

View File

@ -39,7 +39,6 @@ agentManage_jsp_addAgent=Add Agent
portManage_jsp_addPort=Add Port
configuredmessage=Here settings can be configured
startserver=Start Server
stoprecording=Stop Recording
savefile=Save File
editscript=Edit Script
savechanges=Save
@ -200,9 +199,7 @@ edit=Edit
script-submitScript=Submit Script
test-editScript=Edit Script
test-iptip=Please input right ip address
filterStatic=Filter Static Resources
filterTime=Filter Think Time
staticTip=The static resources contains:js,css,jpeg,gif,png files.
timeTipe=The Think time refers the time between tow behaviors.
startServer=start server to generate a script or upload a script to server
testExecuteTime=Execute Time
@ -211,4 +208,4 @@ stopTestPlan=Stop Test
stop=Stop
testProxySettings=testProxySettings
startRecording=startRecording
startrecording=start recording to generate a script or upload a script to server
stopRecording=Stop Recording

View File

@ -39,7 +39,6 @@ agentManage_jsp_addAgent=\u6DFB\u52A0\u4EE3\u7406
portManage_jsp_addPort=\u6DFB\u52A0\u7AEF\u53E3
configuredmessage=\u5728\u8FD9\u91CC\u53EF\u4EE5\u914D\u7F6E
startserver=\u542F\u52A8\u670D\u52A1\u5668
stoprecording=\u505C\u6B62\u5f55\u5236
savefile=\u4FDD\u5B58\u6587\u4EF6
editscript=\u7F16\u8F91\u811A\u672C
savechanges=\u4FDD\u5B58
@ -202,9 +201,7 @@ edit=\u7F16\u8F91
script-submitScript=\u4FDD\u5B58\u811A\u672C
test-editScript=\u7F16\u8F91\u811A\u672C
test-iptip=\u8BF7\u8F93\u5165\u6B63\u786E\u7684IP\u5730\u5740
filterStatic=\u8FC7\u6EE4\u9759\u6001\u8D44\u6E90
filterTime=\u8FC7\u6EE4\u601D\u8003\u65F6\u95F4
staticTip=\u9759\u6001\u8D44\u6E90\u4E3B\u8981\u662F\u6307:js,css,jpeg,gif,png\u6587\u4EF6\u3002
timeTip=\u601D\u8003\u65F6\u95F4\u6307\u7684\u662F\u7528\u6237\u4E24\u4E2A\u8FDE\u7EED\u884C\u4E3A\u4E4B\u95F4\u7684\u95F4\u9694\u65F6\u95F4
startServer=\u70B9\u51FB\u542F\u52A8\u670D\u52A1\u5F55\u5236\u811A\u672C\u6216\u8005\u4E0A\u4F20\u811A\u672C\u6587\u4EF6
testExecuteTime=\u6267\u884C\u65F6\u95F4
@ -212,4 +209,4 @@ stopTestPlan=\u505C\u6B62\u6D4B\u8BD5
stop=\u505C\u6B62
testProxySettings=\u6d4b\u8bd5Proxy\u8bbe\u7f6e
startRecording=\u5f00\u59cb\u5f55\u5236
startrecording=\u70b9\u51fb\u5f00\u59cb\u5f55\u5236\u5f55\u5236\u811a\u672c
stopRecording=\u505C\u6B62\u5f55\u5236

View File

@ -46,5 +46,5 @@ saveScriptSuccess=Save successfully.
saveScriptFail=Fail to save script.
plugin_jsp_addPage=Add Page
stopTestPlan_fail=Stop running test plan fail
RecordingScript=Recording Script
stoprecord=click stop script recording to stop recording script
startRecordingMessage=Please click start recording
stopRecordingMessage=Please click stop recording

View File

@ -42,5 +42,5 @@ saveScriptSuccess=\u4FDD\u5B58\u6210\u529F\u3002
saveScriptFail=\u4FDD\u5B58\u811A\u672C\u5931\u8D25
plugin_jsp_addPage=\u52A0\u9875
stopTestPlan_fail=\u505C\u6B62\u8FD0\u884C\u6D4B\u8BD5\u8BA1\u5212\u5931\u8D25
RecordingScript=\u6b63\u5728\u5f55\u5236\u811a\u672c
stoprecord=\u70b9\u51fb\u505c\u6b62\u5f55\u5236\u505c\u6b62\u5f55\u5236\u811a\u672c
startRecordingMessage=\u8bf7\u70b9\u51fb\u5f00\u59cb\u5f55\u5236
stopRecordingMessage=\u8bf7\u70b9\u51fb\u505c\u6b62\u5f55\u5236

View File

@ -204,8 +204,8 @@ body {
<fmt:message key="startRecording" />
</button>
<button type="button" class="btn btn-primary"
onClick="stopServer()" id="stopServer">
<fmt:message key="stopserver" />
onClick="stopRecording()" id=stopRecording>
<fmt:message key="stopRecording" />
</button>
</div>
<div id="fileName" class="modal-footer none-div">

View File

@ -1,5 +1,8 @@
var server = null;
var table = $("#scriptTab").DataTable();
var startRecordingSuccess = false;
var startServerSuccess = false;
var stopServerSuccess = false;
function startServer() {
$.post("startRecordServer", {}, function(data) {
@ -13,7 +16,11 @@ function startServer() {
$.i18n.prop("setProxy")+
" IP:133.133.2.100"
+ " ,port: " + server.port
+ $.i18n.prop("recordScript"));
+ $.i18n.prop("recordScript"))
$('#stopRecording').attr('disabled', false);
$('#startRecording').attr('disabled', false);
startServerSuccess = true;
stopServerSuccess = false;
} else {
$('#scriptInfo').html(
$.i18n.prop("startServerFail") + data.failedMessage);
@ -30,15 +37,17 @@ function startRecording() {
if (!data.success) {
$('#scriptInfo3').text(
"start recording error:" + data.failedMessage);
$('#stopServer').attr('disabled', false);
$('#stopRecording').attr('disabled', false);
$('#startRecording').attr('disabled', true);
}
else {
$('#scriptInfo3').text($.i18n.prop("stopRecord"));
$('#scriptInfo3').text($.i18n.prop("stopRecordingMessage"));
var url = $('#target-url2').val();
window.open(url);
$('#stopServer').attr('disabled', false);
$('#stopRecording').attr('disabled', false);
$('#startRecording').attr('disabled', true);
startRecordingSuccess = true;
stopServerSuccess = false;
}
}, "json");
} else {
@ -55,20 +64,21 @@ function stopRecording() {
if (!data.success) {
$('#scriptInfo3').text(
"stop record server error:" + data.failedMessage);
$('#stopServer').attr('disabled', true);
$('#startServer').attr('disabled', false);
$('#stopRecording').attr('disabled', true);
$('#startRecording').attr('disabled', false);
}
else {
$('#stopServer').attr('disabled', true);
$('#scriptInfo3').text(
$.i18n.prop("stoprecord")
);
$('#scriptInfo3').text($.i18n.prop("stopRecord"));
$('#stopRecording').attr('disabled', true);
$('#fileName').show();
stopServer();
stopServerSuccess = true;
startRecordingSuccess = false;
}
}, "json");
} else {
$('#scriptInfo3').text("record script server has not started");
}
stopServer();
}
function stopServer() {
@ -80,11 +90,12 @@ function stopServer() {
if (!data.success) {
$('#scriptInfo3').text(
"stop record server error:" + data.failedMessage);
$('#stopServer').attr('disabled', true);
$('#startServer').attr('disabled', false);
$('#stopRecording').attr('disabled', true);
$('#startRecording').attr('disabled', false);
}
else {
$('#fileName').show();
stopServerSuccess = true;
startServerSuccess = false;
}
}, "json");
} else {
@ -98,7 +109,7 @@ function testRecordProxy() {
$('#mySecondModal').modal('hide');
$('#myThirdModal').modal('show');
$('#scriptInfo3').text(
$.i18n.prop("RecordingScript"));
$.i18n.prop("startRecordingMessage"));
} else {
$("#ProxySettingMessage").attr("class","show");
}

View File

@ -5,7 +5,12 @@ $('.btn-setting').click(function(e) {
function dismiss(container){
$(container).modal('hide');
stopServer();
if(startRecordingSuccess && !stopServerSuccess){
stopRecording();
$('#fileName').hide();
}
if(startServerSuccess && !stopServerSuccess)
stopServer();
}
$('#uploadScript')
@ -41,7 +46,7 @@ $('#uploadScript')
$(document).ready(function() {
addEvent(table);
loadScript(table);
$('#stopServer').attr('disabled', true);
$('#stopRecording').attr('disabled', true);
});
function refresh() {