From b64a8ea5189be9676849db748b468b12badab105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E6=B3=93=E9=93=AE?= Date: Mon, 24 Feb 2025 12:09:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=89=E8=A3=85=E6=88=AA=E5=9B=BE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=BC=82=E6=AD=A5=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E6=88=AA=E5=9B=BE=E6=97=B6=E9=97=B4=E8=BF=87=E9=95=BF=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=9D=A5=E4=B8=8D=E5=8F=8A=E7=82=B9=E5=87=BB=E5=B0=8F?= =?UTF-8?q?=E7=B1=B3=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/uixt/driver_ext/ext.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/uixt/driver_ext/ext.go b/pkg/uixt/driver_ext/ext.go index f37541ba..f1b31d26 100644 --- a/pkg/uixt/driver_ext/ext.go +++ b/pkg/uixt/driver_ext/ext.go @@ -1,7 +1,7 @@ package driver_ext import ( - "fmt" + "github.com/rs/zerolog/log" "time" "github.com/httprunner/httprunner/v5/pkg/uixt" @@ -48,15 +48,17 @@ func (dExt *XTDriver) Install(filePath string, opts ...option.InstallOption) err if _, ok := dExt.GetDevice().(*uixt.AndroidDevice); ok { stopChan := make(chan struct{}) go func() { - ticker := time.NewTicker(5 * time.Second) + ticker := time.NewTicker(3 * time.Second) defer ticker.Stop() for { select { case <-ticker.C: - _ = dExt.TapByOCR("^(.*无视风险安装|正在扫描.*|我知道了|稍后继续|稍后提醒|继续安装|知道了|确定|继续|完成|点击继续安装|继续安装旧版本|替换|.*正在安装|安装|授权本次安装|重新安装|仍要安装|更多详情|我知道了|已了解此应用未经检测.)$", option.WithRegex(true), option.WithIgnoreNotFoundError(true)) + go func() { + _ = dExt.TapByOCR("^(.*无视风险安装|正在扫描.*|我知道了|稍后继续|稍后提醒|继续安装|知道了|确定|继续|完成|点击继续安装|继续安装旧版本|替换|.*正在安装|安装|授权本次安装|重新安装|仍要安装|更多详情|我知道了|已了解此应用未经检测.)$", option.WithRegex(true), option.WithIgnoreNotFoundError(true)) + }() case <-stopChan: - fmt.Println("Ticker stopped") + log.Info().Msg("install complete") return } }