This commit is contained in:
wangyidong
2020-04-23 14:47:32 +08:00
parent 3e1701b360
commit fc5de2944e
9 changed files with 57 additions and 9 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ class ci extends control
if(empty($productID)) $productID = $compile->product;
if($compile->status != 'success' and $compile->status != 'fail' and $compile->status != 'create_fail' and $compile->status != 'timeout')
{
$this->loadModel('compile')->syncCompileStatus($compile);
$this->ci->syncCompileStatus($compile);
}
}
+9
View File
@@ -1097,6 +1097,15 @@ class testcaseModel extends model
}
}
if(isset($this->config->testcase->appendFields))
{
foreach(explode(',', $this->config->testcase->appendFields) as $appendField)
{
if(empty($appendField)) continue;
$caseData->$appendField = $_POST[$appendField][$key];
}
}
$cases[$key] = $caseData;
$line++;
}
+11
View File
@@ -24,6 +24,11 @@
<th class='w-120px'><?php echo $lang->testcase->type?></th>
<th class='w-160px'><?php echo $lang->testcase->stage?></th>
<th><?php echo $lang->testcase->precondition?></th>
<?php if(!empty($appendFields)):?>
<?php foreach($appendFields as $appendField):?>
<th class='w-100px'><?php echo $lang->testcase->{$appendField->field}?></th>
<?php endforeach;?>
<?php endif;?>
<th class='w-300px'>
<table class='w-p100 table-borderless'>
<tr>
@@ -69,6 +74,12 @@
<td><?php echo html::select("type[$key]", $lang->testcase->typeList, $case->type, "class='form-control chosen'")?></td>
<td style='overflow:visible'><?php echo html::select("stage[$key][]", $lang->testcase->stageList, !empty($case->stage) ? $case->stage : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->stage : ''), "multiple='multiple' class='form-control chosen'")?></td>
<td><?php echo html::textarea("precondition[$key]", isset($case->precondition) ? htmlspecialchars($case->precondition) : "", "class='form-control'")?></td>
<?php if(!empty($appendFields)):?>
<?php $this->loadModel('flow');?>
<?php foreach($appendFields as $appendField):?>
<td><?php echo $this->flow->buildControl($appendField, $case->{$appendField->field}, "{$appendField->field}[$key]");?></td>
<?php endforeach;?>
<?php endif;?>
<td>
<?php if(isset($stepData[$key]['desc'])):?>
<table class='w-p100 bd-0'>
+15 -3
View File
@@ -383,11 +383,16 @@ class testreport extends control
/**
* View report.
*
* @param int $reportID
* @param int $reportID
* @param string $from
* @param string $tab
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function view($reportID, $from = 'product')
public function view($reportID, $from = 'product', $tab = 'basic', $recTotal = 0, $recPerPage = 100, $pageID = 1)
{
$report = $this->testreport->getById($reportID);
if(!$report) die(js::error($this->lang->notFound) . js::locate('back'));
@@ -421,9 +426,14 @@ class testreport extends control
if($result->caseResult == 'fail') $failResults[$result->case] = $result->case;
}
/* Load pager. */
$this->app->loadClass('pager', $static = true);
if($this->app->getViewType() == 'mhtml') $recPerPage = 10;
$pager = pager::init($recTotal, $recPerPage, $pageID);
$tasks = $report->tasks ? $this->testtask->getByList($report->tasks) : array();;
$builds = $report->builds ? $this->build->getByList($report->builds) : array();
$cases = $this->testreport->getTaskCases($tasks, $report->begin, $report->end, $report->cases);
$cases = $this->testreport->getTaskCases($tasks, $report->begin, $report->end, $report->cases, $pager);
$bugInfo = $this->testreport->getBugInfo($tasks, $report->product, $report->begin, $report->end, $builds);
if($report->objectType == 'testtask')
@@ -439,6 +449,8 @@ class testreport extends control
$this->view->browseLink = $browseLink;
$this->view->position[] = $report->title;
$this->view->tab = $tab;
$this->view->pager = $pager;
$this->view->report = $report;
$this->view->project = $project;
$this->view->stories = $stories;
+3
View File
@@ -4,3 +4,6 @@
.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;}
.tab-pane > table {border: 1px solid #ddd;}
.tab-pane > table:first-child {border-top: none;}
#cases .pager{margin:0px;}
#cases .pager li .btn.dropdown-toggle{border:0px;padding-top:3px;}
+3 -1
View File
@@ -1,7 +1,9 @@
$(function()
{
$('.tab-pane').removeClass('active');
$('.tab-pane:first').addClass('active');
tab = tab == 'basic' ? 'basic' : 'tabCase';
$('.tab-pane#' + tab).addClass('active');
$('.nav.nav-tabs a[data-toggle="tab"]').on('shown.zui.tab', function(e)
{
var href = $(e.target).data('target');
+6 -2
View File
@@ -316,17 +316,21 @@ class testreportModel extends model
* Get task cases.
*
* @param array $tasks
* @param string $begin
* @param string $end
* @param string $idList
* @param object $pager
* @access public
* @return array
* @return void
*/
public function getTaskCases($tasks, $begin, $end, $idList = '')
public function getTaskCases($tasks, $begin, $end, $idList = '', $pager = null)
{
$cases = $this->dao->select('t2.*,t1.task,t1.assignedTo,t1.status')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case=t2.id')
->where('t1.task')->in(array_keys($tasks))
->beginIF($idList)->andWhere('t2.id')->in($idList)->fi()
->andWhere('t2.deleted')->eq(0)
->page($pager)
->fetchAll('id');
$results = $this->dao->select('t1.*')->from(TABLE_TESTRESULT)->alias('t1')
@@ -32,6 +32,11 @@
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td class='text-right' colspan='9'><?php $pager->show('right', 'pagerjs');?></td>
</tr>
</tfoot>
<?php else:?>
<tr><td class='none-data' colspan='9'><?php echo $lang->testreport->none;?></td></tr>
<?php endif;?>
+4 -2
View File
@@ -30,10 +30,10 @@
<?php endif;?>
<div id='mainContent' class='main-content'>
<ul class='nav nav-tabs'>
<li class='active'><?php echo html::a('###', $lang->testreport->legendBasic, '', "data-toggle='tab' data-target='#basic'")?></li>
<li <?php if($tab == 'basic') echo "class='active'";?>><?php echo html::a('###', $lang->testreport->legendBasic, '', "data-toggle='tab' data-target='#basic'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendStoryAndBug, '', "data-toggle='tab' data-target='#storyAndBug'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendBuild, '', "data-toggle='tab' data-target='#tabBuild'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendCase, '', "data-toggle='tab' data-target='#tabCase'")?></li>
<li <?php if($tab == 'cases') echo "class='active'";?>><?php echo html::a('###', $lang->testreport->legendCase, '', "data-toggle='tab' data-target='#tabCase'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendLegacyBugs, '', "data-toggle='tab' data-target='#tabLegacyBugs'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendReport, '', "data-toggle='tab' data-target='#tabReport'")?></li>
<li><?php echo html::a('###', $lang->testreport->legendComment, '', "data-toggle='tab' data-target='#tabComment'")?></li>
@@ -44,6 +44,7 @@
<?php endif;?>
<?php endif;?>
</ul>
<?php $this->app->rawParams['tab'] = 'cases';?>
<div class='tab-content'>
<div class='tab-pane' id='basic'>
<table class='table table-form'>
@@ -102,6 +103,7 @@
<?php endif;?>
</div>
</div>
<?php echo js::set('tab', $tab);?>
<?php if(!$this->session->notHead):?>
<div id='mainActions' class='main-actions'>
<nav class='container'></nav>