From 02fc907796a638d4c8876bdbc1c2c64a1a6be673 Mon Sep 17 00:00:00 2001 From: zhaoke Date: Thu, 18 May 2023 18:05:13 +0800 Subject: [PATCH] Test in jenkiins --- Jenkinsfile | 1 - test/ui/helper/action.go | 1 - test/ui/helper/operation.go | 1 + test/ui/utils/print.go | 2 ++ 4 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 08d46f2c..7227cafe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -74,7 +74,6 @@ pipeline { container('node') { sh 'yarn config set registry https://registry.npm.taobao.org --global' sh 'cd ui && yarn && nohup yarn serve &' - sh 'while ! nc -z 127.0.0.1 8000; do sleep 1;done' } container('playwright') { diff --git a/test/ui/helper/action.go b/test/ui/helper/action.go index 800f0528..8cfc8988 100644 --- a/test/ui/helper/action.go +++ b/test/ui/helper/action.go @@ -14,7 +14,6 @@ import ( func OpenUrl(url string, t provider.T) (ret Webpage, err error) { pw, err := playwright.Run() - fmt.Println(url, err) utils.PrintErrOrNot(err, t) headless := conf.Headless diff --git a/test/ui/helper/operation.go b/test/ui/helper/operation.go index f47a16fe..1bec90d7 100644 --- a/test/ui/helper/operation.go +++ b/test/ui/helper/operation.go @@ -25,6 +25,7 @@ func (l MyLocator) Click() (err error) { } func (l MyLocator) ClickWithOption(option playwright.PageClickOptions) (err error) { + option.Timeout = &conf.Timeout err = l.PlwLocator.Click(option) t := l.T if err != nil { diff --git a/test/ui/utils/print.go b/test/ui/utils/print.go index 9ec4e5bd..fd8a3421 100644 --- a/test/ui/utils/print.go +++ b/test/ui/utils/print.go @@ -1,6 +1,7 @@ package utils import ( + "fmt" "log" "github.com/easysoft/zentaoatf/test/ui/conf" @@ -9,6 +10,7 @@ import ( func PrintErrOrNot(err error, t provider.T) { if err != nil && t != nil { + fmt.Println(err) if conf.ExitAllOnError { t.Error(err) t.FailNow() -- GitLab