mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-07 15:31:23 +08:00
refactor: NewXTDriver api, return error if init failed
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/httprunner/httprunner/v5/uixt"
|
||||
"github.com/httprunner/httprunner/v5/uixt/ai"
|
||||
"github.com/httprunner/httprunner/v5/uixt/option"
|
||||
)
|
||||
|
||||
@@ -39,8 +38,8 @@ var rootCmd = &cobra.Command{
|
||||
return errors.New("android or ios app bundldID is required")
|
||||
}
|
||||
|
||||
driverExt := uixt.NewXTDriver(driver,
|
||||
ai.WithCVService(ai.CVServiceTypeVEDEM),
|
||||
driverExt, _ := uixt.NewXTDriver(driver,
|
||||
option.WithCVService(option.CVServiceTypeVEDEM),
|
||||
)
|
||||
|
||||
wc := NewWorldCupLive(driverExt, matchName, bundleID, duration, interval)
|
||||
|
||||
@@ -48,7 +48,7 @@ func initIOSDriver(uuid string) *uixt.XTDriver {
|
||||
log.Fatal().Err(err).Msg("failed to init ios device")
|
||||
}
|
||||
driver, _ := device.NewDriver()
|
||||
driverExt := uixt.NewXTDriver(driver)
|
||||
driverExt, _ := uixt.NewXTDriver(driver)
|
||||
return driverExt
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ func initAndroidDriver(uuid string) *uixt.XTDriver {
|
||||
log.Fatal().Err(err).Msg("failed to init android device")
|
||||
}
|
||||
driver, _ := device.NewDriver()
|
||||
driverExt := uixt.NewXTDriver(driver)
|
||||
driverExt, _ := uixt.NewXTDriver(driver)
|
||||
return driverExt
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user