diff --git a/module/ci/control.php b/module/ci/control.php index bdd993a56d..d80bdd154c 100644 --- a/module/ci/control.php +++ b/module/ci/control.php @@ -112,8 +112,6 @@ class ci extends control { $this->loadModel('compile')->checkStatus($compile); } - - $this->dao->update(TABLE_COMPILE)->set('testtask')->eq($taskID)->where('id')->eq($compile->id)->exec(); } if(!empty($taskID)) @@ -148,6 +146,7 @@ class ci extends control $this->loadModel('action')->create('testtask', $taskID, 'opened'); } + if($compileID) $this->dao->update(TABLE_COMPILE)->set('testtask')->eq($taskID)->where('id')->eq($compileID)->exec(); if($testType == 'unit') { $data = $this->testtask->buildDataFromUnit($post->UnitCaseResults, $frame, $productID, $jobID, $compileID); diff --git a/module/compile/model.php b/module/compile/model.php index cf55ffaaf1..e79006cf98 100644 --- a/module/compile/model.php +++ b/module/compile/model.php @@ -118,7 +118,7 @@ class compileModel extends model $tagData = new stdclass(); $tagData->PARAM_TAG = $compile->tag; - $tagData->PARAM_ZENTAODATA = "compile={$compile->id}"; + $tagData->ZENTAO_DATA = "compile={$compile->id}"; $buildUrl = $this->getBuildUrl($job); $build = new stdclass(); diff --git a/module/job/model.php b/module/job/model.php index 8c4c41b114..4a46f7af38 100644 --- a/module/job/model.php +++ b/module/job/model.php @@ -271,7 +271,7 @@ class jobModel extends model $this->dao->insert(TABLE_COMPILE)->data($build)->exec(); $compileID = $this->dao->lastInsertId(); - $data->PARAM_ZENTAODATA = "compile={$compileID}"; + $data->ZENTAO_DATA = "compile={$compileID}"; $compile = new stdclass(); $compile->queue = $this->loadModel('ci')->sendRequest($buildUrl, $data); $compile->status = $compile->queue ? 'created' : 'create_fail'; diff --git a/module/testcase/control.php b/module/testcase/control.php index 4ff0d1634d..168ba40afe 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -486,6 +486,13 @@ class testcase extends control { $case = $this->testcase->getById($caseID, $version); if(!$case) die(js::error($this->lang->notFound) . js::locate('back')); + if($case->auto != 'no') + { + $this->lang->testcase->subMenu->testcase->feature['alias'] = ''; + $this->lang->testcase->subMenu->testcase->unit['alias'] = 'view'; + $this->lang->testcase->subMenu->testcase->unit['subModule'] = 'testcase'; + } + if($from == 'testtask') { $run = $this->loadModel('testtask')->getRunByCase($taskID, $caseID); @@ -495,6 +502,11 @@ class testcase extends control $case->lastRunResult = $run->lastRunResult; $case->caseStatus = $case->status; $case->status = $run->status; + + $results = $this->testtask->getResults($run->id); + $result = array_shift($results); + $case->xml = $result->xml; + $case->duration = $result->duration; } $branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($case->product); diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php index b9ad9d192e..7d5aa10571 100644 --- a/module/testcase/lang/zh-cn.php +++ b/module/testcase/lang/zh-cn.php @@ -54,6 +54,7 @@ $lang->testcase->assignedTo = '指派给'; $lang->testcase->colorTag = '颜色标签'; $lang->testcase->lastRunResult = '结果'; $lang->testcase->desc = '步骤'; +$lang->testcase->xml = 'XML'; $lang->testcase->expect = '预期'; $lang->testcase->allProduct = "所有{$lang->productCommon}"; $lang->testcase->fromBug = '来源Bug'; diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php index db5e0f306b..e7f0d04e42 100644 --- a/module/testcase/view/view.html.php +++ b/module/testcase/view/view.html.php @@ -55,10 +55,12 @@
+ auto == 'no'):?>
testcase->precondition;?>
precondition);?>
+
testcase->steps;?>
@@ -94,6 +96,12 @@
+ xml):?> +
+
testcase->xml;?>
+
xml));?>
+
+ fetch('file', 'printFiles', array('files' => $case->files, 'fieldset' => 'true'));?>
printExtendFields($case, 'div', "position=left&inForm=0&inCell=1");?> @@ -119,7 +127,7 @@ id", $case, 'button', '', '', 'showinonlybody'); - if(!$isLibCase) common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'button', 'copy'); + if(!$isLibCase and $case->auto == 'no') common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'button', 'copy'); if($isLibCase and common::hasPriv('caselib', 'createCase')) echo html::a($this->createLink('caselib', 'createCase', "libID=$case->lib&moduleID=$case->module¶m=$case->id", $case), "", '', "class='btn' title='{$lang->testcase->copy}'"); common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'button', 'trash', 'hiddenwin', 'showinonlybody'); ?> @@ -333,4 +341,10 @@
createLink('testcase', 'view', "caseID=%s&version=&from=$from&taskID=$taskID"));?>
+ diff --git a/module/testtask/model.php b/module/testtask/model.php index a3b6bc87a7..6521454012 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1398,6 +1398,7 @@ class testtaskModel extends model if($action == 'block') return ($testtask->status == 'doing' || $testtask->status == 'wait'); if($action == 'activate') return ($testtask->status == 'blocked' || $testtask->status == 'done'); if($action == 'close') return $testtask->status != 'done'; + if($action == 'runcase' and $testtask->auto != 'no') return false; if($action == 'runcase') return isset($testtask->caseStatus) ? $testtask->caseStatus != 'wait' : $testtask->status != 'wait'; return true; } @@ -1750,7 +1751,6 @@ class testtaskModel extends model { $suitecase = new stdclass(); $suitecase->suite = $suiteID; - $suitecase->run = $runID; $suitecase->case = $caseID; $suitecase->version = $case->version; $suitecase->product = $case->product;