feat: 支持tunnel, 优化server结构。

This commit is contained in:
余泓铮
2025-02-19 20:26:20 +08:00
parent 1c6d12f7bd
commit ef320a3947
21 changed files with 233 additions and 170 deletions

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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()
}