mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-31 05:19:38 +08:00
50 lines
933 B
Go
50 lines
933 B
Go
//go:build localtest
|
|
|
|
package uixt
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestAndroidSwipeAction(t *testing.T) {
|
|
setupAndroid(t)
|
|
|
|
action := MobileAction{
|
|
Method: ACTION_Swipe,
|
|
Params: "up",
|
|
}
|
|
swipeAction := driverExt.prepareSwipeAction(action)
|
|
|
|
err := swipeAction(driverExt)
|
|
checkErr(t, err)
|
|
|
|
action = MobileAction{
|
|
Method: ACTION_Swipe,
|
|
Params: []float64{0.5, 0.5, 0.5, 0.9},
|
|
}
|
|
swipeAction = driverExt.prepareSwipeAction(action)
|
|
|
|
err = swipeAction(driverExt)
|
|
checkErr(t, err)
|
|
}
|
|
|
|
func TestAndroidSwipeToTapApp(t *testing.T) {
|
|
setupAndroid(t)
|
|
|
|
err := driverExt.swipeToTapApp("抖音", MobileAction{})
|
|
checkErr(t, err)
|
|
}
|
|
|
|
func TestAndroidSwipeToTapTexts(t *testing.T) {
|
|
setupAndroid(t)
|
|
|
|
err := driverExt.Driver.AppLaunch("com.ss.android.ugc.aweme")
|
|
checkErr(t, err)
|
|
|
|
action := MobileAction{
|
|
Params: "up",
|
|
}
|
|
err = driverExt.swipeToTapTexts([]string{"点击进入直播间", "直播中"}, action)
|
|
checkErr(t, err)
|
|
}
|