mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
refactor: move shoots driver to driver_ext
This commit is contained in:
@@ -38,8 +38,7 @@ func handleDeviceContext() gin.HandlerFunc {
|
||||
switch strings.ToLower(platform) {
|
||||
case "android":
|
||||
device, err := uixt.NewAndroidDevice(
|
||||
option.WithSerialNumber(serial),
|
||||
option.WithStub(true))
|
||||
option.WithSerialNumber(serial))
|
||||
if err != nil {
|
||||
log.Error().Err(err).Str("platform", platform).Str("serial", serial).
|
||||
Msg("device not found")
|
||||
|
||||
@@ -32,11 +32,11 @@ func NewServer(port int) error {
|
||||
// get screen info
|
||||
apiV1PlatformSerial.GET("/screenshot", handleDeviceContext(), screenshotHandler)
|
||||
apiV1PlatformSerial.POST("/screenresult", handleDeviceContext(), screenResultHandler)
|
||||
apiV1PlatformSerial.GET("/stub/source", handleDeviceContext(), sourceHandler)
|
||||
apiV1PlatformSerial.GET("/shoots/source", handleDeviceContext(), sourceHandler)
|
||||
apiV1PlatformSerial.GET("/adb/source", handleDeviceContext(), adbSourceHandler)
|
||||
// Stub operations
|
||||
apiV1PlatformSerial.POST("/stub/login", handleDeviceContext(), loginHandler)
|
||||
apiV1PlatformSerial.POST("/stub/logout", handleDeviceContext(), logoutHandler)
|
||||
// shoots operations
|
||||
apiV1PlatformSerial.POST("/shoots/login", handleDeviceContext(), loginHandler)
|
||||
apiV1PlatformSerial.POST("/shoots/logout", handleDeviceContext(), logoutHandler)
|
||||
|
||||
// run uixt actions
|
||||
apiV1PlatformSerial.POST("/uixt/action", handleDeviceContext(), uixtActionHandler)
|
||||
|
||||
Reference in New Issue
Block a user