提交 8c9377a0 编写于 作者: 雨爱无痕

Fix issue

上级 daafe763
......@@ -22,15 +22,16 @@ func KillProcessByUUID(uuid string) {
}
line = strings.TrimSpace(line)
cols := strings.Split(line, " ")
pid := ""
if len(cols) > 3 {
fmt.Println(fmt.Sprintf(`taskkill /F /pid %s`, cols[3]))
cmd2 := exec.Command("cmd")
cmd2.SysProcAttr = &syscall.SysProcAttr{CmdLine: fmt.Sprintf(`/c taskkill /F /pid %s`, cols[3]), HideWindow: true}
cmd2.Start()
} else if len(cols) == 2 {
fmt.Println(fmt.Sprintf(`taskkill /F /pid %s`, cols[2]))
pid = cols[3]
} else if len(cols) > 2 {
pid = cols[2]
}
if pid != "" {
fmt.Println(fmt.Sprintf(`taskkill /F /pid %s`, pid))
cmd2 := exec.Command("cmd")
cmd2.SysProcAttr = &syscall.SysProcAttr{CmdLine: fmt.Sprintf(`/c taskkill /F /pid %s`, cols[2]), HideWindow: true}
cmd2.SysProcAttr = &syscall.SysProcAttr{CmdLine: fmt.Sprintf(`/c taskkill /F /pid %s`, pid), HideWindow: true}
cmd2.Start()
}
}
......
......@@ -26,6 +26,7 @@ func RunReExecFailCase(t provider.T) {
t.Errorf("Exec failed case fail")
t.FailNow()
}
webpage.WaitForTimeout(2000)
resultTitle := webpage.InnerText("#rightPane .result-list-item .list-item-title")
if resultTitle != "1_string_match.php" {
t.Errorf("Find result in rightPane fail")
......@@ -60,16 +61,17 @@ func RunReExecAllCase(t provider.T) {
t.Errorf("Exec failed case fail")
t.FailNow()
}
webpage.WaitForTimeout(2000)
resultTitle := webpage.InnerText("#rightPane .result-list-item .list-item-title")
if resultTitle != "1_string_match.php" {
t.Errorf("Find result in rightPane fail")
t.Errorf("Find result title in rightPane fail")
t.FailNow()
}
timeElement := locator.Locator(".time>>span")
logTime := timeElement.InnerText()
resultTime := webpage.InnerText("#rightPane .result-list-item .list-item-trailing-text")
if logTime[:5] != resultTime {
t.Errorf("Find result in rightPane fail")
t.Errorf("Find result time in rightPane fail")
t.FailNow()
}
}
......
......@@ -45,10 +45,10 @@ func SyncFromZentao(t provider.T) {
webpage, _ := plwHelper.OpenUrl("http://127.0.0.1:8000/", t)
defer webpage.Close()
ztfTestHelper.SelectSite(webpage)
var waitTimeOut float64 = 5000
webpage.WaitForSelector(".tree-node", playwright.PageWaitForSelectorOptions{Timeout: &waitTimeOut})
plwConf.DisableErr()
locator := webpage.Locator(".tree-node", playwright.PageLocatorOptions{HasText: "单元测试工作目录"})
defer plwConf.EnableErr()
webpage.WaitForSelectorTimeout(".tree-node-root>>has-text('单元测试工作目录')", 2000)
locator := webpage.Locator(".tree-node-root>>has-text('单元测试工作目录')")
c := locator.Count()
if c == 0 {
plwConf.EnableErr()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册