mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-22 08:43:17 +08:00
fix: remove android mjpeg option
This commit is contained in:
@@ -6,16 +6,16 @@ import (
|
|||||||
"github.com/httprunner/httprunner/v4/hrp"
|
"github.com/httprunner/httprunner/v4/hrp"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestIOSDouYinLive(t *testing.T) {
|
func TestAndroidDouYinLive(t *testing.T) {
|
||||||
testCase := &hrp.TestCase{
|
testCase := &hrp.TestCase{
|
||||||
Config: hrp.NewConfig("通过 feed 头像进入抖音直播间").
|
Config: hrp.NewConfig("通过 feed 头像进入抖音直播间").
|
||||||
SetAndroid(hrp.WithAdbLogOn(true), hrp.WithMjpegPortA(9100)),
|
SetAndroid(hrp.WithAdbLogOn(true)),
|
||||||
TestSteps: []hrp.IStep{
|
TestSteps: []hrp.IStep{
|
||||||
hrp.NewStep("打开网页").
|
hrp.NewStep("打开网页").
|
||||||
Android().
|
Android().
|
||||||
Home().
|
Home().
|
||||||
AppTerminate("com.google.android.apps.chrome.Main").Sleep(1). // 关闭已运行的抖音,确保启动抖音后在「抖音」首页
|
AppTerminate("com.google.android.apps.chrome.Main").Sleep(1). // 关闭已运行的抖音,确保启动抖音后在「抖音」首页
|
||||||
SwipeToTapApp("Chrome", hrp.WithMaxRetryTimes(5)).TapByOCR("Search").Input("https://gtftask.bytedance.com/local-time").TapByOCR("前往").Sleep(5).
|
SwipeToTapApp("Chrome", hrp.WithMaxRetryTimes(5)).TapByOCR("搜索").Input("https://gtftask.bytedance.com/local-time").TapByOCR("前往").Sleep(5).
|
||||||
Validate().
|
Validate().
|
||||||
AssertOCRExists("1664", "网页打开失败"),
|
AssertOCRExists("1664", "网页打开失败"),
|
||||||
hrp.NewStep("启动抖音").
|
hrp.NewStep("启动抖音").
|
||||||
|
|||||||
@@ -65,12 +65,6 @@ func WithSerialNumber(serial string) AndroidDeviceOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func WithMjpegPortA(port int) AndroidDeviceOption {
|
|
||||||
return func(device *AndroidDevice) {
|
|
||||||
device.MjpegPort = port
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func WithAdbIP(ip string) AndroidDeviceOption {
|
func WithAdbIP(ip string) AndroidDeviceOption {
|
||||||
return func(device *AndroidDevice) {
|
return func(device *AndroidDevice) {
|
||||||
device.IP = ip
|
device.IP = ip
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package uixt
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"image"
|
"image"
|
||||||
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
cvHelper "github.com/electricbubble/opencv-helper"
|
cvHelper "github.com/electricbubble/opencv-helper"
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ var (
|
|||||||
WithAdbIP = uixt.WithAdbIP
|
WithAdbIP = uixt.WithAdbIP
|
||||||
WithAdbPort = uixt.WithAdbPort
|
WithAdbPort = uixt.WithAdbPort
|
||||||
WithAdbLogOn = uixt.WithAdbLogOn
|
WithAdbLogOn = uixt.WithAdbLogOn
|
||||||
WithMjpegPortA = uixt.WithMjpegPortA
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type AndroidStep struct {
|
type AndroidStep struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user