* ajusted ui of testcase/results.

This commit is contained in:
Catouse
2014-07-31 08:27:26 +08:00
parent 2762a4a7fb
commit 678e0cbae3
5 changed files with 86 additions and 43 deletions
+54 -35
View File
@@ -16,7 +16,7 @@
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['usecase']);?> <strong><?php echo $case->id;?></strong></span>
<strong><?php echo $case->title;?></strong>
<small class='text-info'><?php echo $lang->testtask->results . ' ' . html::icon($lang->icons['result']);?></small>
<small class='text-muted'><?php echo $lang->testtask->results . ' ' . html::icon($lang->icons['result']);?></small>
</div>
</div>
@@ -25,42 +25,61 @@
<legend><?php echo $lang->testcase->precondition;?></legend>
<?php echo $case->precondition;?>
</fieldset>
<?php foreach($results as $result):?>
<table class='table table-condensed table-hover table-striped'>
<caption class='text-left bd-0'>
<?php if(isset($build)):?><div class='pull-right'><?php echo $lang->testtask->build . $lang->colon . $build;?></div>
<div id='casesResults'>
<table class='table table-condensed table-hover' style='border: 1px solid #ddd'>
<caption class='text-left' style='border: 1px solid #ddd; border-bottom: none;'>
<?php if(isset($build)):?>
<div class='pull-right'><strong class='text-important'><?php echo $lang->testtask->build . $lang->colon . $build;?></strong></div>
<?php endif; ?>
RESULT#<?php echo $result->id . ' ' . $result->date . ' ' . $users[$result->lastRunner] . ' ' . $lang->testtask->runCase . ':'. " <span class='$result->caseResult'>" . $lang->testcase->resultList[$result->caseResult] . '</span>';?>
</caption>
<thead>
<tr>
<th class='w-40px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p40'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p20'><?php echo $lang->testcase->stepExpect;?></th>
<th><?php echo $lang->testcase->result;?></th>
<th class='w-p20'><?php echo $lang->testcase->real;?></th>
<strong><span><?php echo count($results);?></span> <?php echo $lang->testcase->result?></strong>
</caption>
<?php foreach($results as $result):?>
<?php $class = ($result->caseResult == 'pass' ? 'success' : ($result->caseResult == 'fail' ? 'danger' : ($result->caseResult == 'blocked' ? 'warning' : ''))); ?>
<tr class='result-item <?php echo $class?>' style='cursor: pointer'>
<td class='w-120px'> &nbsp; <i class='icon-circle<?php if($result->caseResult == 'n/a') echo '-empty';?> text-<?php echo $class;?>'></i> RESULT#<?php echo $result->id?></td>
<td class='w-180px'><?php echo $result->date;?></td>
<td><?php echo $users[$result->lastRunner] . ' ' . $lang->testtask->runCase;?></td>
<td class='text-right'><strong class='text-<?php echo $class;?>'><?php echo $lang->testcase->resultList[$result->caseResult]?></strong></td>
<td class='w-50px text-center'><i class='collapse-handle icon-chevron-down text-muted'></i></td>
</tr>
</thead>
<?php
$i = 1;
foreach($result->stepResults as $key => $stepResult):
?>
<tr>
<td class='w-30px text-center'><?php echo $i;?></td>
<td><?php if(isset($stepResult['desc'])) echo nl2br($stepResult['desc']);?></td>
<td><?php if(isset($stepResult['expect'])) echo nl2br($stepResult['expect']);?></td>
<?php if(!empty($stepResult['result'])):?>
<td class='<?php echo $stepResult['result'];?> text-center'><?php echo $lang->testcase->resultList[$stepResult['result']];?></td>
<td><?php echo $stepResult['real'];?></td>
</tr>
<?php else:?>
<td></td>
<td></td>
</tr>
<?php endif; $i++;?>
<?php endforeach;?>
</table>
<?php endforeach;?>
<tr class='result-detail hide'>
<td colspan='5' class='pd-0'>
<table class='table table-condensed borderless mg-0'>
<thead>
<tr>
<th class='w-40px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p40'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p20'><?php echo $lang->testcase->stepExpect;?></th>
<th><?php echo $lang->testcase->result;?></th>
<th class='w-p20'><?php echo $lang->testcase->real;?></th>
</tr>
</thead>
<?php
$i = 1;
foreach($result->stepResults as $key => $stepResult):
?>
<tr>
<td class='w-30px text-center'><?php echo $i;?></td>
<td><?php if(isset($stepResult['desc'])) echo nl2br($stepResult['desc']);?></td>
<td><?php if(isset($stepResult['expect'])) echo nl2br($stepResult['expect']);?></td>
<?php if(!empty($stepResult['result'])):?>
<td class='<?php echo $stepResult['result'];?> text-center'><?php echo $lang->testcase->resultList[$stepResult['result']];?></td>
<td><?php echo $stepResult['real'];?></td>
</tr>
<?php else:?>
<td></td>
<td></td>
</tr>
<?php endif; $i++;?>
<?php endforeach;?>
</table>
</td>
</tr>
<?php endforeach;?>
</table>
<style>.table-hover tr.result-detail:hover td {background: #fff}</style>
</div>
</div>
</div>
<?php include '../../common/view/footer.lite.html.php';?>