+ 一、ZTF是什么
+
+ Zentao Testing Framework,简称ZTF,是一款开源自动化测试管理框架。
+ 和市面上已有的自动化测试框架相比,ZTF更聚焦于自动化测试的管理功能。
+ ZTF提供了自动化测试脚本的定义、管理、驱动、执行结果的回传、bug的创建以及和其他自动化测框架的集成。
+ ZTF使用go语言开发,可以支持各种平台。ZTF支持常见的编程语言,您可以选择您喜欢用的语言来开发自动化测试脚本。
+
+ 二、为什么来做ZTF
+
+ 市面上已经有很多自动化测试框架,我们为什么还要来做ZTF呢?ZTF主要是解决测试管理的问题。
+ 目前市面上的自动化测试框架主要分为两大类,一类是单元测试框架,一类是某种领域的自动化测试框架。
+ 单元测试框架是跟各个语言绑定的,比如cppunit, phpunit等。第二类框架以selenium为代表,可以用来做web的自动化测试。
+ 也还有做GUI或者手机应用乃至游戏等场景的自动化测试的框架。
+
+
+ 这就产生了一个问题,我们需要将这些自动化测试框架的测试脚本统一管理起来。
+ 每一个脚本都可以和测试管理系统里面的一个用例进行关联,脚本里面的步骤信息和管理系统里面的用例信息可以互相同步。
+ 测试执行的结果可以反映到测试管理系统中,失败的测试脚本可以创建bug。
+ 为此我们开发了ZTF测试管理框架。
+
+ 三、ZTF和其他自动化测试框架的关系
+
+ ZTF和其他的自动化测试框架是互相合作的关系。
+ 您可以继续使用之前的自动化测试框架来进行脚本的开发,只需要通过注释的方式加入几个标签就可以转换成ztf的自动化测试脚本。
+
+ 四、ZTF自动化测试框架的特点
+
+ - 简单:ZTF的语法标签和规则都很简单,一看就会,很容易上手。
+ - 跨平台:ZTF使用GO语言开发,跨平台,只有一个可执行文件,就可以运行。
+ - 跨语言:ZTF支持常见的编程语言,你喜欢用什么就用什么。
+ - 跨框架:ZTF可以和市面上常见的单元测试框架、常见的自动化测试框架都可以很好的集成。
+ - 工程化:使用ZTF可以真正达到工程化的自动化测试,可以大批量大规模的进行自动化测试的管理和执行。
+ - 跨场景:借助于其他框架,ZTF可以用来做单元测试、接口测试、web界面测试、GUI界面测试、APP测试等多种场景。
+
+
+
+
+ 禅道ZTF官网
+ ZTF框架下载
+ ZTF框架手册
+
+
+
+ 我们还提供了QQ群和微信群的交流方式,官方QQ技术支持响应时间为:上午9:00—11:30,下午13:00—17:30(周六周日,节假日休息)
+
+
+ 软件测试交流群: 522506766 (添加客服微信: easycorp666,可邀请您加入软件测试微信群)
+
+
+
+
+
+
+EOF;
+
+$lang->automation->zendataDetails = <<
+
+
+
+ 一、ZenData的实现原理
+
+ ZenData使用YAML来作为数据类型配置文件。对于每一种类型的数据来讲,我们都可以将其拆分成若干的字段。
+ 比如我们要测试一个用户的订单表,会有订单的id,用户id或者账户名,订单的名称,订单的金额,订单的时间,订单状态等等字段。
+ 我们可以针对每一个字段配置其取值的范围。比如订单id,我可以定义为从1到10000,用户id可以是1-100。
+ 这样每一个字段都有了一个取值范围列表。当ZenData来生成数据的时候,从每一个字段里面依次取一个值,将其拼接在一起,就形成了一条记录。
+ 大家可以想象成每个字段都是一个转盘,按照自己的频率进行旋转,每一次旋转都从中取出一个值,和其他的字段进行组合。
+
+ 上面说的是最基本的的工作原理,ZenData还提供了步长、随机、循环、引用等多种定义方式,我们会在接下来的手册里面展开讲。
+ 二、ZenData的用途
+
+ ZenData主要两大功能:数据生成和数据解析。通过一个配置文件,可以使用ZenData生成您想要的各种数据。
+ 同样也可以对某一个数据文件,指定其数据类型定义的配置文件,完成到结构化数据的解析。
+ ZenData可以用于手工测试场景下面测试数据的准备,也可以用于自动化测试脚本里面的数据生成和解析。还可以一键生成海量数据用于性能和压力测试。
+
+ 三、ZenData主要的特点
+
+ - 简单无依赖,只有一个可执行文件,即可满足命令行生成和HTTP接口两种数据生成服务。
+ - 使用配置文件来生成数据,使用人员不需要有开发知识,即可上手应用。
+ - 提供了功能强大的语法,分组、区间、步长、循环、随机、格式化和前后缀等,配置灵活性极强。
+ - 支持从文本文件中读取数据,方便用户对字段取值进行精确控制。
+ - 提供了Excel表格数据的标准SQL查询接口,使用更加灵活。
+ - 使用预制的序列(ranges)、实例(instances)、配置(config)对定义进行复用,以解决复杂数据格式的定义。
+ - 语法支持继承和扩展,为定义文件间的复用提供方便。
+ - 可以反向解析数据,可以对程序的输出进行解析,方便自动化测试脚本进行比对。
+ - 发行包內置了基础业务数据的定义文件(不断完善中)。
+ - 提供了HTTP接口数据生成服务,各种语言都可以方便调用。
+
+
+
+
+ ZenData官网
+ ZenData下载
+ ZenData手册
+
+
+
+ 我们还提供了QQ群和微信群的交流方式,官方QQ技术支持响应时间为:上午9:00—11:30,下午13:00—17:30(周六周日,节假日休息)
+
+
+ 软件测试交流群: 522506766 (添加客服微信: easycorp666,可邀请您加入软件测试微信群)
+
+
+
+
+
+
+
+EOF;
diff --git a/module/automation/lang/zh-tw.php b/module/automation/lang/zh-tw.php
deleted file mode 100644
index b95dc6a627..0000000000
--- a/module/automation/lang/zh-tw.php
+++ /dev/null
@@ -1,83 +0,0 @@
-
- * @package admin
- * @version $Id: zh-tw.php 4767 2013-05-05 06:10:13Z wwccss $
- * @link http://www.zentao.net
- */
-$lang->admin->common = '後台管理';
-$lang->admin->index = '後台管理首頁';
-$lang->admin->checkDB = '檢查資料庫';
-$lang->admin->sso = 'ZDOO整合';
-$lang->admin->ssoAction = 'ZDOO整合';
-$lang->admin->safeIndex = '安全';
-$lang->admin->checkWeak = '弱口令檢查';
-$lang->admin->certifyMobile = '認證手機';
-$lang->admin->certifyEmail = '認證郵箱';
-$lang->admin->ztCompany = '認證公司';
-$lang->admin->captcha = '驗證碼';
-$lang->admin->getCaptcha = '獲取驗證碼';
-$lang->admin->register = '登記';
-
-$lang->admin->api = '介面';
-$lang->admin->log = '日誌';
-$lang->admin->setting = '設置';
-$lang->admin->days = '日誌保存天數';
-
-$lang->admin->info = new stdclass();
-$lang->admin->info->version = '當前系統的版本是%s,';
-$lang->admin->info->links = '您可以訪問以下連結:';
-$lang->admin->info->account = "您的禪道社區賬戶為%s。";
-$lang->admin->info->log = '超出存天數的日誌會被刪除,需要開啟計劃任務。';
-
-$lang->admin->notice = new stdclass();
-$lang->admin->notice->register = "友情提示:您還未在禪道社區(www.zentao.net)登記,%s進行登記,以及時獲得禪道最新信息。";
-$lang->admin->notice->ignore = "不再提示";
-$lang->admin->notice->int = "『%s』應當是正整數。";
-
-$lang->admin->registerNotice = new stdclass();
-$lang->admin->registerNotice->common = '註冊新帳號綁定';
-$lang->admin->registerNotice->caption = '禪道社區登記';
-$lang->admin->registerNotice->click = '點擊此處';
-$lang->admin->registerNotice->lblAccount = '請設置您的用戶名,英文字母和數字的組合,三位以上。';
-$lang->admin->registerNotice->lblPasswd = '請設置您的密碼。數字和字母的組合,六位以上。';
-$lang->admin->registerNotice->submit = '登記';
-$lang->admin->registerNotice->bind = "綁定已有帳號";
-$lang->admin->registerNotice->success = "登記賬戶成功";
-
-$lang->admin->bind = new stdclass();
-$lang->admin->bind->caption = '關聯社區帳號';
-$lang->admin->bind->success = "關聯賬戶成功";
-
-$lang->admin->safe = new stdclass();
-$lang->admin->safe->common = '安全策略';
-$lang->admin->safe->set = '密碼安全設置';
-$lang->admin->safe->password = '密碼安全';
-$lang->admin->safe->weak = '常用弱口令';
-$lang->admin->safe->reason = '類型';
-$lang->admin->safe->checkWeak = '弱口令掃瞄';
-$lang->admin->safe->changeWeak = '修改弱口令密碼';
-$lang->admin->safe->modifyPasswordFirstLogin = '首次登錄修改密碼';
-
-$lang->admin->safe->modeList[0] = '不檢查';
-$lang->admin->safe->modeList[1] = '中';
-$lang->admin->safe->modeList[2] = '強';
-
-$lang->admin->safe->modeRuleList[1] = '6位以上,包含大小寫字母,數字。';
-$lang->admin->safe->modeRuleList[2] = '10位以上,包含字母,數字,特殊字元。';
-
-$lang->admin->safe->reasonList['weak'] = '常用弱口令';
-$lang->admin->safe->reasonList['account'] = '與帳號相同';
-$lang->admin->safe->reasonList['mobile'] = '與手機相同';
-$lang->admin->safe->reasonList['phone'] = '與電話相同';
-$lang->admin->safe->reasonList['birthday'] = '與生日相同';
-
-$lang->admin->safe->modifyPasswordList[1] = '必須修改';
-$lang->admin->safe->modifyPasswordList[0] = '不強制';
-
-$lang->admin->safe->noticeMode = '系統會在登錄、創建和修改用戶、修改密碼的時候檢查用戶口令。';
-$lang->admin->safe->noticeStrong = '密碼長度越長,含有大寫字母或數字或特殊符號越多,密碼字母越不重複,安全度越強!';
diff --git a/module/automation/view/browse.html.php b/module/automation/view/browse.html.php
index 7d76dcb414..18e71b1472 100644
--- a/module/automation/view/browse.html.php
+++ b/module/automation/view/browse.html.php
@@ -13,23 +13,23 @@
-
+
-
-
+
+
-
我是标签1。
+ automation->details;?>
-
标签2的内容。
+ automation->ztfDetails;?>
-
这是标签3的内容。
+ automation->zendataDetails;?>
From b8885bc1eaeff95d8bb3d7abc219395e5846c969 Mon Sep 17 00:00:00 2001
From: qiyu-xie
Date: Thu, 11 Mar 2021 20:18:10 +0800
Subject: [PATCH 11/14] * Finish task#36500.
---
module/common/lang/zh-cn.php | 12 ++++++------
module/common/model.php | 3 ++-
module/execution/control.php | 12 ++++++++++++
3 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php
index b3692e0db3..9649086a87 100644
--- a/module/common/lang/zh-cn.php
+++ b/module/common/lang/zh-cn.php
@@ -355,12 +355,12 @@ $lang->execution->groupMenu = new stdclass();
$lang->execution->groupMenu->groupTask = '分组视图|execution|grouptask|executionID={EXECUTION}';
$lang->execution->groupMenu->tree = '树状图|execution|tree|executionID={EXECUTION}';
-$lang->execution->subMenu = new stdclass();
-$lang->execution->subMenu->setting = new stdclass();
-$lang->execution->subMenu->setting->vie = array('link' => '概况|execution|view|executionID=%s', 'subModule' => 'view', 'alias' => 'edit,start,suspend,putoff,close');
-$lang->execution->subMenu->setting->product = $lang->productCommon . '|execution|manageproducts|executionID=%s';
-$lang->execution->subMenu->setting->team = array('link' => '团队|execution|team|executionID=%s', 'alias' => 'managemembers');
-$lang->execution->subMenu->setting->whitelist = array('link' => '白名单|execution|whitelist|executionID=%s', 'subModule' => 'personnel', 'alias' => 'addwhitelist');
+$lang->execution->settingMenu = new stdclass();
+$lang->execution->settingMenu = new stdclass();
+$lang->execution->settingMenu->view = array('link' => '概况|execution|view|executionID={EXECUTION}', 'subModule' => 'view', 'alias' => 'edit,start,suspend,putoff,close');
+$lang->execution->settingMenu->products = $lang->productCommon . '|execution|manageproducts|executionID={EXECUTION}';
+$lang->execution->settingMenu->team = array('link' => '团队|execution|team|executionID={EXECUTION}', 'alias' => 'managemembers');
+$lang->execution->settingMenu->whitelist = array('link' => '白名单|execution|whitelist|executionID={EXECUTION}', 'subModule' => 'personnel', 'alias' => 'addwhitelist');
$lang->execution->dividerMenu = ',story,build,setting,';
diff --git a/module/common/model.php b/module/common/model.php
index 44207d1707..3a990bf37c 100644
--- a/module/common/model.php
+++ b/module/common/model.php
@@ -782,7 +782,8 @@ class commonModel extends model
}
if($group == 'execution')
{
- if($methodName == 'grouptask' or $methodName == 'tree') $lang->execution->menu = self::processMenuVars($lang->execution->groupMenu);
+ if(in_array($methodName, array('grouptask', 'tree'))) $lang->execution->menu = self::processMenuVars($lang->execution->groupMenu);
+ if(in_array($methodName, array('view', 'manageproducts', 'team', 'whitelist'))) $lang->execution->menu = self::processMenuVars($lang->execution->settingMenu);
}
if(strpos('qa|bug|testcase|testreport|testtask', $moduleName) !== false and $group == 'project')
{
diff --git a/module/execution/control.php b/module/execution/control.php
index 22fa42e32a..6dd8a9770e 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -1089,6 +1089,9 @@ class execution extends control
*/
public function team($executionID = 0)
{
+ $moduleIndex = array_search('execution', $this->lang->noMenuModule);
+ if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]);
+
$execution = $this->commonAction($executionID);
$executionID = $execution->id;
@@ -1648,6 +1651,9 @@ class execution extends control
*/
public function view($executionID)
{
+ $moduleIndex = array_search('execution', $this->lang->noMenuModule);
+ if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]);
+
$execution = $this->execution->getById($executionID, true);
if(empty($execution) || strpos('stage,sprint', $execution->type) === false) die(js::error($this->lang->notFound) . js::locate('back'));
@@ -1993,6 +1999,9 @@ class execution extends control
*/
public function manageProducts($executionID, $from = '')
{
+ $moduleIndex = array_search('execution', $this->lang->noMenuModule);
+ if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]);
+
/* use first execution if executionID does not exist. */
if(!isset($this->executions[$executionID])) $executionID = key($this->executions);
@@ -2629,6 +2638,9 @@ class execution extends control
*/
public function whitelist($executionID = 0, $module='execution', $objectType = 'sprint', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
+ $moduleIndex = array_search('execution', $this->lang->noMenuModule);
+ if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]);
+
/* use first execution if executionID does not exist. */
if(!isset($this->executions[$executionID])) $executionID = key($this->executions);
From 8fb5c794818c45e2384cbd94737b8ed8cccd0f73 Mon Sep 17 00:00:00 2001
From: qiyu-xie
Date: Thu, 11 Mar 2021 20:38:45 +0800
Subject: [PATCH 12/14] * Finish task#36497.
---
module/execution/control.php | 3 ++-
module/execution/view/ajaxgetdropmenu.html.php | 7 ++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/module/execution/control.php b/module/execution/control.php
index 6dd8a9770e..0fc4ed0ff9 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -2500,7 +2500,8 @@ class execution extends control
$this->view->module = $module;
$this->view->method = $method;
$this->view->extra = $extra;
- $this->view->executions = $this->execution->getByProject($execution->project);
+ $this->view->projects = $this->project->getPairsByModel();
+ $this->view->executions = $this->execution->getList();
$this->display();
}
diff --git a/module/execution/view/ajaxgetdropmenu.html.php b/module/execution/view/ajaxgetdropmenu.html.php
index fe4e0a05fe..2debb51b63 100644
--- a/module/execution/view/ajaxgetdropmenu.html.php
+++ b/module/execution/view/ajaxgetdropmenu.html.php
@@ -21,15 +21,16 @@ $executionsPinYin = common::convert2Pinyin($executionNames);
foreach($executions as $execution)
{
+ $executionName = zget($projects, $execution->project) . '/' . $execution->name;
if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM == $this->app->user->account)
{
- $myProjectsHtml .= html::a(sprintf($link, $execution->id), " " . $execution->name, '', "class='text-important' title='{$execution->name}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
+ $myProjectsHtml .= html::a(sprintf($link, $execution->id), " " . $executionName, '', "class='text-important' title='{$executionName}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
}
else if($execution->status != 'done' and $execution->status != 'closed' and !($execution->PM == $this->app->user->account))
{
- $normalProjectsHtml .= html::a(sprintf($link, $execution->id), " " . $execution->name, '', "title='{$execution->name}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
+ $normalProjectsHtml .= html::a(sprintf($link, $execution->id), " " . $executionName, '', "title='{$executionName}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
}
- else if($execution->status == 'done' or $execution->status == 'closed') $closedProjectsHtml .= html::a(sprintf($link, $execution->id), " " . $execution->name, '', "title='{$execution->name}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
+ else if($execution->status == 'done' or $execution->status == 'closed') $closedProjectsHtml .= html::a(sprintf($link, $execution->id), " " . $executionName, '', "title='{$executionName}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
}
?>
From 3610051e71df7381d5e67ff6daa6a5e7f06ef8e9 Mon Sep 17 00:00:00 2001
From: qiyu-xie
Date: Thu, 11 Mar 2021 20:44:47 +0800
Subject: [PATCH 13/14] * Delete the drop-down menu that execution's
three-level navigation.
---
module/execution/model.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/module/execution/model.php b/module/execution/model.php
index 3f1b45ad2d..73826c8092 100644
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -115,8 +115,8 @@ class executionModel extends model
if($methodName == 'all') $label = $this->lang->execution->allExecutions;
if($methodName == 'create' and $moduleName == 'execution') $label = $this->lang->execution->create;
- $executionIndex = $this->select($executions, $executionID, null, $moduleName, $methodName, $extra);
- if($this->config->systemMode == 'new') $this->lang->modulePageNav = $executionIndex;
+ //$executionIndex = $this->select($executions, $executionID, null, $moduleName, $methodName, $extra);
+ //if($this->config->systemMode == 'new') $this->lang->modulePageNav = $executionIndex;
foreach($this->lang->execution->menu as $key => $menu)
{
From 70047ed2af916a99284210b0506d34a74d8e83f5 Mon Sep 17 00:00:00 2001
From: qiyu-xie
Date: Fri, 12 Mar 2021 08:11:48 +0800
Subject: [PATCH 14/14] * Fix bug.
---
module/common/view/header.html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/module/common/view/header.html.php b/module/common/view/header.html.php
index f63940aeeb..8d950a20ff 100755
--- a/module/common/view/header.html.php
+++ b/module/common/view/header.html.php
@@ -25,7 +25,7 @@ $isQa = $rawModule == 'qa';
config->systemMode == 'new'):?>
program->switcherMenu) ? $lang->program->switcherMenu : '';?>
loadModel('project')->getSwitcher($this->session->PRJ, $app->rawModule, $app->rawMethod);?>
- execution->getSwitcher($this->session->execution, $app->rawModule, $app->rawMethod);?>
+ loadModel('execution')->getSwitcher($this->session->execution, $app->rawModule, $app->rawMethod);?>
config->systemMode == 'classic'):?>
project->switcherMenu) ? $lang->project->switcherMenu : '';;?>