* fix the bug for testtask(runcase, results and create Bug).
This commit is contained in:
+16
-8
@@ -394,18 +394,26 @@ class bugModel extends model
|
||||
$bugSteps = "<p>[" . $this->lang->testcase->precondition . "]</p>" . "\n" . $run->case->precondition;
|
||||
}
|
||||
$bugSteps .= $this->lang->bug->tplStep;
|
||||
foreach($caseSteps as $key => $step)
|
||||
if(!empty($stepResults))
|
||||
{
|
||||
$bugSteps .= ($key + 1) . '. ' .$step->desc . "\n";
|
||||
if($stepResults[$step->id]['result'] == 'fail')
|
||||
foreach($caseSteps as $key => $step)
|
||||
{
|
||||
$bugSteps .= $this->lang->bug->tplResult;
|
||||
$bugSteps .= $stepResults[$step->id]['real'] . "\n";
|
||||
$bugSteps .= $this->lang->bug->tplExpect;
|
||||
$bugSteps .= $step->expect;
|
||||
break;
|
||||
$bugSteps .= ($key + 1) . '. ' .$step->desc . "<br />";
|
||||
if($stepResults[$step->id]['result'] == 'fail')
|
||||
{
|
||||
$bugSteps .= $this->lang->bug->tplResult;
|
||||
$bugSteps .= $stepResults[$step->id]['real'] . "<br />";
|
||||
$bugSteps .= $this->lang->bug->tplExpect;
|
||||
$bugSteps .= $step->expect;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$bugSteps .= $this->lang->bug->tplResult;
|
||||
$bugSteps .= $this->lang->bug->tplExpect;
|
||||
}
|
||||
}
|
||||
return array('title' => $title, 'steps' => $bugSteps, 'storyID' => $run->case->story);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ $lang->task->index = "任务一览";
|
||||
$lang->task->create = "新增任务";
|
||||
$lang->task->batchCreate = "批量添加任务";
|
||||
$lang->task->import = "导入之前未完任务";
|
||||
$lang->task->edit = "更新任务";
|
||||
$lang->task->edit = "编辑任务";
|
||||
$lang->task->delete = "删除任务";
|
||||
$lang->task->view = "查看任务";
|
||||
$lang->task->logEfforts = "记录工时";
|
||||
|
||||
@@ -208,7 +208,7 @@ class testtaskModel extends model
|
||||
$caseResult = 'pass';
|
||||
if(!$this->post->passall)
|
||||
{
|
||||
if(isset($this->post->steps))
|
||||
if($this->post->steps)
|
||||
{
|
||||
foreach($this->post->steps as $stepID => $stepResult)
|
||||
{
|
||||
@@ -226,7 +226,7 @@ class testtaskModel extends model
|
||||
}
|
||||
|
||||
/* Create result of every step. */
|
||||
if(isset($this->post->steps))
|
||||
if($this->post->steps)
|
||||
{
|
||||
foreach($this->post->steps as $stepID =>$stepResult)
|
||||
{
|
||||
|
||||
@@ -27,15 +27,21 @@
|
||||
<th class='w-p20'><?php echo $lang->testcase->real;?></th>
|
||||
</tr>
|
||||
<?php foreach($run->case->steps as $key => $step):?>
|
||||
<?php $stepResult = (object)$result->stepResults[$step->id];?>
|
||||
<?php $stepResult = ''; if(!empty($result->stepResults)) $stepResult = (object)$result->stepResults[$step->id];?>
|
||||
<tr>
|
||||
<th><?php echo $key + 1;?></th>
|
||||
<td><?php echo nl2br($step->desc);?></td>
|
||||
<td><?php echo nl2br($step->expect);?></td>
|
||||
<?php if(!empty($result->stepResults)):?>
|
||||
<td class='<?php echo $stepResult->result;?> a-center'><?php echo $lang->testcase->resultList[$stepResult->result];?></td>
|
||||
<td><?php echo $stepResult->real;?></td>
|
||||
</tr>
|
||||
<?php if($stepResult->result == 'blocked' or $stepResult->result == 'fail') break;?>
|
||||
<?php else:?>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
<?php endforeach;?>
|
||||
|
||||
Reference in New Issue
Block a user