* ajusted ui of testcase/results.
This commit is contained in:
@@ -703,6 +703,8 @@ class testtask extends control
|
||||
$this->view->nextCase = $nextCase;
|
||||
$this->view->results = $this->testtask->getResults(0, $caseID);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed, noletter');
|
||||
$this->view->caseID = $caseID;
|
||||
$this->view->version = $version;
|
||||
|
||||
die($this->display());
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
body{background:white}
|
||||
body{background:white;}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
$(function()
|
||||
{
|
||||
$('.result-item').click(function()
|
||||
{
|
||||
var $this = $(this);
|
||||
$this.toggleClass('show-detail');
|
||||
var show = $this.hasClass('show-detail');
|
||||
$this.next('.result-detail').toggleClass('hide', !show);
|
||||
$this.find('.collapse-handle').toggleClass('icon-chevron-down', !show).toggleClass('icon-chevron-up', show);;
|
||||
});
|
||||
});
|
||||
@@ -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'> <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';?>
|
||||
|
||||
|
||||
@@ -66,11 +66,22 @@
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
ob_start();
|
||||
$case = $run->case; include './results.html.php';
|
||||
$results = ob_get_contents();
|
||||
ob_clean();
|
||||
echo preg_replace("/<h1>[\s\S]*<\/h1>|<fieldset>[\s\S]*<\/fieldset>/", "", $results);
|
||||
?>
|
||||
<div class='main' id='resultsContainer'>
|
||||
</div>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#resultsContainer').load("<?php echo $this->createLink('testtask', 'results', "runID=0&caseID=$caseID&version=$version");?> #casesResults", function()
|
||||
{
|
||||
$('.result-item').click(function()
|
||||
{
|
||||
var $this = $(this);
|
||||
$this.toggleClass('show-detail');
|
||||
var show = $this.hasClass('show-detail');
|
||||
$this.next('.result-detail').toggleClass('hide', !show);
|
||||
$this.find('.collapse-handle').toggleClass('icon-chevron-down', !show).toggleClass('icon-chevron-up', show);;
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user