mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-05 15:59:33 +08:00
feat: 支持tunnel, 优化server结构。
This commit is contained in:
@@ -50,9 +50,6 @@ func NewStubAndroidDriver(dev *uixt.AndroidDevice) (*StubAndroidDriver, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// register driver session reset handler
|
||||
driver.Session.RegisterResetHandler(driver.Setup)
|
||||
|
||||
return driver, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/httprunner/httprunner/v5/internal/builtin"
|
||||
"github.com/httprunner/httprunner/v5/pkg/uixt"
|
||||
"github.com/httprunner/httprunner/v5/pkg/uixt/ai"
|
||||
"github.com/httprunner/httprunner/v5/pkg/uixt/option"
|
||||
@@ -34,7 +33,7 @@ type XTDriver struct {
|
||||
}
|
||||
|
||||
func (dExt *XTDriver) InstallByUrl(url string, opts ...option.InstallOption) error {
|
||||
appPath, err := builtin.DownloadFileByUrl(url)
|
||||
appPath, err := uixt.DownloadFileByUrl(url)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/httprunner/httprunner/v5/pkg/uixt/types"
|
||||
"net/url"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/httprunner/httprunner/v5/code"
|
||||
@@ -44,9 +45,6 @@ func NewStubIOSDriver(dev *uixt.IOSDevice) (*StubIOSDriver, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// register driver session reset handler
|
||||
driver.Session.RegisterResetHandler(driver.Setup)
|
||||
|
||||
return driver, nil
|
||||
}
|
||||
|
||||
@@ -565,9 +563,12 @@ func (s *StubIOSDriver) PressButton(devBtn types.DeviceButton) error {
|
||||
}
|
||||
|
||||
func (s *StubIOSDriver) ScreenShot(opts ...option.ActionOption) (*bytes.Buffer, error) {
|
||||
if os.Getenv("WINGS_LOCAL") == "true" {
|
||||
return s.Device.ScreenShot()
|
||||
}
|
||||
err := s.setUpWda()
|
||||
if err != nil {
|
||||
return s.Device.ScreenShot()
|
||||
return nil, err
|
||||
}
|
||||
return s.wdaDriver.ScreenShot()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user