refactor: NewADBDriver

This commit is contained in:
lilong.129
2025-02-06 21:39:17 +08:00
parent 94d3cb785c
commit f87d37d5c6
12 changed files with 164 additions and 167 deletions

View File

@@ -376,20 +376,20 @@ type DriverExt struct {
}
func newDriverExt(device IDevice, driver IWebDriver, opts ...option.DriverOption) (dExt *DriverExt, err error) {
driverOptions := option.NewDriverOptions(opts...)
options := option.NewDriverOptions(opts...)
dExt = &DriverExt{
Device: device,
Driver: driver,
plugin: driverOptions.Plugin,
plugin: options.Plugin,
}
if driverOptions.WithImageService {
if options.WithImageService {
if dExt.ImageService, err = newVEDEMImageService(); err != nil {
return nil, err
}
}
if driverOptions.WithResultFolder {
if options.WithResultFolder {
// create results directory
if err = builtin.EnsureFolderExists(config.ResultsPath); err != nil {
return nil, errors.Wrap(err, "create results directory failed")