* Adjust code for run ztf script.

This commit is contained in:
tanghucheng
2022-12-16 09:47:06 +08:00
parent 1505cb89e4
commit 1078a9f3e7
6 changed files with 22 additions and 12 deletions
+5 -2
View File
@@ -296,15 +296,18 @@ function runAutocase()
var url = createLink('zanode', 'ajaxRunZTFScript', 'scriptID=' + automation)
var postData = {'caseIDList' : caseIDList.join(',')};
var response = true;
$.post(url, postData, function(result)
{
if(result.result == 'fail')
{
alert(result.message);
return false;
response = false;
}
return true;
}, 'json');
return response;
}
function confirmAction(obj)
+4 -2
View File
@@ -176,15 +176,17 @@ function runAutocase()
var url = createLink('zanode', 'ajaxRunZTFScript', 'scriptID=' + automation)
var postData = {'caseIDList' : caseIDList.join(',')};
var response = true;
$.post(url, postData, function(result)
{
if(result.result == 'fail')
{
alert(result.message);
return false;
response = false;
}
return true;
}, 'json');
return response;
}
function confirmAction(obj)
+7 -1
View File
@@ -1381,7 +1381,13 @@ class testtask extends control
/* Set modules. */
$moduleOptionMenu = array(0 => '/');
foreach($cases as $case) $moduleOptionMenu += $this->tree->getModulesName($case->module);
foreach($cases as $caseID => $case)
{
if($case->auto == 'auto' and $confirm == 'yes') unset($cases[$caseID]);
$moduleOptionMenu += $this->tree->getModulesName($case->module);
}
if(empty($cases)) return print(js::locate($url));
$this->view->moduleOptionMenu = $moduleOptionMenu;
/* If case has changed and not confirmed, remove it. */
-4
View File
@@ -39,11 +39,7 @@
<td class='text-left wordwrap'><?php echo "<span title='{$case->title}'>{$case->title}</span>"?></td>
<td class='text-left precondition wordwrap'><?php echo "<span title='{$case->precondition}'>{$case->precondition}</span>"?></td>
<td class='text-left'>
<?php if($confirm == 'yes'):?>
<?php echo html::hidden("results[$caseID]", '');?>
<?php else:?>
<?php echo html::radio("results[$caseID]", $this->lang->testcase->resultList, 'pass', "onclick='showAction(this.value,\".action$caseID\")'", 'block')?>
<?php endif;?>
</td>
<td>
<?php if(!empty($steps[$caseID])):?>
+5 -2
View File
@@ -177,15 +177,18 @@ function runAutocase()
var url = createLink('zanode', 'ajaxRunZTFScript', 'scriptID=' + automation)
var postData = {'caseIDList' : caseIDList.join(',')};
var response = true;
$.post(url, postData, function(result)
{
if(result.result == 'fail')
{
alert(result.message);
return false;
response = false;
}
return true;
}, 'json');
return response;
}
function confirmAction(obj)
+1 -1
View File
@@ -736,7 +736,7 @@ class zanodemodel extends model
);
$result = json_decode(commonModel::http("http://{$node->ip}:{$node->ztf}/api/v1/jobs/add", json_encode($params), array(), array("Authorization:$node->tokenSN")));
if(empty($result->data) || $result->code != 0)
if($result->code != 0)
{
$this->dao->delete()->from(TABLE_TESTRESULT)->where('id')->eq($task)->exec();
return dao::$errors = $this->lang->zanode->runTimeout;