+ finish task#573,task#575
This commit is contained in:
@@ -272,11 +272,12 @@ class testcase extends control
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$this->view->position[] = $this->lang->testcase->view;
|
||||
|
||||
$this->view->case = $case;
|
||||
$this->view->productName = $this->products[$productID];
|
||||
$this->view->modulePath = $this->tree->getParents($case->module);
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->actions = $this->loadModel('action')->getList('case', $caseID);
|
||||
$this->view->case = $case;
|
||||
$this->view->productName = $this->products[$productID];
|
||||
$this->view->modulePath = $this->tree->getParents($case->module);
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->actions = $this->loadModel('action')->getList('case', $caseID);
|
||||
$this->view->currentVersion = $version;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ function browseBySearch(active)
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("a.runcase").colorbox({width:900, height:600, iframe:true, transition:'none'});
|
||||
$('#' + browseType + 'Tab').addClass('active');
|
||||
$('#module' + moduleID).addClass('active');
|
||||
});
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
$(document).ready(function()
|
||||
{
|
||||
$(".runcase").colorbox({width:900, height:600, iframe:true, transition:'none'});
|
||||
})
|
||||
@@ -61,7 +61,7 @@ var moduleID = '<?php echo $moduleID;?>';
|
||||
<th class='w-type'> <?php common::printOrderLink('type', $orderBy, $vars, $lang->typeAB);?></th>
|
||||
<th class='w-user'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
|
||||
<th class='w-status'><?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
|
||||
<th class='w-80px {sorter:false}'><?php echo $lang->actions;?></th>
|
||||
<th class='w-100px {sorter:false}'><?php echo $lang->actions;?></th>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php foreach($cases as $case):?>
|
||||
@@ -81,6 +81,7 @@ var moduleID = '<?php echo $moduleID;?>';
|
||||
<?php
|
||||
common::printLink('testcase', 'edit', "caseID=$case->id", $lang->testcase->buttonEdit);
|
||||
common::printLink('testcase', 'delete', "caseID=$case->id", $lang->delete, 'hiddenwin');
|
||||
common::printLink('testtask', 'runCase', "runID=0&extras=caseID=$case->id", $this->app->loadLang('testtask')->testtask->runCase, '', 'class="runcase"');
|
||||
?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
$browseLink = $app->session->caseList != false ? $app->session->caseList : $this->createLink('testcase', 'browse', "productID=$case->product");
|
||||
if(!$case->deleted)
|
||||
{
|
||||
common::printLink('testtask', 'runCase', "runID=0&extras=version=$currentVersion,caseID=$case->id", $this->app->loadLang('testtask')->testtask->runCase, '', 'class="runcase"');
|
||||
common::printLink('testcase', 'edit', "caseID=$case->id", $lang->testcase->buttonEdit);
|
||||
common::printLink('testcase', 'create', "productID=$case->product&moduleID=$case->module&testcaseID=$case->id", $lang->copy);
|
||||
common::printLink('testcase', 'delete', "caseID=$case->id", $lang->delete, 'hiddenwin');
|
||||
@@ -32,10 +33,14 @@
|
||||
<tr valign='top'>
|
||||
<td>
|
||||
<table class='table-1 colored'>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->testcase->precondition;?></legend>
|
||||
<?php echo $case->precondition;?>
|
||||
</fieldset>
|
||||
<tr class='colhead'>
|
||||
<th class='w-30px'><?php echo $lang->testcase->stepID;?></td>
|
||||
<th class='w-p70'><?php echo $lang->testcase->stepDesc;?></td>
|
||||
<th><?php echo $lang->testcase->stepExpect;?></td>
|
||||
<th class='w-30px'><?php echo $lang->testcase->stepID;?></th>
|
||||
<th class='w-p70'><?php echo $lang->testcase->stepDesc;?></th>
|
||||
<th><?php echo $lang->testcase->stepExpect;?></th>
|
||||
</tr>
|
||||
<?php
|
||||
foreach($case->steps as $stepID => $step)
|
||||
|
||||
@@ -315,20 +315,40 @@ class testtask extends control
|
||||
* Run case.
|
||||
*
|
||||
* @param int $runID
|
||||
* @param String $extras others params, forexample, caseID=10, version=3
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function runCase($runID)
|
||||
public function runCase($runID, $extras = '')
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->testtask->createResult($runID);
|
||||
$this->testtask->createResult($runID, $extras);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
echo js::reload('parent');
|
||||
die(js::closeWindow());
|
||||
}
|
||||
|
||||
$this->view->run = $this->testtask->getRunById($runID);
|
||||
|
||||
/* Pares the extras */
|
||||
$extras = str_replace(array(',', ' '), array('&', ''), $extras);
|
||||
parse_str($extras);
|
||||
|
||||
if(!isset($caseID))
|
||||
{
|
||||
$this->view->run = $this->testtask->getRunById($runID);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($version))
|
||||
{
|
||||
$this->view->run->case = $this->loadModel('testcase')->getById($caseID, $version);
|
||||
$this->view->run->case->version = $version;
|
||||
}
|
||||
else
|
||||
$this->view->run->case = $this->loadModel('testcase')->getById($caseID);
|
||||
}
|
||||
|
||||
die($this->display());
|
||||
}
|
||||
|
||||
|
||||
+20
-10
@@ -197,10 +197,11 @@ class testtaskModel extends model
|
||||
* Create test result
|
||||
*
|
||||
* @param int $runID
|
||||
* @param string $extras others params, forexample, caseID=10
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createResult($runID)
|
||||
public function createResult($runID, $extras)
|
||||
{
|
||||
/* Compute the test result. */
|
||||
$caseResult = 'pass';
|
||||
@@ -224,6 +225,12 @@ class testtaskModel extends model
|
||||
$stepResults[$stepID] = $step;
|
||||
}
|
||||
|
||||
/* Pares the extras */
|
||||
$extras = str_replace(array(',', ' '), array('&', ''), $extras);
|
||||
parse_str($extras);
|
||||
|
||||
if(isset($caseID)) $runID = 0;
|
||||
|
||||
/* Insert into testResult table. */
|
||||
$now = helper::now();
|
||||
$result = fixer::input('post')
|
||||
@@ -235,16 +242,19 @@ class testtaskModel extends model
|
||||
->get();
|
||||
$this->dao->insert(TABLE_TESTRESULT)->data($result)->autoCheck()->exec();
|
||||
|
||||
/* Update testRun's status. */
|
||||
if(!dao::isError())
|
||||
if(!isset($caseID))
|
||||
{
|
||||
$runStatus = $caseResult == 'blocked' ? 'blocked' : 'done';
|
||||
$this->dao->update(TABLE_TESTRUN)
|
||||
->set('lastResult')->eq($caseResult)
|
||||
->set('status')->eq($runStatus)
|
||||
->set('lastRun')->eq($now)
|
||||
->where('id')->eq($runID)
|
||||
->exec();
|
||||
/* Update testRun's status. */
|
||||
if(!dao::isError())
|
||||
{
|
||||
$runStatus = $caseResult == 'blocked' ? 'blocked' : 'done';
|
||||
$this->dao->update(TABLE_TESTRUN)
|
||||
->set('lastResult')->eq($caseResult)
|
||||
->set('status')->eq($runStatus)
|
||||
->set('lastRun')->eq($now)
|
||||
->where('id')->eq($runID)
|
||||
->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user