From 59e82cef72b0218616a7616a47dd97a909390355 Mon Sep 17 00:00:00 2001 From: "xucong.053" Date: Mon, 19 Dec 2022 15:46:54 +0800 Subject: [PATCH] fix: unittest --- hrp/pkg/uixt/algorithm.go | 2 +- hrp/pkg/uixt/cp_vedem.go | 2 +- hrp/pkg/uixt/im_vedem.go | 2 +- hrp/step_mobile_ui.go | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hrp/pkg/uixt/algorithm.go b/hrp/pkg/uixt/algorithm.go index d3617877..d7721853 100644 --- a/hrp/pkg/uixt/algorithm.go +++ b/hrp/pkg/uixt/algorithm.go @@ -92,7 +92,7 @@ func (i *ImageTemplate) read() (imageBuffer *bytes.Buffer, err error) { // extendCV 获得扩展后的 Driver, // 并指定匹配阀值, // 获取当前设备的 Scale, -func extendCV(driver WebDriver, options ...CVOption) (dExt *DriverExt, err error) { +func (dExt *DriverExt) extendCV(options ...CVOption) (err error) { for _, option := range options { option(&dExt.CVArgs) } diff --git a/hrp/pkg/uixt/cp_vedem.go b/hrp/pkg/uixt/cp_vedem.go index 73438b55..59ad0030 100644 --- a/hrp/pkg/uixt/cp_vedem.go +++ b/hrp/pkg/uixt/cp_vedem.go @@ -131,7 +131,7 @@ func (s *veDEMCPService) getCPResult(sourceImage []byte) ([]CPResult, error) { } func (s *veDEMCPService) FindPopupCloseButton(byteSource []byte, options ...DataOption) (rect image.Rectangle, err error) { - data := NewData(map[string]interface{}{}, options...) + data := NewDataOptions(options...) cpResults, err := s.getCPResult(byteSource) if err != nil { diff --git a/hrp/pkg/uixt/im_vedem.go b/hrp/pkg/uixt/im_vedem.go index 99d187e8..24b19342 100644 --- a/hrp/pkg/uixt/im_vedem.go +++ b/hrp/pkg/uixt/im_vedem.go @@ -130,7 +130,7 @@ func (s *veDEMIMService) getIMResult(searchImage []byte, sourceImage []byte) ([] } func (s *veDEMIMService) FindImage(byteSearch []byte, byteSource []byte, options ...DataOption) (rect image.Rectangle, err error) { - data := NewData(map[string]interface{}{}, options...) + data := NewDataOptions(options...) cvResults, err := s.getIMResult(byteSearch, byteSource) if err != nil { diff --git a/hrp/step_mobile_ui.go b/hrp/step_mobile_ui.go index 971561e3..9a420a45 100644 --- a/hrp/step_mobile_ui.go +++ b/hrp/step_mobile_ui.go @@ -16,13 +16,11 @@ var ( WithUDID = uixt.WithUDID WithWDAPort = uixt.WithWDAPort WithWDAMjpegPort = uixt.WithWDAMjpegPort - WithLogOn = uixt.WithLogOn WithResetHomeOnStartup = uixt.WithResetHomeOnStartup WithSnapshotMaxDepth = uixt.WithSnapshotMaxDepth WithAcceptAlertButtonSelector = uixt.WithAcceptAlertButtonSelector WithDismissAlertButtonSelector = uixt.WithDismissAlertButtonSelector WithClosePopup = uixt.WithClosePopup - WithPerfOptions = uixt.WithPerfOptions ) // android setting options