Merge branch 'zenops_46' into zenops_46_tanghucheng

This commit is contained in:
tanghucheng
2022-12-14 09:27:49 +08:00
44 changed files with 323 additions and 116 deletions
+9 -7
View File
@@ -46,26 +46,28 @@ class testcaseEntry extends entry
$oldCase = $this->loadModel('testcase')->getByID($caseID);
/* Set $_POST variables. */
$fields = 'title,pri,story,type,stage,product,module,branch,precondition';
$fields = 'title,pri,story,type,stage,product,module,branch,precondition,script';
$this->batchSetPost($fields, $oldCase);
if(isset($this->requestBody->script)) $this->setPost('auto', 'auto');
/* Set steps and expects. */
$steps = array();
$expects = array();
$stepType = array();
if(isset($this->requestBody->steps))
{
$steps = array();
$expects = array();
$stepType = array();
foreach($this->requestBody->steps as $step)
{
$steps[] = $step->desc;
$expects[] = $step->expect;
$stepType[] = 'item';
}
$this->setPost('steps', $steps);
$this->setPost('expects', $expects);
$this->setPost('stepType', $stepType);
}
$this->setPost('steps', $steps);
$this->setPost('expects', $expects);
$this->setPost('stepType', $stepType);
$control = $this->loadController('testcase', 'edit');
$control->edit($caseID);
+10 -8
View File
@@ -318,14 +318,16 @@ $filter->execution->export->cookie['checkedItem'] = 'reg::checked';
$filter->execution->kanban->cookie['taskToOpen'] = 'int';
$filter->execution->all->cookie['showExecutionBatchEdit'] = 'int';
$filter->testcase->browse->cookie['caseModule'] = 'int';
$filter->testcase->browse->cookie['caseSuite'] = 'int';
$filter->testcase->browse->cookie['preBranch'] = 'reg::word';
$filter->testcase->create->cookie['lastCaseModule'] = 'int';
$filter->testcase->default->cookie['lastProduct'] = 'int';
$filter->testcase->default->cookie['preProductID'] = 'int';
$filter->testcase->export->cookie['checkedItem'] = 'reg::checked';
$filter->testcase->groupcase->cookie['preBranch'] = 'reg::word';
$filter->testcase->browse->cookie['caseModule'] = 'int';
$filter->testcase->browse->cookie['caseSuite'] = 'int';
$filter->testcase->browse->cookie['preBranch'] = 'reg::word';
$filter->testcase->browse->cookie['showAutoCase'] = 'int';
$filter->testcase->create->cookie['lastCaseModule'] = 'int';
$filter->testcase->default->cookie['lastProduct'] = 'int';
$filter->testcase->default->cookie['preProductID'] = 'int';
$filter->testcase->export->cookie['checkedItem'] = 'reg::checked';
$filter->testcase->groupcase->cookie['preBranch'] = 'reg::word';
$filter->testcase->groupcase->cookie['showAutoCase'] = 'int';
$filter->testreport->default->cookie['lastProduct'] = 'int';
$filter->testreport->default->cookie['lastProject'] = 'int';
+1
View File
@@ -1,3 +1,4 @@
ALTER TABLE `zt_case` ADD `script` longtext NOT NULL AFTER `howRun`;
ALTER TABLE `zt_product` ADD `shadow` tinyint(1) unsigned NOT NULL AFTER `code`;
ALTER TABLE `zt_project` ADD `hasProduct` tinyint(1) unsigned NOT NULL DEFAULT 1 AFTER `code`;
ALTER table `zt_project` ADD `multiple` enum('0', '1') NOT NULL DEFAULT '1' AFTER `fluidBoard`;
+1
View File
@@ -6,3 +6,4 @@ $lang->ci->checkCompileStatus = 'Interface: Fetch Test Result.';
$lang->ci->job = 'Construction';
$lang->ci->task = 'Task';
$lang->ci->history = 'History';
$lang->ci->list = 'List';
+1
View File
@@ -6,3 +6,4 @@ $lang->ci->checkCompileStatus = 'Interface: Fetch Test Result.';
$lang->ci->job = 'Job';
$lang->ci->task = 'Task';
$lang->ci->history = 'History';
$lang->ci->list = 'List';
+1
View File
@@ -6,3 +6,4 @@ $lang->ci->checkCompileStatus = 'Interface: Fetch Test Result.';
$lang->ci->job = 'Construction';
$lang->ci->task = 'T鈉he';
$lang->ci->history = 'Historique';
$lang->ci->list = 'List';
+1
View File
@@ -5,3 +5,4 @@ $lang->ci->commitResult = 'Interface: Commit Test Result.';
$lang->ci->job = 'Job';
$lang->ci->task = 'Nhiệm vụ';
$lang->ci->history = 'Lịch sử';
$lang->ci->list = 'List';
+1
View File
@@ -6,3 +6,4 @@ $lang->ci->checkCompileStatus = '接口:获取测试结果';
$lang->ci->job = '构建';
$lang->ci->task = '构建任务';
$lang->ci->history = '构建历史';
$lang->ci->list = '列表';
+1
View File
@@ -6,3 +6,4 @@ $lang->ci->checkCompileStatus = '介面:獲取測試結果';
$lang->ci->job = '構建';
$lang->ci->task = '構建任務';
$lang->ci->history = '構建歷史';
$lang->ci->list = '列表';
+1 -1
View File
@@ -288,7 +288,7 @@ $lang->testcase->case = 'Test Case';
$lang->testcase->testsuite = 'Test Suite';
$lang->testcase->caselib = 'Case Library';
$lang->devops->compile = 'Compile';
$lang->devops->compile = 'Pipelines';
$lang->devops->mr = 'Merge Request';
$lang->devops->repo = 'Repo';
$lang->devops->rules = 'Rule';
+1 -1
View File
@@ -288,7 +288,7 @@ $lang->testcase->case = 'Test Case';
$lang->testcase->testsuite = 'Test Suite';
$lang->testcase->caselib = 'Case Library';
$lang->devops->compile = 'Compile';
$lang->devops->compile = 'Pipelines';
$lang->devops->mr = 'Merge Request';
$lang->devops->repo = 'Repo';
$lang->devops->rules = 'Rule';
+1 -1
View File
@@ -288,7 +288,7 @@ $lang->testcase->case = 'Test Case';
$lang->testcase->testsuite = 'Test Suite';
$lang->testcase->caselib = 'Case Library';
$lang->devops->compile = 'Compile';
$lang->devops->compile = 'Pipelines';
$lang->devops->mr = 'Merge Request';
$lang->devops->repo = 'Repo';
$lang->devops->rules = 'Rule';
+1 -1
View File
@@ -219,7 +219,7 @@ $lang->system->menu->calendar = array('link' => 'Calendar|my|calendar|', 'subMod
$lang->measurement = new stdclass();
$lang->measurement->menu = new stdclass();
$lang->devops->compile = 'Compile';
$lang->devops->compile = 'Pipelines';
$lang->devops->mr = 'Merge Request';
$lang->devops->repo = 'Repo';
$lang->devops->rules = 'Rule';
+1 -1
View File
@@ -288,7 +288,7 @@ $lang->testcase->case = '用例';
$lang->testcase->testsuite = '套件';
$lang->testcase->caselib = '用例库';
$lang->devops->compile = '构建';
$lang->devops->compile = '流水线';
$lang->devops->mr = '合并请求';
$lang->devops->repo = '代码库';
$lang->devops->rules = '指令';
+1 -1
View File
@@ -266,7 +266,7 @@ $lang->testcase->case = '用例';
$lang->testcase->testsuite = '套件';
$lang->testcase->caselib = '用例庫';
$lang->devops->compile = '構建';
$lang->devops->compile = '流水線';
$lang->devops->mr = '合併請求';
$lang->devops->repo = '版本庫';
$lang->devops->rules = '指令';
+1 -1
View File
@@ -7,7 +7,7 @@ $lang->compile->syncCompile = 'Interface: Sync Compiles.';
$lang->compile->id = 'ID';
$lang->compile->name = 'Nom';
$lang->compile->buildType = 'Engine';
$lang->compile->status = 'Statut du Build';
$lang->compile->status = 'Statut';
$lang->compile->time = 'Date/Heure Build';
$lang->compile->result = 'R閟ultat';
$lang->compile->refresh = 'Refresh';
+3 -3
View File
@@ -6,9 +6,9 @@ $lang->compile->syncCompile = '接口:同步构建记录';
$lang->compile->id = 'ID';
$lang->compile->name = '构建名称';
$lang->compile->buildType = '构建引擎';
$lang->compile->status = '构建状态';
$lang->compile->time = '构建时间';
$lang->compile->buildType = '引擎';
$lang->compile->status = '状态';
$lang->compile->time = '最后执行时间';
$lang->compile->result = '构建结果';
$lang->compile->refresh = '刷新';
$lang->compile->job = '构建任务';
+3 -3
View File
@@ -5,9 +5,9 @@ $lang->compile->logs = '構建日誌';
$lang->compile->id = 'ID';
$lang->compile->name = '構建名稱';
$lang->compile->buildType = '構建引擎';
$lang->compile->status = '構建狀態';
$lang->compile->time = '構建時間';
$lang->compile->buildType = '引擎';
$lang->compile->status = '狀態';
$lang->compile->time = '最後執行時間';
$lang->compile->result = '構建結果';
$lang->compile->refresh = '刷新';
$lang->compile->job = '構建任務';
+1 -1
View File
@@ -14,7 +14,7 @@
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php
echo html::a($this->createLink('job', 'browse', "repoID=$repoID"), "<span class='text'>{$lang->ci->task}</span>", '', "class='btn btn-link'");
echo html::a($this->createLink('job', 'browse', "repoID=$repoID"), "<span class='text'>{$lang->ci->list}</span>", '', "class='btn btn-link'");
echo html::a($this->createLink('compile', 'browse', "repoID=$repoID&jobID=$jobID"), "<span class='text'>" . ($jobID ? $job->name : '') . " {$lang->ci->history}</span>", '', "class='btn btn-link btn-active-text'");
?>
</div>
+2
View File
@@ -1052,6 +1052,7 @@ $lang->resource->testcase->batchCreate = 'batchCreate';
$lang->resource->testcase->createBug = 'createBug';
$lang->resource->testcase->view = 'view';
$lang->resource->testcase->edit = 'edit';
$lang->resource->testcase->showScript = 'showScript';
$lang->resource->testcase->linkCases = 'linkCases';
$lang->resource->testcase->linkBugs = 'linkBugs';
$lang->resource->testcase->batchEdit = 'batchEdit';
@@ -1106,6 +1107,7 @@ $lang->testcase->methodOrder[130] = 'ignoreLibcaseChange';
$lang->testcase->methodOrder[135] = 'batchConfirmStoryChange';
$lang->testcase->methodOrder[140] = 'importToLib';
$lang->testcase->methodOrder[145] = 'automation';
$lang->testcase->methodOrder[150] = 'showScript';
/* Test task. */
$lang->resource->testtask = new stdclass();
+5 -5
View File
@@ -1,12 +1,12 @@
<?php
$lang->job->common = 'Job';
$lang->job->browse = 'Browse Job';
$lang->job->create = 'Create Job';
$lang->job->edit = 'Edit Job';
$lang->job->exec = 'Execute Job';
$lang->job->browse = 'Browse Pipeline';
$lang->job->create = 'Create Pipeline';
$lang->job->edit = 'Edit Pipeline';
$lang->job->exec = 'Execute Pipeline';
$lang->job->runPipeline = 'Run pipeline';
$lang->job->view = 'Execute Details';
$lang->job->delete = 'Delete Job';
$lang->job->delete = 'Delete Pipeline';
$lang->job->confirmDelete = 'Do you want to delete this job?';
$lang->job->dirChange = 'Directory Changed';
$lang->job->buildTag = 'Build Tag';
+6 -6
View File
@@ -1,13 +1,13 @@
<?php
$lang->job->common = 'Job';
$lang->job->browse = 'Browse Job';
$lang->job->create = 'Create Job';
$lang->job->edit = 'Edit Job';
$lang->job->exec = 'Execute Job';
$lang->job->browse = 'Browse Pipeline';
$lang->job->create = 'Create Pipeline';
$lang->job->edit = 'Edit Pipeline';
$lang->job->exec = 'Execute Pipeline';
$lang->job->runPipeline = 'Run pipeline';
$lang->job->view = 'Execute Details';
$lang->job->delete = 'Delete Job';
$lang->job->confirmDelete = 'Do you want to delete this job?';
$lang->job->delete = 'Delete Pipeline';
$lang->job->confirmDelete = 'Do you want to delete this pipeline?';
$lang->job->dirChange = 'Directory Changed';
$lang->job->buildTag = 'Build Tag';
$lang->job->execSuccess = 'Build success';
+7 -7
View File
@@ -1,14 +1,14 @@
<?php
$lang->job->common = 'Job';
$lang->job->browse = 'Afficher Job';
$lang->job->create = 'Cr閑r Job';
$lang->job->edit = 'Editer Job';
$lang->job->exec = 'Ex閏uter Job';
$lang->job->browse = 'Browse Pipeline';
$lang->job->create = 'Create Pipeline';
$lang->job->edit = 'Edit Pipeline';
$lang->job->exec = 'Execute Pipeline';
$lang->job->runPipeline = 'Run pipeline';
$lang->job->view = 'D閠ails Exec';
$lang->job->delete = 'Supprimer Job';
$lang->job->view = 'Execute Details';
$lang->job->delete = 'Delete Pipeline';
$lang->job->confirmDelete = 'Voullez-vous supprimer ce job ?';
$lang->job->dirChange = 'R閜ertoire change';
$lang->job->dirChange = 'Directory Changed';
$lang->job->buildTag = 'Build Tag';
$lang->job->execSuccess = 'Build success';
+5 -5
View File
@@ -1,11 +1,11 @@
<?php
$lang->job->common = 'Job';
$lang->job->browse = 'Browse Job';
$lang->job->create = 'Tạo Job';
$lang->job->edit = 'Sửa Job';
$lang->job->exec = 'Xử lý Job';
$lang->job->browse = 'Browse Pipeline';
$lang->job->create = 'Tạo Pipeline';
$lang->job->edit = 'Sửa Pipeline';
$lang->job->exec = 'Xử lý Pipeline';
$lang->job->view = 'Execute Details';
$lang->job->delete = 'Xóa Job';
$lang->job->delete = 'Xóa Pipeline';
$lang->job->confirmDelete = 'Bạn có muốn xóa job này?';
$lang->job->dirChange = 'Thư mục đã thay đổi';
$lang->job->buildTag = 'Tag bản dựng';
+6 -6
View File
@@ -1,13 +1,13 @@
<?php
$lang->job->common = '构建任务';
$lang->job->browse = '浏览构建任务';
$lang->job->create = '创建构建任务';
$lang->job->edit = '编辑构建任务';
$lang->job->exec = '执行构建';
$lang->job->create = '添加流水线';
$lang->job->edit = '编辑流水线';
$lang->job->exec = '执行流水线';
$lang->job->runPipeline = '运行流水线';
$lang->job->view = '执行详情';
$lang->job->delete = '删除构建任务';
$lang->job->confirmDelete = '确认删除该构建任务';
$lang->job->delete = '删除流水线';
$lang->job->confirmDelete = '确认删除该流水线';
$lang->job->dirChange = '目录改动';
$lang->job->buildTag = '打标签';
$lang->job->execSuccess = '执行成功';
@@ -23,7 +23,7 @@ $lang->job->jenkins = 'Jenkins';
$lang->job->jkHost = 'Jenkins服务器';
$lang->job->jkJob = 'Jenkins任务';
$lang->job->buildSpec = '构建对象'; // 'pipeline@server'
$lang->job->engine = '构建引擎';
$lang->job->engine = '引擎';
$lang->job->server = '服务器';
$lang->job->pipeline = '流水线';
$lang->job->buildType = '构建类型';
+8 -8
View File
@@ -1,13 +1,13 @@
<?php
$lang->job->common = '構建任務';
$lang->job->browse = '瀏覽構建任務';
$lang->job->create = '創建構建任務';
$lang->job->edit = '編輯構建任務';
$lang->job->browse = '瀏覽流水線';
$lang->job->create = '創建流水線';
$lang->job->edit = '編輯流水線';
$lang->job->exec = '執行構建';
$lang->job->runPipeline = '運行流水綫';
$lang->job->runPipeline = '運行流水線';
$lang->job->view = '執行詳情';
$lang->job->delete = '刪除構建任務';
$lang->job->confirmDelete = '確認刪除該構建任務';
$lang->job->delete = '刪除流水線';
$lang->job->confirmDelete = '確認刪除該流水線';
$lang->job->dirChange = '目錄改動';
$lang->job->buildTag = '打標籤';
$lang->job->execSuccess = '執行成功';
@@ -23,9 +23,9 @@ $lang->job->jenkins = 'Jenkins';
$lang->job->jkHost = 'Jenkins伺服器';
$lang->job->jkJob = 'Jenkins任務';
$lang->job->buildSpec = '構建對象'; // 'pipeline@server'
$lang->job->engine = '構建引擎';
$lang->job->engine = '引擎';
$lang->job->server = '伺服器';
$lang->job->pipeline = '流水綫';
$lang->job->pipeline = '流水線';
$lang->job->buildType = '構建類型';
$lang->job->frame = '工具/框架';
$lang->job->triggerType = '觸發方式';
+1 -1
View File
@@ -13,7 +13,7 @@
<?php include '../../common/view/header.html.php';?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php echo html::a($this->createLink('job', 'browse', "repoID=$repoID"), "<span class='text'>{$lang->ci->task}</span>", '', "class='btn btn-link btn-active-text'");?>
<?php echo html::a($this->createLink('job', 'browse', "repoID=$repoID"), "<span class='text'>{$lang->ci->list}</span>", '', "class='btn btn-link btn-active-text'");?>
<?php echo html::a($this->createLink('compile', 'browse', "repoID=$repoID"), "<span class='text'>{$lang->ci->history}</span>", '', "class='btn btn-link'");?>
</div>
<div class="btn-toolbar pull-right">
+1 -1
View File
@@ -1329,7 +1329,7 @@ class project extends control
$hasProduct = $this->dao->findByID($projectID)->from(TABLE_PROJECT)->fetch('hasProduct');
if($hasProduct) $this->lang->modulePageNav = $this->product->select($products, $productID, 'project', 'testcase', $extra, $branch);
echo $this->fetch('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType&param=$param&orderBy=$orderBy&recTotal=$orderBy&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID");
echo $this->fetch('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType&param=$param&caseType=&orderBy=$orderBy&recTotal=$orderBy&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID");
}
/**
+10 -10
View File
@@ -11,7 +11,7 @@
<?php
include '../../common/view/header.lite.html.php';
js::set('objectType', $objectType);
js::set('objectID', $object->id);
js::set('objectID', zget($object, 'id', ''));
?>
<div class="main-col linkContent main">
<div class="content pane">
@@ -21,54 +21,54 @@ js::set('objectID', $object->id);
<?php if($objectType == 'story'):?>
<tr>
<td class="text">
<strong class='text-primary'><?php echo $object->title;?></strong>
<strong class='text-primary'><?php echo zget($object, 'title', '');?></strong>
</td>
</tr>
<tr>
<td class="text">
<div class="spec-content detail-content article-content">
<?php echo $object->spec; ?>
<?php echo zget($object, 'spec', ''); ?>
</div>
</td>
</tr>
<tr>
<td class="text">
<div class="detail-content article-content">
<?php echo $object->verify; ?>
<?php echo zget($object, 'verify', ''); ?>
</div>
</td>
</tr>
<?php elseif($objectType == 'task'):?>
<tr>
<td class="text">
<strong class='text-primary'><?php echo $object->name;?></strong>
<strong class='text-primary'><?php echo zget($object, 'name', '');?></strong>
</td>
</tr>
<tr>
<td class="text">
<div class="spec-content detail-content article-content">
<?php echo $object->desc; ?>
<?php echo zget($object, 'desc', ''); ?>
</div>
</td>
</tr>
<tr>
<td class="text">
<div class="detail-content article-content">
<?php echo $object->storyTitle; ?>
<?php echo zget($object, 'storyTitle', ''); ?>
</div>
</td>
</tr>
<?php elseif($objectType == 'bug'):?>
<tr>
<td class="text">
<strong class='text-primary' data-id='<?php echo $object->id;?>'><?php echo $object->title;?></strong>
<strong class='text-primary' data-id='<?php echo zget($object, 'id', '');?>'><?php echo zget($object, 'title', '');?></strong>
</td>
</tr>
<?php if($object->steps):?>
<?php if(zget($object, 'steps', '')):?>
<tr>
<td class="text">
<div class="spec-content detail-content article-content">
<?php echo $object->steps; ?>
<?php echo zget($object, 'steps', ''); ?>
</div>
</td>
</tr>
+1 -1
View File
@@ -230,6 +230,6 @@ $config->testcase->datatable->fieldList['stepNumber']['name'] = $lang->testc
$config->testcase->datatable->fieldList['actions']['title'] = 'actions';
$config->testcase->datatable->fieldList['actions']['fixed'] = 'right';
$config->testcase->datatable->fieldList['actions']['width'] = '150';
$config->testcase->datatable->fieldList['actions']['width'] = '180';
$config->testcase->datatable->fieldList['actions']['required'] = 'yes';
$config->testcase->datatable->fieldList['actions']['sort'] = 'no';
+25 -6
View File
@@ -78,6 +78,7 @@ class testcase extends control
* @param int|string $branch
* @param string $browseType
* @param int $param
* @param string $caseType
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
@@ -86,7 +87,7 @@ class testcase extends control
* @access public
* @return void
*/
public function browse($productID = 0, $branch = '', $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0)
public function browse($productID = 0, $branch = '', $browseType = 'all', $param = 0, $caseType = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0)
{
$this->loadModel('datatable');
$this->app->loadLang('zanode');
@@ -145,11 +146,11 @@ class testcase extends control
$sort = common::appendOrder($orderBy);
/* Get test cases. */
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $sort, $pager);
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $caseType, $sort, $pager);
if(empty($cases) and $pageID > 1)
{
$pager = pager::init(0, $recPerPage, 1);
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $sort, $pager);
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $caseType, $sort, $pager);
}
/* save session .*/
@@ -220,6 +221,7 @@ class testcase extends control
$this->view->orderBy = $orderBy;
$this->view->browseType = $browseType;
$this->view->param = $param;
$this->view->caseType = $caseType;
$this->view->cases = $cases;
$this->view->branch = (!empty($product) and $product->type != 'normal') ? $branch : 0;
$this->view->branchOption = $branchOption;
@@ -238,11 +240,14 @@ class testcase extends control
* Group case.
*
* @param int $productID
* @param string $branch
* @param string $groupBy
* @param int $projectID
* @param string $caseType
* @access public
* @return void
*/
public function groupCase($productID = 0, $branch = '', $groupBy = 'story', $projectID = 0)
public function groupCase($productID = 0, $branch = '', $groupBy = 'story', $projectID = 0, $caseType = '')
{
$groupBy = empty($groupBy) ? 'story' : $groupBy;
$productID = $this->product->saveState($productID, $this->products);
@@ -260,7 +265,7 @@ class testcase extends control
$this->session->set('caseList', $this->app->getURI(true), $this->app->tab);
$cases = $this->testcase->getModuleCases($productID, $branch, 0, $groupBy);
$cases = $this->testcase->getModuleCases($productID, $branch, 0, '', 'no', $caseType, $groupBy);
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false);
$cases = $this->loadModel('story')->checkNeedConfirm($cases);
$cases = $this->testcase->appendData($cases);
@@ -296,6 +301,7 @@ class testcase extends control
$this->view->suiteID = 0;
$this->view->moduleID = 0;
$this->view->branch = $branch;
$this->view->caseType = $caseType;
$this->view->product = $product;
$this->display();
}
@@ -620,7 +626,7 @@ class testcase extends control
$currentModule = $this->app->tab == 'project' ? 'project' : 'testcase';
$currentMethod = $this->app->tab == 'project' ? 'testcase' : 'browse';
$projectParam = $this->app->tab == 'project' ? "projectID={$this->session->project}&" : '';
return print(js::locate($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=all&param=0&orderBy=id_desc"), 'parent'));
return print(js::locate($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=all&param=0&caseType=&orderBy=id_desc"), 'parent'));
}
if(empty($this->products)) $this->locate($this->createLink('product', 'create'));
@@ -2350,6 +2356,19 @@ class testcase extends control
$this->display();
}
/**
* Show script.
*
* @param int $caseID
* @access public
* @return void
*/
public function showScript($caseID)
{
$this->view->case = $this->testcase->getByID($caseID);
$this->display();
}
/**
* Automation test setting.
*
+3
View File
@@ -0,0 +1,3 @@
.repoCode pre {margin: 0; padding: 0; background: white; border: none;}
.repoCode pre > table > tbody > tr > th, .repoCode pre > table > tbody > tr > td {padding: 1px 3px;}
.repoCode pre > table > tbody > tr > th {border-right: 1px solid #E4E4E4; background: #fafafa; color: #999; width: 40px; text-align: right; vertical-align: top;}
+7
View File
@@ -31,5 +31,12 @@ $(function()
$('#caseIdList').val(storyIdList);
});
});
$('input[name^="showAutoCase"]').click(function()
{
var showAutoCase = $(this).is(':checked') ? 1 : 0;
$.cookie('showAutoCase', showAutoCase, {expires:config.cookieLife, path:config.webRoot});
window.location.reload();
});
});
+9
View File
@@ -0,0 +1,9 @@
$(function()
{
$('input[name^="showAutoCase"]').click(function()
{
var showAutoCase = $(this).is(':checked') ? 1 : 0;
$.cookie('showAutoCase', showAutoCase, {expires:config.cookieLife, path:config.webRoot});
window.location.reload();
});
})
+20
View File
@@ -0,0 +1,20 @@
$(document).ready(function()
{
var $pre = $('.repoCode .content pre');
var rowTip = '';
if($('#rowTip').length > 0) rowTip = $('#rowTip').html();
if($pre.length)
{
hljs.initHighlightingOnLoad();
var content = hljs.highlight($pre.attr('class'), $pre.text());
var code = '', line;
var arr = content.value.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/);
for(var i = 0 ; i < arr.length ; i++)
{
line = i + 1;
code += "<tr data-line='" + line +"'><th id='L" + line + "'><div class='comment-btn view'></div>" + line + "</th><td>" + (arr[i] || '&nbsp;') + rowTip + "</td></tr>";
}
$pre.html("<table><tbody>" + code + "</tbody></table>");
}
});
+3
View File
@@ -151,6 +151,7 @@ $lang->testcase->step = 'Schritt';
$lang->testcase->stepChild = 'Teilschritt';
$lang->testcase->viewAll = 'Alle anziegen';
$lang->testcase->importToLib = "Import To Library";
$lang->testcase->showScript = 'Show Script';
$lang->testcase->new = 'Neu';
@@ -256,11 +257,13 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
$lang->testcase->featureBar['browse']['wait'] = 'Wartend';
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
$lang->testcase->featureBar['browse']['group'] = 'Group View';
$lang->testcase->featureBar['browse']['zerocase'] = 'Zero Case Story';
$lang->testcase->featureBar['browse']['browseunits'] = 'Unit Test';
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
$lang->testcase->featureBar['browse']['suite'] = 'Suite';
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
+3
View File
@@ -151,6 +151,7 @@ $lang->testcase->step = 'Steps';
$lang->testcase->stepChild = 'Child Steps';
$lang->testcase->viewAll = 'All Cases';
$lang->testcase->importToLib = "Import To Library";
$lang->testcase->showScript = 'Show Script';
$lang->testcase->new = 'New';
@@ -256,11 +257,13 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
$lang->testcase->featureBar['browse']['wait'] = 'Waiting';
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
$lang->testcase->featureBar['browse']['group'] = 'Group View';
$lang->testcase->featureBar['browse']['zerocase'] = 'Zero Case Story';
$lang->testcase->featureBar['browse']['browseunits'] = 'Unit Test';
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
$lang->testcase->featureBar['browse']['suite'] = 'Suite';
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
+3
View File
@@ -151,6 +151,7 @@ $lang->testcase->step = 'Etapes';
$lang->testcase->stepChild = 'Sous-Etapes';
$lang->testcase->viewAll = 'Tous les CasTests';
$lang->testcase->importToLib = "Import To Library";
$lang->testcase->showScript = 'Show Script';
$lang->testcase->new = 'Nouveau';
@@ -256,11 +257,13 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
$lang->testcase->featureBar['browse']['wait'] = 'En Attente';
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
$lang->testcase->featureBar['browse']['group'] = 'Group View';
$lang->testcase->featureBar['browse']['zerocase'] = 'Zero Case Story';
$lang->testcase->featureBar['browse']['browseunits'] = 'Unit Test';
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
$lang->testcase->featureBar['browse']['suite'] = 'Suite';
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
+6
View File
@@ -75,6 +75,9 @@ $lang->testcase->fromTesttask = 'Từ Yêu cầu Test';
$lang->testcase->fromCaselib = 'Từ thư viện tình huống';
$lang->testcase->deleted = 'Đã xóa';
$lang->testcase->browseUnits = 'Unit Test';
$lang->testcase->caseType = 'Case Type';
$lang->testcase->allType = 'All Types';
$lang->testcase->showAutoCase = 'Show Automated Test Cases';
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
@@ -123,6 +126,7 @@ $lang->testcase->groupName = 'Tên nhóm';
$lang->testcase->step = 'Các bước';
$lang->testcase->stepChild = 'Các bước con';
$lang->testcase->viewAll = 'Tất cả tình huống';
$lang->testcase->showScript = 'Show Script';
$lang->testcase->new = 'Mới';
@@ -222,6 +226,7 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
$lang->testcase->featureBar['browse']['wait'] = 'Đang đợi';
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
@@ -229,4 +234,5 @@ $lang->testcase->featureBar['browse']['group'] = 'Group View';
$lang->testcase->featureBar['browse']['suite'] = 'Suite';
$lang->testcase->featureBar['browse']['zerocase'] = 'Zero Case Story';
$lang->testcase->featureBar['browse']['browseunits'] = 'Unit Test';
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
+5 -2
View File
@@ -150,7 +150,8 @@ $lang->testcase->groupName = '分组名称';
$lang->testcase->step = '步骤';
$lang->testcase->stepChild = '子步骤';
$lang->testcase->viewAll = '查看所有';
$lang->testcase->importToLib = "导入用例库";
$lang->testcase->importToLib = '导入用例库';
$lang->testcase->showScript = '查看自动化脚本';
$lang->testcase->new = '新增';
@@ -256,11 +257,13 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
$lang->testcase->featureBar['browse']['all'] = '全部';
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
$lang->testcase->featureBar['browse']['wait'] = '待评审';
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
$lang->testcase->featureBar['browse']['group'] = '分组查看';
$lang->testcase->featureBar['browse']['zerocase'] = "零用例{$lang->SRCommon}";
$lang->testcase->featureBar['browse']['browseunits'] = '单元测试';
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
$lang->testcase->featureBar['browse']['suite'] = '套件';
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
+52 -10
View File
@@ -238,14 +238,15 @@ class testcaseModel extends model
* @param int $productID
* @param int|string $branch
* @param int $moduleIdList
* @param string $orderBy
* @param object $pager
* @param string $browseType
* @param string $auto no|unit
* @param string $caseType
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getModuleCases($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
public function getModuleCases($productID, $branch = 0, $moduleIdList = 0, $browseType = '', $auto = 'no', $caseType = '', $orderBy = 'id_desc', $pager = null)
{
$stmt = $this->dao->select('t1.*, t2.title as storyTitle, t2.deleted as storyDeleted')->from(TABLE_CASE)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id');
@@ -259,6 +260,8 @@ class testcaseModel extends model
->beginIF($browseType == 'wait')->andWhere('t1.status')->eq($browseType)->fi()
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
->beginIF(!$this->cookie->showAutoCase)->andWhere('t1.auto')->ne('auto')->fi()
->beginIF($caseType)->andWhere('t1.type')->eq($caseType)->fi()
->andWhere('t1.deleted')->eq('0')
->orderBy($orderBy)
->page($pager)
@@ -271,14 +274,15 @@ class testcaseModel extends model
* @param int $productID
* @param int|string $branch
* @param int $moduleIdList
* @param string $orderBy
* @param object $pager
* @param string $browseType
* @param string $auto no|unit
* @param string $caseType
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getModuleProjectCases($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
public function getModuleProjectCases($productID, $branch = 0, $moduleIdList = 0, $browseType = '', $auto = 'no', $caseType = '', $orderBy = 'id_desc', $pager = null)
{
$executions = $this->loadModel('execution')->getIdList($this->session->project);
array_push($executions, $this->session->project);
@@ -294,6 +298,8 @@ class testcaseModel extends model
->beginIF($browseType == 'wait')->andWhere('t2.status')->eq($browseType)->fi()
->beginIF($auto == 'unit')->andWhere('t2.auto')->eq('unit')->fi()
->beginIF($auto != 'unit')->andWhere('t2.auto')->ne('unit')->fi()
->beginIF(!$this->cookie->showAutoCase)->andWhere('t2.auto')->ne('auto')->fi()
->beginIF($caseType)->andWhere('t2.type')->eq($caseType)->fi()
->andWhere('t2.deleted')->eq('0')
->orderBy($orderBy)
->page($pager, 't1.case')
@@ -398,6 +404,35 @@ class testcaseModel extends model
->orderBy($orderBy)->page($pager)->fetchAll('id');
}
/**
* Get cases by type.
*
* @param int $productID
* @param int|string $branch
* @param int $suiteID
* @param array $moduleIdList
* @param string $orderBy
* @param object $pager
* @param string $auto no|unit
* @access public
* @return array
*/
public function getByType($productID, $branch = 0, $type = '', $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $auto = 'no')
{
return $this->dao->select('t1.*, t2.title as storyTitle')->from(TABLE_CASE)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id')
->where('t1.product')->eq((int)$productID)
->beginIF($this->app->tab == 'project')->andWhere('t1.project')->eq($this->session->project)->fi()
->beginIF($type)->andWhere('t1.type')->eq($type)->fi()
->beginIF($branch !== 'all')->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($moduleIdList)->andWhere('t1.module')->in($moduleIdList)->fi()
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
->andWhere('t1.deleted')->eq('0')
->orderBy($orderBy)->page($pager)
->fetchAll('id');
}
/**
* Get case info by ID.
*
@@ -487,18 +522,20 @@ class testcaseModel extends model
* @param string $browseType
* @param int $queryID
* @param int $moduleID
* @param string $caseType
* @param string $sort
* @param object $pager
* @param string $auto no|unit
* @access public
* @return array
*/
public function getTestCases($productID, $branch, $browseType, $queryID, $moduleID, $sort, $pager, $auto = 'no')
public function getTestCases($productID, $branch, $browseType, $queryID, $moduleID, $caseType = '', $sort = 'id_desc', $pager = null, $auto = 'no')
{
/* Set modules and browse type. */
$modules = $moduleID ? $this->loadModel('tree')->getAllChildId($moduleID) : '0';
$browseType = ($browseType == 'bymodule' and $this->session->caseBrowseType and $this->session->caseBrowseType != 'bysearch') ? $this->session->caseBrowseType : $browseType;
$group = $this->lang->navGroup->testcase;
$auto = $this->cookie->showAutoCase ? 'auto' : $auto;
/* By module or all cases. */
$cases = array();
@@ -506,11 +543,11 @@ class testcaseModel extends model
{
if($this->app->tab == 'project')
{
$cases = $this->getModuleProjectCases($productID, $branch, $modules, $sort, $pager, $browseType, $auto);
$cases = $this->getModuleProjectCases($productID, $branch, $modules, $browseType, $auto, $caseType, $sort, $pager);
}
else
{
$cases = $this->getModuleCases($productID, $branch, $modules, $sort, $pager, $browseType, $auto);
$cases = $this->getModuleCases($productID, $branch, $modules, $browseType, $auto, $caseType, $sort, $pager);
}
}
/* Cases need confirmed. */
@@ -528,6 +565,8 @@ class testcaseModel extends model
->beginIF($modules)->andWhere('t1.module')->in($modules)->fi()
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
->beginIF(!$this->cookie->showAutoCase)->andWhere('t1.auto')->ne('auto')->fi()
->beginIF($caseType)->andWhere('t1.type')->eq($caseType)->fi()
->orderBy($sort)
->page($pager, 't1.id')
->fetchAll();
@@ -2040,9 +2079,11 @@ class testcaseModel extends model
{
$showBranch = isset($this->config->testcase->browse->showBranch) ? $this->config->testcase->browse->showBranch : 1;
}
$autoIcon = $case->auto == 'auto' ? " <i class='icon icon-ztf'></i>" : '';
if(isset($branches[$case->branch]) and $showBranch) echo "<span class='label label-outline label-badge'>{$branches[$case->branch]}</span> ";
if($modulePairs and $case->module and isset($modulePairs[$case->module])) echo "<span class='label label-gray label-badge'>{$modulePairs[$case->module]}</span> ";
echo $canView ? ($fromCaseID ? html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'") . html::a(helper::createLink('testcase', 'view', "caseID=$fromCaseID"), "[<i class='icon icon-share' title='{$this->lang->testcase->fromCaselib}'></i>#$fromCaseID]", '', "data-app='{$this->app->tab}'") : html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'")) : "<span style='color: $case->color'>$case->title</span>";
echo $canView ? ($fromCaseID ? html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'") . html::a(helper::createLink('testcase', 'view', "caseID=$fromCaseID"), "[<i class='icon icon-share' title='{$this->lang->testcase->fromCaselib}'></i>#$fromCaseID]" . $autoIcon, '', "data-app='{$this->app->tab}'") : html::a($caseLink, $case->title . $autoIcon, null, "style='color: $case->color' data-app='{$this->app->tab}'")) : "<span style='color: $case->color'>$case->title</span>";
break;
case 'branch':
echo $branches[$case->branch];
@@ -2524,6 +2565,7 @@ class testcaseModel extends model
}
$menu .= $this->buildMenu('testtask', 'runCase', "runID=0&$params&version=$case->version", $case, 'browse', 'play', '', 'runCase iframe', false, "data-width='95%'");
if($case->auto == 'auto') $menu .= $this->buildMenu('testcase', 'showScript', $params, $case, 'browse', 'file-code', '', 'runCase iframe', false);
$menu .= $this->buildMenu('testtask', 'results', "runID=0&$params", $case, 'browse', '', '', 'iframe', true, "data-width='95%'");
$editParams = $params;
+47 -4
View File
@@ -13,6 +13,7 @@
.btn-group a.btn-primary {border-right: 1px solid rgba(255,255,255,0.2);}
.btn-group button.dropdown-toggle.btn-primary {padding:6px;}
.body-modal #mainMenu>.btn-toolbar {width: auto;}
#mainMenu .pull-left .checkbox-primary {margin-top: 5px;}
#mainMenu .dividing-line {width: 1px; height: 16px; display: inline-block; background: #D8DBDE; margin: 7px 8px 0 0; float: left;}
</style>
<div id='mainMenu' class='clearfix'>
@@ -48,6 +49,7 @@
<?php
if(isset($menuItem->hidden)) continue;
$menuType = $menuItem->name;
$caseType = isset($caseType) ? $caseType : '';
if(!$config->testcase->needReview and empty($config->testcase->forceReview) and $menuType == 'wait') continue;
if($hasBrowsePriv and $menuType == 'QUERY' and in_array($browseType, array('all', 'needconfirm', 'bysuite')))
{
@@ -55,9 +57,50 @@
$isBySearch = $browseType == 'bysearch';
include '../../common/view/querymenu.html.php';
}
elseif($hasBrowsePriv and $menuType == 'casetype')
{
if($this->moduleName == 'testtask' and $this->methodName == 'browseunits') continue;
if($this->moduleName == 'story' and $this->methodName == 'zerocase') continue;
if($browseType == 'bysuite') continue;
$lang->testcase->typeList[''] = $lang->testcase->allType;
$currentTypeName = zget($lang->testcase->typeList, $caseType, '');
$currentLable = empty($currentTypeName) ? $lang->testcase->allType : $currentTypeName;
if(!isset($param)) $param = 0;
echo "<div id='byTypeTab' class='btn-group'>";
echo html::a('javascript:;', "<span class='text'>{$currentLable}</span>" . " <span class='caret'></span>", '', "class='btn btn-link' data-toggle='dropdown'");
echo "<ul class='dropdown-menu' style='max-height:240px; overflow-y:auto'>";
foreach($lang->testcase->typeList as $type => $typeName)
{
echo '<li' . ($type == $caseType ? " class='active'" : '') . '>';
if(isset($groupBy))
{
echo html::a($this->createLink('testcase', 'groupCase', "productID=$productID&branch=$branch&groupBy=story&projectID=$projectID&caseType=$type"), $typeName);
}
else
{
echo html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType&param=$param&caseType=$type"), $typeName);
}
echo "</li>";
}
echo '</ul></div>';
}
elseif($hasBrowsePriv and $menuType == 'autocase')
{
if($this->moduleName == 'testtask' and $this->methodName == 'browseunits') continue;
if($this->moduleName == 'story' and $this->methodName == 'zerocase') continue;
if($browseType == 'bysuite' or $browseType == 'bysearch') continue;
echo html::checkbox('showAutoCase', array('1' => $lang->testcase->showAutoCase), '', $this->cookie->showAutoCase ? 'checked=checked' : '');
}
elseif($hasBrowsePriv and ($menuType == 'all' or $menuType == 'needconfirm' or $menuType == 'wait'))
{
echo html::a($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=$menuType"), "<span class='text'>{$menuItem->text}</span>", '', "class='btn btn-link' id='{$menuType}Tab' data-app='{$this->app->tab}'");
echo html::a($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=$menuType&param=0&caseType=$caseType"), "<span class='text'>{$menuItem->text}</span>", '', "class='btn btn-link' id='{$menuType}Tab' data-app='{$this->app->tab}'");
}
elseif($hasBrowsePriv and $menuType == 'suite' and $this->app->tab == 'qa')
{
@@ -67,10 +110,10 @@
echo "<div id='bysuiteTab' class='btn-group'>";
echo html::a('javascript:;', "<span class='text'>{$currentLable}</span>" . " <span class='caret'></span>", '', "class='btn btn-link' data-toggle='dropdown'");
echo "<ul class='dropdown-menu' style='max-height:240px; overflow-y:auto'>";
if(empty($productID) or common::canModify('product', $product))
{
echo "<ul class='dropdown-menu' style='max-height:240px; overflow-y:auto'>";
if(empty($suiteList))
{
echo '<li>';
@@ -103,7 +146,7 @@
$projectID = $isProjectApp ? $this->session->project : 0;
echo html::a($this->createLink('testcase', 'zeroCase', "productID=$productID&branch=$branch&orderBy=id_desc&projectID=$projectID"), "<span class='text'>{$lang->testcase->zeroCase}</span>", '', "class='btn btn-link' id='zerocaseTab' data-app='{$this->app->tab}'");
}
elseif($hasUnitPriv and $menuType == 'browseunits')
elseif($hasUnitPriv and $menuType == 'browseunits' and !$caseType)
{
echo html::a($this->createLink('testtask', 'browseUnits', "productID=$productID&browseType=newest&orderBy=id_desc&recTotal=0&recPerPage=20&pageID=1&projectID=$projectID"), "<span class='text'>{$lang->testcase->browseUnits}</span>", '', "class='btn btn-link' id='browseunitsTab' data-app='{$this->app->tab}'");
}
+31
View File
@@ -0,0 +1,31 @@
<?php
/**
* The show script view file of testcase of ZenTaoPMS.
*
* @copyright Copyright 2009-2022 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Yuchun Li <liyuchun@easycorp.ltd>
* @package testcase
* @version $Id: showscript.html.php 4723 2022-07-28 08:47:29Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php
include '../../common/view/header.lite.html.php';
css::import($jsRoot . 'misc/highlight/styles/code.css');
js::import($jsRoot . 'misc/highlight/highlight.pack.js');
?>
<div id='mainContent' class='main-content'>
<div class='main-header'>
<h2>
<span class='label label-id'><?php echo $case->id;?></span>
<span title='<?php echo $case->title?>'><?php echo $case->title;?></span>
</h2>
</div>
<div class="main-col repoCode main">
<div class="content panel">
<pre class="cpp"><?php echo trim(htmlSpecialString($case->script, defined('ENT_SUBSTITUTE') ? ENT_QUOTES | ENT_SUBSTITUTE : ENT_QUOTES));?></pre>
</div>
</div>
</div>
<?php include '../../common/view/footer.lite.html.php';?>
+17 -15
View File
@@ -94,19 +94,20 @@ class testcaseTest
/**
* Test get cases of a module.
*
* @param int $productID
* @param int $branch
* @param int $moduleIdList
* @param string $orderBy
* @param object $pager
* @param int $productID
* @param int $branch
* @param int $moduleIdList
* @param string $browseType
* @param string $auto
* @param string $caseType
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getModuleCasesTest($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
public function getModuleCasesTest($productID, $branch = 0, $moduleIdList = 0, $browseType = '', $auto = 'no', $caseType = '', $orderBy = 'id_desc', $pager = null)
{
$objects = $this->objectModel->getModuleCases($productID, $branch, $moduleIdList, $orderBy, $pager, $browseType, $auto);
$objects = $this->objectModel->getModuleCases($productID, $branch, $moduleIdList, $browseType, $auto, $caseType, $orderBy, $pager);
if(dao::isError()) return dao::getError();
@@ -116,19 +117,20 @@ class testcaseTest
/**
* Test get project cases of a module.
*
* @param int $productID
* @param int $branch
* @param int $moduleIdList
* @param string $orderBy
* @param object $pager
* @param int $productID
* @param int $branch
* @param int $moduleIdList
* @param string $browseType
* @param string $auto
* @param string $caseType
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getModuleProjectCasesTest($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
public function getModuleProjectCasesTest($productID, $branch = 0, $moduleIdList = 0, $browseType = '', $auto = 'no', $caseType = '', $orderBy = 'id_desc', $pager = null)
{
$objects = $this->objectModel->getModuleProjectCases($productID, $branch, $moduleIdList, $orderBy, $pager, $browseType, $auto);
$objects = $this->objectModel->getModuleProjectCases($productID, $branch, $moduleIdList, $browseType, $auto, $caseType, $orderBy, $pager);
if(dao::isError()) return dao::getError();
@@ -221,7 +223,7 @@ class testcaseTest
*/
public function getTestCasesTest($productID, $browseType, $queryID, $auto = 'no')
{
$objects = $this->objectModel->getTestCases($productID, 0, $browseType, $queryID, $moduleID, 'id_desc', null, $auto);
$objects = $this->objectModel->getTestCases($productID, 0, $browseType, $queryID, $moduleID, '', 'id_desc', null, $auto);
if(dao::isError()) return dao::getError();