mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-11 10:00:23 +08:00
refactor: NewXTDriver api, return error if init failed
This commit is contained in:
@@ -10,7 +10,6 @@ import (
|
||||
|
||||
"github.com/httprunner/httprunner/v5/code"
|
||||
"github.com/httprunner/httprunner/v5/uixt"
|
||||
"github.com/httprunner/httprunner/v5/uixt/ai"
|
||||
"github.com/httprunner/httprunner/v5/uixt/option"
|
||||
)
|
||||
|
||||
@@ -33,8 +32,12 @@ func (r *Router) GetDriver(c *gin.Context) (driverExt *uixt.XTDriver, err error)
|
||||
return
|
||||
}
|
||||
|
||||
driverExt = uixt.NewXTDriver(driver,
|
||||
ai.WithCVService(ai.CVServiceTypeVEDEM))
|
||||
driverExt, err = uixt.NewXTDriver(driver,
|
||||
option.WithCVService(option.CVServiceTypeVEDEM))
|
||||
if err != nil {
|
||||
RenderErrorInitDriver(c, err)
|
||||
return
|
||||
}
|
||||
c.Set("driver", driverExt)
|
||||
return driverExt, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user