* adjust style for testreport.

This commit is contained in:
wangyidong
2017-03-14 15:03:47 +08:00
parent 4421cf85d6
commit 89f3ea8f47
9 changed files with 46 additions and 33 deletions
+2 -1
View File
@@ -309,7 +309,8 @@ class testreport extends control
$this->session->set('notHead', false);
$css = '<style>' . $this->getCSS('testreport', 'export') . '</style>';
$js = '<script>' . $this->getJS('testreport', 'export') . '</script>';
$content = "<!DOCTYPE html>\n<html lang='zh-cn'>\n<head>\n<meta charset='utf-8'>\n<title>{$report->title}</title>\n$css\n$js\n</head>\n<body onload='tab()'>\n<h1>{$report->title}</h1>\n$output</body></html>";
$exportNotice = "<p style='text-align:right;color:grey'>" . $this->lang->testreport->exportNotice . '</p>';
$content = "<!DOCTYPE html>\n<html lang='zh-cn'>\n<head>\n<meta charset='utf-8'>\n<title>{$report->title}</title>\n$css\n$js\n</head>\n<body onload='tab()'>\n<h1>{$report->title}</h1>\n$output\n$exportNotice</body></html>";
$this->fetch('file', 'sendDownHeader', array('fileName' => $data->fileName, 'fileType' => $data->fileType, 'content' =>$content));
}
$this->view->customExport = false;
+2
View File
@@ -1 +1,3 @@
.none-data{padding:8px !important;}
.main #stories{margin-bottom:10px}
.main .table-report{border:0px;}
+1 -1
View File
@@ -1,5 +1,5 @@
body{font-size:14px}h1{font-size:16px;text-align:center}
.w-100px{width:100px}.w-p50{width:50%}.w-p60{width:60%}.w-id{width:70px}.w-pri{width:40px}.w-user{width:80px}.w-80px{width:80px}.w-70px{width:70px}.w-hour[width:57px].w-status{width:60px}.w-130px{width:130px;}.w-type{width:80px}.w-150px{width:150px;}
.w-100px{width:100px}.w-p50{width:50%}.w-p70{width:70%}.w-id{width:70px}.w-pri{width:40px}.w-user{width:80px}.w-80px{width:80px}.w-70px{width:70px}.w-hour[width:57px].w-status{width:60px}.w-130px{width:130px;}.w-type{width:80px}.w-150px{width:150px;}
.text-center{text-align:center}.text-top{vertical-align:top;}.text-left{text-align:left}.text-right{text-align:right;}
.table{width:100%;margin-bottom:5px;border:1px solid #ddd;border-collapse:collapse;border-spacing:0;}
.table caption{padding:8px 20px;border:1px solid #DDD;border-bottom:0;background:#fafafa;text-align:left}.table td, .table th{border-bottom:1px solid #ddd;padding:5px;}
+2 -3
View File
@@ -1,5 +1,4 @@
.main{padding:0px !important;}
.main .nav-tabs{padding-left:20px; padding-top:10px;}
.main .tab-content{border:0px; padding:0px;}
.tab-content #builds, .tab-content #cases,.tab-content #stories,.tab-content #bugs,.tab-content #legacyBugs{border:0px;}
.tab-content #builds tr:last-child td, .tab-content #cases tr:last-child td,.tab-content #stories tr:last-child td,.tab-content #bugs tr:last-child td,.tab-content #legacyBugs tr:last-child td{border-bottom:0px;}
.main .tab-content{border:0px;}
.tab-content #builds tr:last-child td, .tab-content #cases tr:last-child td,.tab-content #bugs tr:last-child td,.tab-content #legacyBugs tr:last-child td{border-bottom:0px;}
+9 -7
View File
@@ -32,16 +32,18 @@ $lang->testreport->legendLegacyBugs = '遗留的Bug';
$lang->testreport->legendReport = '报表';
$lang->testreport->legendMore = '更多功能';
$lang->testreport->bugSeverityGroups = '产生Bug严重级别分布';
$lang->testreport->bugStatusGroups = '产生Bug状态分布';
$lang->testreport->bugOpenedByGroups = '产生Bug创建者分布';
$lang->testreport->bugResolvedByGroups = '产生Bug解决者分布';
$lang->testreport->bugResolutionGroups = '产生Bug解决方案分布';
$lang->testreport->bugModuleGroups = '产生Bug模块分布';
$lang->testreport->bugSeverityGroups = 'Bug严重级别分布';
$lang->testreport->bugStatusGroups = 'Bug状态分布';
$lang->testreport->bugOpenedByGroups = 'Bug创建者分布';
$lang->testreport->bugResolvedByGroups = 'Bug解决者分布';
$lang->testreport->bugResolutionGroups = 'Bug解决方案分布';
$lang->testreport->bugModuleGroups = 'Bug模块分布';
$lang->testreport->legacyBugs = '遗留的Bug';
$lang->testreport->bugConfirmedRate = '有效Bug率 (确认的Bug / 测试创建的Bug)';
$lang->testreport->bugCreateByCaseRate = '用例发现Bug率 (用例创建的Bug / 时间区间中新增的Bug)';
$lang->testreport->caseSummary = '共有<strong>%s</strong>个用例,共执行<strong>%s</strong>个用例,产生了<strong>%s</strong>个结果,失败的用例有<strong>%s</strong>个。';
$lang->testreport->bugSummary = '共产生<strong>%s</strong>个Bug,有效Bug率(确认的Bug / 产生的Bug):<strong>%s</strong>,用例发现Bug率(用例创建的Bug / 时间区间中新增的Bug):<strong>%s</strong>';
$lang->testreport->buildSummary = '共测试了<strong>%s</strong>个版本。';
$lang->testreport->bugSummary = '共产生<strong>%s</strong>个Bug,遗留<strong>%s</strong>个Bug。有效Bug率(确认的Bug / 产生的Bug):<strong>%s</strong>,用例发现Bug率(用例创建的Bug / 时间区间中新增的Bug):<strong>%s</strong>';
$lang->testreport->confirmDelete = '是否删除该报告?';
$lang->testreport->exportNotice = "由<a href='http://www.zentao.net' target='_blank' style='color:grey'>禅道项目管理软件</a>导出";
+7 -3
View File
@@ -176,15 +176,19 @@ class testreportModel extends model
*/
public function getResultSummary($tasks, $cases)
{
$results = $this->dao->select('*')->from(TABLE_TESTRESULT)->where('run')->in(array_keys($tasks))->andWhere('`case`')->in(array_keys($cases))->fetchAll();
$results = $this->dao->select('t1.*')->from(TABLE_TESTRESULT)->alias('t1')
->leftJoin(TABLE_TESTRUN)->alias('t2')->on('t1.run=t2.id')
->where('t2.task')->in(array_keys($tasks))
->andWhere('t1.`case`')->in(array_keys($cases))
->fetchAll();
$failResults = array();
$runCasesNum = array();
foreach($results as $result)
{
$runCases[$result->case] = $result->case;
$runCasesNum[$result->case] = $result->case;
if($result->caseResult == 'fail') $failResults[$result->case] = $result->case;
}
return sprintf($this->lang->testreport->caseSummary, count($cases), count($results), count($runCasesNum), count($failResults));
return sprintf($this->lang->testreport->caseSummary, count($cases), count($runCasesNum), count($results), count($failResults));
}
/**
+11 -6
View File
@@ -3,21 +3,26 @@
<?php foreach($bugInfo as $infoKey => $infoValue):?>
<?php if(($row % 1) == 0) echo '<tr>';?>
<?php $row++;?>
<td class='text-top' width='33%'>
<td class='text-top'>
<?php $sum = array_sum($infoValue);?>
<table class='table table-condensed' id='bugSeverityGroups'>
<caption><?php echo $lang->testreport->$infoKey?></caption>
<table class='table table-condensed table-report' id='bugSeverityGroups'>
<?php if($sum == 0):?>
<tr><td class='none-data'><?php echo $lang->testreport->none;?></td></tr>
<tr>
<td class='none-data'>
<h5><?php echo $lang->testreport->$infoKey?></h5>
<?php echo $lang->testreport->none;?>
</td>
</tr>
<?php else:?>
<tr class='text-top'>
<td class='w-p60'>
<td class='w-p70'>
<div class='chart-wrapper text-center'>
<h5><?php echo $lang->testreport->$infoKey?></h5>
<div class='chart-canvas'>
<?php if(isset($_POST["chart-{$infoKey}"])):?>
<img src='<?php echo $_POST["chart-{$infoKey}"]?>' />
<?php else:?>
<canvas id='chart-<?php echo $infoKey?>' width='100' height='20' data-responsive='true'></canvas>
<canvas id='chart-<?php echo $infoKey?>' width='100' height='14' data-responsive='true'></canvas>
<?php endif;?>
</div>
</div>
+10 -10
View File
@@ -74,12 +74,20 @@
<td colspan='2'>
<?php
echo '<p>' . $storySummary . '</p>';
echo '<p>' . $caseSummary . '</p>';
echo '<p>' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '</p>';
echo '<p>' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '</p>';
echo '<p>' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], count($legacyBugs), $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '</p>';
unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']);
?>
</td>
</tr>
<tr>
<th><?php echo $lang->testreport->report?></th>
<td colspan='2'><?php echo html::textarea('report', '', "class='form-control'")?></td>
</tr>
<tr>
<th><?php echo $lang->files?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
</table>
</fieldset>
<fieldset>
@@ -103,14 +111,6 @@
<legend><?php echo $lang->testreport->legendReport?></legend>
<?php include './blockbugreport.html.php'?>
</fieldset>
<fieldset>
<legend><?php echo $lang->testreport->report?></legend>
<?php echo html::textarea('report', '', "class='form-control'")?>
</fieldset>
<fieldset>
<legend><?php echo $lang->files?></legend>
<?php echo $this->fetch('file', 'buildform');?>
</fieldset>
<div><?php echo html::submitButton() . html::backButton();?></div>
</form>
</div>
+2 -2
View File
@@ -79,8 +79,8 @@
<td colspan='2'>
<?php
echo '<p>' . $storySummary . '</p>';
echo '<p>' . $caseSummary . '</p>';
echo '<p>' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '</p>';
echo '<p>' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '</p>';
echo '<p>' . sprintf($lang->testreport->bugSummary, $bugInfo['countBugByTask'], count($legacyBugs), $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '</p>';
unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']);
?>
</td>