mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-29 03:57:22 +08:00
feat: run Android UI automation with adb by default, add uixt.WithUIA2(true) option to use uiautomator2
This commit is contained in:
+14
-14
@@ -35,20 +35,6 @@ func (wd *wdaDriver) GetMjpegClient() *http.Client {
|
||||
return wd.mjpegClient
|
||||
}
|
||||
|
||||
func (wd *wdaDriver) Close() error {
|
||||
if wd.defaultConn != nil {
|
||||
wd.defaultConn.Close()
|
||||
}
|
||||
if wd.mjpegUSBConn != nil {
|
||||
wd.mjpegUSBConn.Close()
|
||||
}
|
||||
|
||||
if wd.mjpegClient != nil {
|
||||
wd.mjpegClient.CloseIdleConnections()
|
||||
}
|
||||
return wd.mjpegHTTPConn.Close()
|
||||
}
|
||||
|
||||
func (wd *wdaDriver) NewSession(capabilities Capabilities) (sessionInfo SessionInfo, err error) {
|
||||
// [[FBRoute POST:@"/session"].withoutSession respondWithTarget:self action:@selector(handleCreateSession:)]
|
||||
data := make(map[string]interface{})
|
||||
@@ -70,6 +56,20 @@ func (wd *wdaDriver) NewSession(capabilities Capabilities) (sessionInfo SessionI
|
||||
}
|
||||
|
||||
func (wd *wdaDriver) DeleteSession() (err error) {
|
||||
if wd.defaultConn != nil {
|
||||
wd.defaultConn.Close()
|
||||
}
|
||||
if wd.mjpegUSBConn != nil {
|
||||
wd.mjpegUSBConn.Close()
|
||||
}
|
||||
|
||||
if wd.mjpegClient != nil {
|
||||
wd.mjpegClient.CloseIdleConnections()
|
||||
}
|
||||
if wd.mjpegHTTPConn != nil {
|
||||
wd.mjpegHTTPConn.Close()
|
||||
}
|
||||
|
||||
// [[FBRoute DELETE:@""] respondWithTarget:self action:@selector(handleDeleteSession:)]
|
||||
_, err = wd.httpDELETE("/session", wd.sessionId)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user