diff --git a/module/testcase/model.php b/module/testcase/model.php index 01a18e3393..7f47f8e0ea 100755 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -262,6 +262,8 @@ class testcaseModel extends model */ public function getTestCases(int $productID, string|int $branch, string $browseType, int $queryID, int $moduleID, string $caseType = '', string $auto = 'no', string $orderBy = 'id_desc', object $pager = null): array { + if(common::isTutorialMode()) return $this->loadModel('tutorial')->getCases(); + $modules = $moduleID ? $this->loadModel('tree')->getAllChildId($moduleID) : array(); $browseType = ($browseType == 'bymodule' and $this->session->caseBrowseType and $this->session->caseBrowseType != 'bysearch') ? $this->session->caseBrowseType : $browseType; $auto = $this->cookie->onlyAutoCase ? 'auto' : $auto; diff --git a/module/testcase/ui/header.html.php b/module/testcase/ui/header.html.php index f5f463dd6c..2c8c00c960 100644 --- a/module/testcase/ui/header.html.php +++ b/module/testcase/ui/header.html.php @@ -294,7 +294,7 @@ toolbar setClass('btn primary'), set::icon('plus'), set::url($currentCreateItem['url']), - set(array('data-app' => $app->tab)), + set(array('data-app' => $app->tab, 'class' => 'createBtn')), $currentCreateItem['text'] ), count($createItems) > 1 ? dropdown diff --git a/module/testtask/config/action.php b/module/testtask/config/action.php index f6781df1ec..5e1df7c793 100644 --- a/module/testtask/config/action.php +++ b/module/testtask/config/action.php @@ -45,6 +45,7 @@ $config->testtask->actionList['report']['text'] = $lang->testtask->testrepor $config->testtask->actionList['report']['hint'] = $lang->testtask->testreport; $config->testtask->actionList['report']['url'] = array('module' => 'testreport', 'method' => 'browse', 'params' => 'objectID={product}&objectType=product&extra={id}'); $config->testtask->actionList['report']['data-app'] = $app->tab; +$config->testtask->actionList['report']['class'] = 'testreport-browse-btn'; $config->testtask->actionList['view']['icon'] = 'list-alt'; $config->testtask->actionList['view']['text'] = $lang->testtask->view; @@ -91,6 +92,7 @@ $config->testtask->cases->actionList['runCase']['hint'] = $lang->testtask $config->testtask->cases->actionList['runCase']['url'] = array('module' => 'testtask', 'method' => 'runCase', 'params' => 'id={id}'); $config->testtask->cases->actionList['runCase']['data-size'] = 'lg'; $config->testtask->cases->actionList['runCase']['data-toggle'] = 'modal'; +$config->testtask->cases->actionList['runCase']['class'] = 'testtask-runCase-btn'; $config->testtask->cases->actionList['results']['icon'] = 'list-alt'; $config->testtask->cases->actionList['results']['text'] = $lang->testtask->results; @@ -98,6 +100,7 @@ $config->testtask->cases->actionList['results']['hint'] = $lang->testtask->resul $config->testtask->cases->actionList['results']['url'] = array('module' => 'testtask', 'method' => 'results', 'params' => 'id={id}'); $config->testtask->cases->actionList['results']['data-size'] = 'lg'; $config->testtask->cases->actionList['results']['data-toggle'] = 'modal'; +$config->testtask->cases->actionList['results']['class'] = 'testtask-results-btn'; $config->testtask->cases->actionList['unlinkCase']['icon'] = 'unlink'; $config->testtask->cases->actionList['unlinkCase']['text'] = $lang->testtask->unlinkCase; diff --git a/module/testtask/model.php b/module/testtask/model.php index 1ba36bf15a..ba57f75e71 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1211,7 +1211,7 @@ class testtaskModel extends model */ public function getRunById(int $runID): object|false { - $run = $this->dao->findById($runID)->from(TABLE_TESTRUN)->fetch(); + $run = common::isTutorialMode() ? $this->loadModel('tutorial')->getRun() : $this->dao->findById($runID)->from(TABLE_TESTRUN)->fetch(); if(!$run) return false; $run->case = $this->loadModel('testcase')->getById($run->case, $run->version); diff --git a/module/tutorial/config/testManage.php b/module/tutorial/config/testManage.php new file mode 100644 index 0000000000..05887cce16 --- /dev/null +++ b/module/tutorial/config/testManage.php @@ -0,0 +1,205 @@ +name = 'testManage'; +$testManage->title = $lang->tutorial->testManage->title; +$testManage->icon = 'sitemap text-special'; +$testManage->type = 'basic'; +$testManage->modules = 'testcase,testreport,testtask,bug'; +$testManage->app = 'project'; +$testManage->tasks = array(); + +$testManage->tasks['testManage'] = array(); +$testManage->tasks['testManage']['name'] = 'testManage'; +$testManage->tasks['testManage']['title'] = $lang->tutorial->testManage->title; +$testManage->tasks['testManage']['startUrl'] = array('qa', 'index'); +$testManage->tasks['testManage']['steps'] = array(); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'openApp', + 'app' => 'qa', + 'title' => $lang->tutorial->testManage->step1->name, + 'desc' => $lang->tutorial->testManage->step1->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'clickNavbar', + 'target' => 'testcase', + 'page' => 'qa-index', + 'title' => $lang->tutorial->testManage->step2->name, + 'desc' => $lang->tutorial->testManage->step2->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'click', + 'target' => '#actionBar a.createBtn', + 'page' => 'testcase-browse', + 'url' => array('testcase', 'browse', 'productID=1'), + 'title' => $lang->tutorial->testManage->step3->name, + 'desc' => $lang->tutorial->testManage->step3->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'form', + 'page' => 'testcase-create', + 'title' => $lang->tutorial->testManage->step4->name +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'saveForm', + 'page' => 'testcase-create', + 'title' => $lang->tutorial->testManage->step5->name, + 'desc' => $lang->tutorial->testManage->step5->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'clickNavbar', + 'target' => 'testtask', + 'page' => 'testcase-browse', + 'url' => array('testcase', 'browse', 'productID=1'), + 'title' => $lang->tutorial->testManage->step6->name, + 'desc' => $lang->tutorial->testManage->step6->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'click', + 'target' => '#actionBar a', + 'page' => 'testtask-browse', + 'title' => $lang->tutorial->testManage->step7->name, + 'desc' => $lang->tutorial->testManage->step7->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'form', + 'page' => 'testtask-create', + 'title' => $lang->tutorial->testManage->step8->name +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'saveForm', + 'page' => 'testtask-create', + 'title' => $lang->tutorial->testManage->step9->name, + 'desc' => $lang->tutorial->testManage->step9->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'click', + 'target' => 'div.dtable div[data-col="name"][data-row="1"] a', + 'page' => 'testtask-browse', + 'url' => array('testtask', 'browse', 'productID=1'), + 'title' => $lang->tutorial->testManage->step10->name, + 'desc' => $lang->tutorial->testManage->step10->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'click', + 'target' => '#actionBar a.linkCase-btn', + 'page' => 'testtask-cases', + 'title' => $lang->tutorial->testManage->step11->name, + 'desc' => $lang->tutorial->testManage->step11->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'selectRow', + 'target' => 'div.dtable div.dtable-body div[data-col="id"]', + 'page' => 'testtask-linkCase', + 'title' => $lang->tutorial->testManage->step12->name +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'click', + 'target' => 'div.dtable-footer nav.toolbar button', + 'page' => 'testtask-linkCase', + 'title' => $lang->tutorial->testManage->step13->name, + 'desc' => $lang->tutorial->testManage->step13->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'click', + 'target' => 'div.dtable div[data-col="actions"][data-row="1"] a.testtask-runCase-btn', + 'page' => 'testtask-cases', + 'url' => array('testtask', 'cases', 'taskID=1'), + 'title' => $lang->tutorial->testManage->step14->name, + 'desc' => $lang->tutorial->testManage->step14->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'form', + 'page' => 'testtask-cases', + 'title' => $lang->tutorial->testManage->step15->name +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'saveForm', + 'page' => 'testtask-cases', + 'title' => $lang->tutorial->testManage->step16->name, + 'desc' => $lang->tutorial->testManage->step16->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'click', + 'target' => 'div.dtable div[data-col="actions"][data-row="1"] a.testtask-results-btn', + 'page' => 'testtask-cases', + 'url' => array('testtask', 'cases', 'taskID=1'), + 'title' => $lang->tutorial->testManage->step17->name, + 'desc' => $lang->tutorial->testManage->step17->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'form', + 'target' => '.resultSteps div.steps-body', + 'page' => 'testtask-cases', + 'title' => $lang->tutorial->testManage->step18->name +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'saveForm', + 'target' => 'div.resultSteps button.to-bug-button', + 'page' => 'testtask-cases', + 'title' => $lang->tutorial->testManage->step19->name, + 'desc' => $lang->tutorial->testManage->step19->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'form', + 'page' => 'bug-create', + 'url' => array('bug', 'create', 'productID=1'), + 'title' => $lang->tutorial->testManage->step20->name +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'saveForm', + 'page' => 'bug-create', + 'title' => $lang->tutorial->testManage->step21->name +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'clickNavbar', + 'target' => 'testtask', + 'page' => 'bug-browse', + 'url' => array('bug', 'browse', 'productID=1'), + 'title' => $lang->tutorial->testManage->step22->name +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'click', + 'target' => 'div.dtable div[data-col="actions"] a.testreport-browse-btn', + 'page' => 'testtask-browse', + 'title' => $lang->tutorial->testManage->step23->name, + 'desc' => $lang->tutorial->testManage->step23->desc +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'form', + 'page' => 'testreport-create', + 'url' => array('testreport', 'create', 'executionID=3'), + 'title' => $lang->tutorial->testManage->step24->name +); + +$testManage->tasks['testManage']['steps'][] = array( + 'type' => 'saveForm', + 'page' => 'testreport-create', + 'title' => $lang->tutorial->testManage->step25->name, + 'desc' => $lang->tutorial->testManage->step25->desc +); diff --git a/module/tutorial/config/zenguides.php b/module/tutorial/config/zenguides.php index e8e5125cfe..98e12574eb 100644 --- a/module/tutorial/config/zenguides.php +++ b/module/tutorial/config/zenguides.php @@ -38,6 +38,7 @@ $config->tutorial->guides[$scrumProjectManage->basic->name] = $scrumProjectM $config->tutorial->guides[$waterfallProjectManage->basic->name] = $waterfallProjectManage->basic; $config->tutorial->guides[$kanbanProjectManage->basic->name] = $kanbanProjectManage->basic; $config->tutorial->guides[$taskManage->name] = $taskManage; +$config->tutorial->guides[$testManage->name] = $testManage; /* Advance tutorial. */ $config->tutorial->guides[$scrumProjectManage->advance->name] = $scrumProjectManage->advance; diff --git a/module/tutorial/lang/zh-cn.php b/module/tutorial/lang/zh-cn.php index 46db98101f..3cefdbcf9d 100644 --- a/module/tutorial/lang/zh-cn.php +++ b/module/tutorial/lang/zh-cn.php @@ -888,3 +888,98 @@ $lang->tutorial->taskManage->step23->name = '填写表单'; $lang->tutorial->taskManage->step24 = new stdClass(); $lang->tutorial->taskManage->step24->name = '保存表单'; $lang->tutorial->taskManage->step24->desc = '保存后任务状态变为已关闭'; + +$lang->tutorial->testManage = new stdClass(); +$lang->tutorial->testManage->title = '测试管理教程'; + +$lang->tutorial->testManage->step1 = new stdClass(); +$lang->tutorial->testManage->step1->name = '点击测试'; +$lang->tutorial->testManage->step1->desc = '点击测试进行测试管理'; + +$lang->tutorial->testManage->step2 = new stdClass(); +$lang->tutorial->testManage->step2->name = '点击用例'; +$lang->tutorial->testManage->step2->desc = '点击用例进行用例管理'; + +$lang->tutorial->testManage->step3 = new stdClass(); +$lang->tutorial->testManage->step3->name = '点击创建用例'; +$lang->tutorial->testManage->step3->desc = '可以在这里创建用例'; + +$lang->tutorial->testManage->step4 = new stdClass(); +$lang->tutorial->testManage->step4->name = '填写表单'; + +$lang->tutorial->testManage->step5 = new stdClass(); +$lang->tutorial->testManage->step5->name = '保存表单'; +$lang->tutorial->testManage->step5->desc = '保存后在用例列表中查看'; + +$lang->tutorial->testManage->step6 = new stdClass(); +$lang->tutorial->testManage->step6->name = '点击测试单'; +$lang->tutorial->testManage->step6->desc = '点击维护测试单信息'; + +$lang->tutorial->testManage->step7 = new stdClass(); +$lang->tutorial->testManage->step7->name = '点击提交测试'; +$lang->tutorial->testManage->step7->desc = '点击提交测试单会生成测试单'; + +$lang->tutorial->testManage->step8 = new stdClass(); +$lang->tutorial->testManage->step8->name = '填写表单'; + +$lang->tutorial->testManage->step9 = new stdClass(); +$lang->tutorial->testManage->step9->name = '保存表单'; +$lang->tutorial->testManage->step9->desc = '保存后在测试单列表查看'; + +$lang->tutorial->testManage->step10 = new stdClass(); +$lang->tutorial->testManage->step10->name = '点击测试单名称'; +$lang->tutorial->testManage->step10->desc = '点击查看测试单详情'; + +$lang->tutorial->testManage->step11 = new stdClass(); +$lang->tutorial->testManage->step11->name = '点击关联用例'; +$lang->tutorial->testManage->step11->desc = '点击将用例关联进测试单'; + +$lang->tutorial->testManage->step12 = new stdClass(); +$lang->tutorial->testManage->step12->name = '勾选用例'; +$lang->tutorial->testManage->step12->desc = '您可以将用例关联在测试单中'; + +$lang->tutorial->testManage->step13 = new stdClass(); +$lang->tutorial->testManage->step13->name = '点击保存'; +$lang->tutorial->testManage->step13->desc = '保存后用例成功关联进测试单'; + +$lang->tutorial->testManage->step14 = new stdClass(); +$lang->tutorial->testManage->step14->name = '点击执行'; +$lang->tutorial->testManage->step14->desc = '点击执行用例'; + +$lang->tutorial->testManage->step15 = new stdClass(); +$lang->tutorial->testManage->step15->name = '填写表单'; + +$lang->tutorial->testManage->step16 = new stdClass(); +$lang->tutorial->testManage->step16->name = '保存表单'; +$lang->tutorial->testManage->step16->desc = '保存后可以完成用例的执行'; + +$lang->tutorial->testManage->step17 = new stdClass(); +$lang->tutorial->testManage->step17->name = '点击执行结果'; +$lang->tutorial->testManage->step17->desc = '可以在这里执行用例'; + +$lang->tutorial->testManage->step18 = new stdClass(); +$lang->tutorial->testManage->step18->name = '选择用例步骤'; + +$lang->tutorial->testManage->step19 = new stdClass(); +$lang->tutorial->testManage->step19->name = '点击转Bug'; +$lang->tutorial->testManage->step19->desc = '可以将执行失败的用例步骤转为Bug'; + +$lang->tutorial->testManage->step20 = new stdClass(); +$lang->tutorial->testManage->step20->name = '填写表单'; + +$lang->tutorial->testManage->step21 = new stdClass(); +$lang->tutorial->testManage->step21->name = '保存表单'; + +$lang->tutorial->testManage->step22 = new stdClass(); +$lang->tutorial->testManage->step22->name = '点击测试单'; + +$lang->tutorial->testManage->step23 = new stdClass(); +$lang->tutorial->testManage->step23->name = '生成测试报告'; +$lang->tutorial->testManage->step23->desc = '可以在这里生成测试报告'; + +$lang->tutorial->testManage->step24 = new stdClass(); +$lang->tutorial->testManage->step24->name = '填写表单'; + +$lang->tutorial->testManage->step25 = new stdClass(); +$lang->tutorial->testManage->step25->name = '保存表单'; +$lang->tutorial->testManage->step25->desc = '保存后可以生成测试报告'; diff --git a/module/tutorial/model.php b/module/tutorial/model.php index 718b48ec4e..402cb89f03 100644 --- a/module/tutorial/model.php +++ b/module/tutorial/model.php @@ -725,6 +725,28 @@ class tutorialModel extends model return $builds; } + /** + * 获取新手模式测试单。 + * Get run. + * + * @access public + * @return object + */ + public function getRun(): object + { + $run = new stdClass(); + $run->id = 1; + $run->task = 1; + $run->version = 1; + $run->assignedTo = ''; + $run->lastRunner = ''; + $run->lastRunDate = ''; + $run->lastRunResult = ''; + $run->status = 'normal'; + $run->case = 1; + return $run; + } + /** * 获取新手模式用例。 * Get Cases.