mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-07 16:40:50 +08:00
change: rename tests
This commit is contained in:
@@ -57,9 +57,7 @@ func TestEqualLength(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, data := range testData {
|
for _, data := range testData {
|
||||||
if !assert.True(t, EqualLength(t, data.raw, data.expected)) {
|
assert.True(t, EqualLength(t, data.raw, data.expected))
|
||||||
t.Fatal()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
v5.0.0+2502172228
|
v5.0.0+2502181129
|
||||||
|
|||||||
@@ -44,16 +44,12 @@ func TestLoadHARWithProfileOverride(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < 3; i++ {
|
for i := 0; i < 3; i++ {
|
||||||
if !assert.Equal(t,
|
assert.Equal(t,
|
||||||
map[string]string{"Content-Type": "application/x-www-form-urlencoded"},
|
map[string]string{"Content-Type": "application/x-www-form-urlencoded"},
|
||||||
converter.tCase.Steps[i].Request.Headers) {
|
converter.tCase.Steps[i].Request.Headers)
|
||||||
t.FailNow()
|
assert.Equal(t,
|
||||||
}
|
|
||||||
if !assert.Equal(t,
|
|
||||||
map[string]string{"UserName": "debugtalk"},
|
map[string]string{"UserName": "debugtalk"},
|
||||||
converter.tCase.Steps[i].Request.Cookies) {
|
converter.tCase.Steps[i].Request.Cookies)
|
||||||
t.FailNow()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,13 +22,9 @@ func TestDriverSession(t *testing.T) {
|
|||||||
t.Log(resp)
|
t.Log(resp)
|
||||||
|
|
||||||
driverRequests := session.History()
|
driverRequests := session.History()
|
||||||
if !assert.Equal(t, 2, len(driverRequests)) {
|
assert.Equal(t, 2, len(driverRequests))
|
||||||
t.FailNow()
|
|
||||||
}
|
|
||||||
|
|
||||||
session.Reset()
|
session.Reset()
|
||||||
driverRequests = session.History()
|
driverRequests = session.History()
|
||||||
if !assert.Equal(t, 0, len(driverRequests)) {
|
assert.Equal(t, 0, len(driverRequests))
|
||||||
t.FailNow()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-18
@@ -63,12 +63,10 @@ func TestDriverExt(t *testing.T) {
|
|||||||
androidDevice.InstallAPK("/path/to/app.apk")
|
androidDevice.InstallAPK("/path/to/app.apk")
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupDriverExt(t *testing.T, driverType ...string) *XTDriver {
|
var driverType = "ADB"
|
||||||
var dType string
|
|
||||||
if len(driverType) > 0 {
|
func setupDriverExt(t *testing.T) *XTDriver {
|
||||||
dType = driverType[0]
|
switch driverType {
|
||||||
}
|
|
||||||
switch dType {
|
|
||||||
case "ADB":
|
case "ADB":
|
||||||
return setupADBDriverExt(t)
|
return setupADBDriverExt(t)
|
||||||
case "UIA2":
|
case "UIA2":
|
||||||
@@ -82,18 +80,6 @@ func setupDriverExt(t *testing.T, driverType ...string) *XTDriver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDriverExt_TapXY(t *testing.T) {
|
|
||||||
driver := setupDriverExt(t)
|
|
||||||
err := driver.TapXY(0.4, 0.5)
|
|
||||||
checkErr(t, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestDriverExt_TapAbsXY(t *testing.T) {
|
|
||||||
driver := setupDriverExt(t)
|
|
||||||
err := driver.TapAbsXY(100, 300)
|
|
||||||
checkErr(t, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestAndroidSwipeAction(t *testing.T) {
|
func TestAndroidSwipeAction(t *testing.T) {
|
||||||
driver := setupDriverExt(t)
|
driver := setupDriverExt(t)
|
||||||
|
|
||||||
|
|||||||
+26
-26
@@ -76,7 +76,7 @@ func TestIOSDevice_GetPackageInfo(t *testing.T) {
|
|||||||
t.Logf("%+v", appInfo)
|
t.Logf("%+v", appInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDriver_DeviceScaleRatio(t *testing.T) {
|
func TestDriver_WDA_DeviceScaleRatio(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
scaleRatio, err := driver.IDriver.(*WDADriver).Scale()
|
scaleRatio, err := driver.IDriver.(*WDADriver).Scale()
|
||||||
@@ -87,7 +87,7 @@ func TestDriver_DeviceScaleRatio(t *testing.T) {
|
|||||||
t.Logf("%+v", scaleRatio)
|
t.Logf("%+v", scaleRatio)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_DeleteSession(t *testing.T) {
|
func TestDriver_WDA_DeleteSession(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
err := driver.DeleteSession()
|
err := driver.DeleteSession()
|
||||||
@@ -96,7 +96,7 @@ func Test_remoteWD_DeleteSession(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_HealthCheck(t *testing.T) {
|
func TestDriver_WDA_HealthCheck(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
err := driver.IDriver.(*WDADriver).HealthCheck()
|
err := driver.IDriver.(*WDADriver).HealthCheck()
|
||||||
@@ -105,7 +105,7 @@ func Test_remoteWD_HealthCheck(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_GetAppiumSettings(t *testing.T) {
|
func TestDriver_WDA_GetAppiumSettings(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
settings, err := driver.IDriver.(*WDADriver).GetAppiumSettings()
|
settings, err := driver.IDriver.(*WDADriver).GetAppiumSettings()
|
||||||
@@ -115,7 +115,7 @@ func Test_remoteWD_GetAppiumSettings(t *testing.T) {
|
|||||||
t.Logf("%+v", settings)
|
t.Logf("%+v", settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_SetAppiumSettings(t *testing.T) {
|
func TestDriver_WDA_SetAppiumSettings(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
const _acceptAlertButtonSelector = "**/XCUIElementTypeButton[`label IN {'允许','好','仅在使用应用期间','暂不'}`]"
|
const _acceptAlertButtonSelector = "**/XCUIElementTypeButton[`label IN {'允许','好','仅在使用应用期间','暂不'}`]"
|
||||||
@@ -134,7 +134,7 @@ func Test_remoteWD_SetAppiumSettings(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_IsWdaHealthy(t *testing.T) {
|
func TestDriver_WDA_IsWdaHealthy(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
healthy, err := driver.IDriver.(*WDADriver).IsHealthy()
|
healthy, err := driver.IDriver.(*WDADriver).IsHealthy()
|
||||||
@@ -146,7 +146,7 @@ func Test_remoteWD_IsWdaHealthy(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_Status(t *testing.T) {
|
func TestDriver_WDA_Status(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
status, err := driver.Status()
|
status, err := driver.Status()
|
||||||
@@ -158,7 +158,7 @@ func Test_remoteWD_Status(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_DeviceInfo(t *testing.T) {
|
func TestDriver_WDA_DeviceInfo(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
info, err := driver.DeviceInfo()
|
info, err := driver.DeviceInfo()
|
||||||
@@ -170,7 +170,7 @@ func Test_remoteWD_DeviceInfo(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_BatteryInfo(t *testing.T) {
|
func TestDriver_WDA_BatteryInfo(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
batteryInfo, err := driver.BatteryInfo()
|
batteryInfo, err := driver.BatteryInfo()
|
||||||
@@ -180,7 +180,7 @@ func Test_remoteWD_BatteryInfo(t *testing.T) {
|
|||||||
t.Log(batteryInfo)
|
t.Log(batteryInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_WindowSize(t *testing.T) {
|
func TestDriver_WDA_WindowSize(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
size, err := driver.WindowSize()
|
size, err := driver.WindowSize()
|
||||||
@@ -190,7 +190,7 @@ func Test_remoteWD_WindowSize(t *testing.T) {
|
|||||||
t.Log(size)
|
t.Log(size)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_Screen(t *testing.T) {
|
func TestDriver_WDA_Screen(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
screen, err := driver.IDriver.(*WDADriver).Screen()
|
screen, err := driver.IDriver.(*WDADriver).Screen()
|
||||||
@@ -200,7 +200,7 @@ func Test_remoteWD_Screen(t *testing.T) {
|
|||||||
t.Log(screen)
|
t.Log(screen)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_Homescreen(t *testing.T) {
|
func TestDriver_WDA_Home(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
err := driver.Home()
|
err := driver.Home()
|
||||||
@@ -209,7 +209,7 @@ func Test_remoteWD_Homescreen(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_AppLaunchTerminate(t *testing.T) {
|
func TestDriver_WDA_AppLaunchTerminate(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
bundleId := "com.apple.Preferences"
|
bundleId := "com.apple.Preferences"
|
||||||
@@ -225,7 +225,7 @@ func Test_remoteWD_AppLaunchTerminate(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_Tap(t *testing.T) {
|
func TestDriver_WDA_TapXY(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
err := driver.TapXY(0.2, 0.2)
|
err := driver.TapXY(0.2, 0.2)
|
||||||
@@ -234,7 +234,7 @@ func Test_remoteWD_Tap(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_DoubleTap(t *testing.T) {
|
func TestDriver_WDA_DoubleTapXY(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
err := driver.DoubleTapXY(0.2, 0.2)
|
err := driver.DoubleTapXY(0.2, 0.2)
|
||||||
@@ -243,7 +243,7 @@ func Test_remoteWD_DoubleTap(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_TouchAndHold(t *testing.T) {
|
func TestDriver_WDA_TouchAndHold(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
err := driver.TouchAndHold(0.2, 0.2)
|
err := driver.TouchAndHold(0.2, 0.2)
|
||||||
@@ -252,7 +252,7 @@ func Test_remoteWD_TouchAndHold(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_Drag(t *testing.T) {
|
func TestDriver_WDA_Drag(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
err := driver.Drag(0.8, 0.5, 0.2, 0.5,
|
err := driver.Drag(0.8, 0.5, 0.2, 0.5,
|
||||||
@@ -262,7 +262,7 @@ func Test_remoteWD_Drag(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Relative_Swipe(t *testing.T) {
|
func TestDriver_WDA_Swipe(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
err := driver.Swipe(0.8, 0.5, 0.2, 0.5)
|
err := driver.Swipe(0.8, 0.5, 0.2, 0.5)
|
||||||
@@ -271,7 +271,7 @@ func Test_Relative_Swipe(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_SendKeys(t *testing.T) {
|
func TestDriver_WDA_Input(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
driver.StartCaptureLog("hrp_wda_log")
|
driver.StartCaptureLog("hrp_wda_log")
|
||||||
err := driver.Input("test中文", option.WithIdentifier("test"))
|
err := driver.Input("test中文", option.WithIdentifier("test"))
|
||||||
@@ -282,7 +282,7 @@ func Test_remoteWD_SendKeys(t *testing.T) {
|
|||||||
t.Log(result)
|
t.Log(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_PressButton(t *testing.T) {
|
func TestDriver_WDA_PressButton(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
err := driver.IDriver.(*WDADriver).PressButton(types.DeviceButtonVolumeUp)
|
err := driver.IDriver.(*WDADriver).PressButton(types.DeviceButtonVolumeUp)
|
||||||
@@ -301,7 +301,7 @@ func Test_remoteWD_PressButton(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_Screenshot(t *testing.T) {
|
func TestDriver_WDA_ScreenShot(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
// without save file
|
// without save file
|
||||||
@@ -325,7 +325,7 @@ func Test_remoteWD_Screenshot(t *testing.T) {
|
|||||||
t.Logf("save screenshot to %s", path)
|
t.Logf("save screenshot to %s", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_Source(t *testing.T) {
|
func TestDriver_WDA_Source(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
var source string
|
var source string
|
||||||
@@ -355,7 +355,7 @@ func Test_remoteWD_Source(t *testing.T) {
|
|||||||
t.Logf("source: %s", source)
|
t.Logf("source: %s", source)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetForegroundApp(t *testing.T) {
|
func TestDriver_WDA_GetForegroundApp(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
app, err := driver.ForegroundInfo()
|
app, err := driver.ForegroundInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -364,7 +364,7 @@ func TestGetForegroundApp(t *testing.T) {
|
|||||||
t.Log(app)
|
t.Log(app)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_remoteWD_AccessibleSource(t *testing.T) {
|
func TestDriver_WDA_AccessibleSource(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
source, err := driver.IDriver.(*WDADriver).AccessibleSource()
|
source, err := driver.IDriver.(*WDADriver).AccessibleSource()
|
||||||
@@ -374,7 +374,7 @@ func Test_remoteWD_AccessibleSource(t *testing.T) {
|
|||||||
fmt.Println(source)
|
fmt.Println(source)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRecord(t *testing.T) {
|
func TestDriver_WDA_ScreenRecord(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
path, err := driver.ScreenRecord(5 * time.Second)
|
path, err := driver.ScreenRecord(5 * time.Second)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -383,7 +383,7 @@ func TestRecord(t *testing.T) {
|
|||||||
println(path)
|
println(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Backspace(t *testing.T) {
|
func TestDriver_WDA_Backspace(t *testing.T) {
|
||||||
driver := setupWDADriverExt(t)
|
driver := setupWDADriverExt(t)
|
||||||
|
|
||||||
err := driver.Backspace(3)
|
err := driver.Backspace(3)
|
||||||
|
|||||||
Reference in New Issue
Block a user