mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-28 19:47:14 +08:00
feat: 支持shoots协议, app_process获取前台应用, 修复部分bug
This commit is contained in:
@@ -2,19 +2,19 @@ package uixt
|
||||
|
||||
import "testing"
|
||||
|
||||
var driver *ShootsAndroidDriver
|
||||
var shootsDriver *ShootsAndroidDriver
|
||||
|
||||
func setupAndroid(t *testing.T) {
|
||||
func setupShootsDriver(t *testing.T) {
|
||||
device, err := NewAndroidDevice()
|
||||
checkErr(t, err)
|
||||
device.SHOOTS = true
|
||||
driver, err = device.NewShootsDriver(Capabilities{})
|
||||
shootsDriver, err = device.NewShootsDriver(Capabilities{})
|
||||
checkErr(t, err)
|
||||
}
|
||||
|
||||
func TestHello(t *testing.T) {
|
||||
setupAndroid(t)
|
||||
status, err := driver.Status()
|
||||
setupShootsDriver(t)
|
||||
status, err := shootsDriver.Status()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -22,19 +22,35 @@ func TestHello(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSource(t *testing.T) {
|
||||
setupAndroid(t)
|
||||
source, err := driver.Source()
|
||||
setupShootsDriver(t)
|
||||
source, err := shootsDriver.Source()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(source)
|
||||
}
|
||||
|
||||
func TestLogin(t *testing.T) {
|
||||
setupAndroid(t)
|
||||
res, err := driver.isLogin("com.ss.android.ugc.aweme")
|
||||
func TestIsLogin(t *testing.T) {
|
||||
setupShootsDriver(t)
|
||||
res, err := shootsDriver.isLogin("com.ss.android.ugc.aweme")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(res)
|
||||
}
|
||||
|
||||
func TestLogin(t *testing.T) {
|
||||
setupShootsDriver(t)
|
||||
err := shootsDriver.LoginNoneUI("com.ss.android.ugc.aweme", "12342316231", "8517")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLogout(t *testing.T) {
|
||||
setupShootsDriver(t)
|
||||
err := shootsDriver.LogoutNoneUI("com.ss.android.ugc.aweme")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user