* Add auto test of testcase and fix bug.

This commit is contained in:
liumengyi
2022-04-08 15:44:22 +08:00
parent a56b1a77c9
commit 8b2a7bee76
12 changed files with 572 additions and 92 deletions
+10 -6
View File
@@ -1247,9 +1247,9 @@ class testcaseModel extends model
else
{
/* Compare every step. */
foreach($oldStep as $id => $oldStep)
foreach($oldStep as $id => $step)
{
if(trim($oldStep->desc) != trim($steps[$id]->desc) or trim($oldStep->expect) != $steps[$id]->expect)
if(trim($step->desc) != trim($steps[$id]->desc) or trim($step->expect) != $steps[$id]->expect)
{
$stepChanged = true;
break;
@@ -1388,10 +1388,14 @@ class testcaseModel extends model
if($module != 'ditto') $prevModule = $module;
if($module == 'ditto') $data->module[$i] = $prevModule;
}
foreach($data->branch as $i => $branch)
if(isset($data->branch))
{
if($branch != 'ditto') $prevBranch = $branch;
if($branch == 'ditto') $data->branch[$i] = $prevBranch;
foreach($data->branch as $i => $branch)
{
if($branch != 'ditto') $prevBranch = $branch;
if($branch == 'ditto') $data->branch[$i] = $prevBranch;
}
}
$libCases = $this->dao->select('*')->from(TABLE_CASE)->where('deleted')->eq(0)->andWhere('id')->in($data->caseIdList)->fetchAll('id');
@@ -1889,7 +1893,7 @@ class testcaseModel extends model
if($methodName == 'review')
{
$status = zget($case, 'status', $status);
$status = zget($case, 'status', '');
if($this->post->result == 'pass') return 'normal';