refactor: api

This commit is contained in:
lilong.129
2025-02-07 15:16:13 +08:00
parent 6cbab3c066
commit ae5a137353
23 changed files with 635 additions and 267 deletions

View File

@@ -6,11 +6,13 @@ import (
// current implemeted device: IOSDevice, AndroidDevice, HarmonyDevice
type IDevice interface {
Init() error // init android device
Setup() error
Teardown() error
UUID() string // ios udid or android serial
LogEnabled() bool
// TODO: add ctx to NewDriver
// TODO: remove
NewDriver(...option.DriverOption) (driverExt *DriverExt, err error)
Install(appPath string, opts ...option.InstallOption) error
@@ -18,10 +20,4 @@ type IDevice interface {
GetPackageInfo(packageName string) (AppInfo, error)
GetCurrentWindow() (windowInfo WindowInfo, err error)
// Teardown() error
}
func NewDriver(device IDevice, opts ...option.DriverOption) (driver IWebDriver, err error) {
return
}