提交 a0654a8c 编写于 作者: Z zhaoke

Merge branch 'morden-ui' of github.com:easysoft/zentaoatf into morden-ui

......@@ -30,3 +30,4 @@ logs/
#vim
.vim/
.*.swp
/.scannerwork/
......@@ -67,6 +67,8 @@ func main() {
flagSet.StringVar(&keywords, "k", "", "")
flagSet.StringVar(&keywords, "keywords", "", "")
flagSet.BoolVar(&commConsts.AutoCommitResult, "cr", false, "")
flagSet.BoolVar(&commConsts.AutoCommitBug, "cb", false, "")
flagSet.BoolVar(&noNeedConfirm, "y", false, "")
flagSet.BoolVar(&commConsts.Verbose, "verbose", false, "")
......@@ -113,7 +115,7 @@ func main() {
case "cb":
files := fileUtils.GetFilesFromParams(os.Args[2:])
if err := flagSet.Parse(os.Args[len(files)+2:]); err == nil {
action.CommitBug(files, stringUtils.ParseInt(productId))
action.CommitBug(files, stringUtils.ParseInt(productId), noNeedConfirm)
}
case "list", "ls", "-l":
......@@ -161,6 +163,15 @@ func run(args []string) {
runUnitTest(args)
} else { // ztf test
runFuncTest(args)
if commConsts.AutoCommitResult && productId != "" {
action.CommitZTFTestResult([]string{commConsts.ExecLogDir},
stringUtils.ParseInt(productId), stringUtils.ParseInt(productId), true)
}
if commConsts.AutoCommitBug && productId != "" {
action.CommitBug([]string{commConsts.ExecLogDir}, stringUtils.ParseInt(productId), true)
}
}
}
......
......@@ -3,10 +3,10 @@
/**
title=with multi groups
cid=0
cid=2
pid=0
step 1 >> expect 1
step 1 >> expect 11
step 2 >> expect 2
step 3 >>
......
......@@ -22,7 +22,7 @@ var (
bugFields commDomain.ZentaoBugFields
)
func CommitBug(files []string, productId int) {
func CommitBug(files []string, productId int, noNeedConfirm bool) {
var resultDir string
if len(files) > 0 {
resultDir = files[0]
......@@ -56,9 +56,18 @@ func CommitBug(files []string, productId int) {
return
}
if noNeedConfirm {
for _, caseId := range ids {
reportBug(resultDir, caseId, productId)
}
return
}
// wait to input
for {
logUtils.ExecConsole(color.FgCyan, "\n"+i118Utils.Sprintf("enter_case_id_for_report_bug"))
logUtils.ExecConsole(color.FgCyan, strings.Join(lines, "\n"))
logUtils.ExecConsole(-1, strings.Join(lines, "\n"))
var caseId string
fmt.Scanln(&caseId)
if caseId == "exit" {
......
......@@ -16,7 +16,6 @@ import (
resUtils "github.com/easysoft/zentaoatf/pkg/lib/res"
"github.com/fatih/color"
"github.com/spf13/viper"
"log"
"os"
"path/filepath"
"reflect"
......@@ -26,10 +25,7 @@ func InitConfig() {
commConsts.IsRelease = commonUtils.IsRelease()
commConsts.WorkDir = fileUtils.GetWorkDir()
log.Println("===" + commConsts.WorkDir)
commConsts.ZtfDir = fileUtils.GetZTFDir()
log.Println("===" + commConsts.ZtfDir)
log.Println(commonUtils.IsRelease())
commConsts.ConfigPath = filepath.Join(commConsts.WorkDir, commConsts.ConfigDir, commConsts.ConfigFile)
if commConsts.IsRelease {
......
......@@ -9,12 +9,14 @@ var (
LanguageEn = "en"
Language = LanguageZh
Verbose = false
IsRelease bool
ZtfDir string
WorkDir string
ExecLogDir string
LogDir string
AutoCommitResult bool
AutoCommitBug bool
Verbose = false
IsRelease bool
ZtfDir string
WorkDir string
ExecLogDir string
LogDir string
RequestType string
ExecFrom ExecFromDef
......
......@@ -11,6 +11,8 @@ $>ztf.exe run product01 product01\all.cs 执行all.cs测试套件的
$>ztf.exe run log\001\result.txt 执行result.txt结果文件中的失败用例。
$>ztf.exe run product01 -suite 1 执行禅道系统中编号为1的套件,脚本在product01目录,缩写-s。
$>ztf.exe run -task 1 执行禅道系统中编号为1的任务,脚本在当期目录, 缩写-t。
$>ztf.exe run demo\demo -p 1 -cr -cb 执行目录demo下的脚本,完成后提交结果到禅道,并将失败结果提交成用例。
cr提交结果,-cb提交缺陷,-p必填参数指定产品ID
$>ztf.exe run demo\autoit 执行ZTF自带AutoIT脚本。
$>ztf.exe run demo\selenium\chrome.php --interp runtime\php\php7\php.exe
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
title=check string matches pattern
cid=1
pid=1
1 登录RDsim
2 点击建模按钮 >> 设置
'''
from test2 import start_app
c = start_app()
print(c)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
def start_app():
return "设置"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Beibei
# @Time: 2022/6/23 17:14
'''
title=建模按钮功能
......@@ -13,4 +11,9 @@ pid=1
'''
import sys,io,platform
if(platform.system()=='Windows'):
import sys,io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')
print("设置")
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册