fix: WDADriver

This commit is contained in:
lilong.129
2025-02-10 22:32:58 +08:00
parent 3d67bfba62
commit 7b16ad62ee
9 changed files with 90 additions and 136 deletions

View File

@@ -12,7 +12,7 @@ import (
)
var (
shootsIOSDriver uixt.IDriverExt
shootsIOSDriver uixt.IDriver
iOSDevice *uixt.IOSDevice
)
@@ -22,7 +22,7 @@ func setupShootsIOSDriver(t *testing.T) {
option.WithWDAPort(8700),
option.WithWDAMjpegPort(8800))
checkErr(t, err)
shootsIOSDriver, err = iOSDevice.NewDriver()
shootsIOSDriver, err = NewShootsIOSDriver(iOSDevice)
checkErr(t, err)
}
@@ -47,31 +47,31 @@ func TestIOSIsLogin(t *testing.T) {
func TestIOSSource(t *testing.T) {
setupShootsIOSDriver(t)
source, err := shootsIOSDriver.GetDriver().Source()
source, err := shootsIOSDriver.Source()
checkErr(t, err)
t.Log(source)
}
func TestIOSForeground(t *testing.T) {
setupShootsIOSDriver(t)
app, err := shootsIOSDriver.GetDriver().GetForegroundApp()
app, err := shootsIOSDriver.GetForegroundApp()
checkErr(t, err)
t.Log(app)
}
func TestIOSSwipe(t *testing.T) {
setupShootsIOSDriver(t)
shootsIOSDriver.GetDriver().Swipe(540, 0, 540, 1000)
shootsIOSDriver.Swipe(540, 0, 540, 1000)
}
func TestIOSSave(t *testing.T) {
setupShootsIOSDriver(t)
raw, err := shootsIOSDriver.GetDriver().Screenshot()
raw, err := shootsIOSDriver.Screenshot()
if err != nil {
t.Fatal(err)
}
source, err := shootsIOSDriver.GetDriver().Source()
source, err := shootsIOSDriver.Source()
if err != nil {
t.Fatal(err)
}