fix: test error

This commit is contained in:
lilong.129
2024-09-20 18:11:20 +08:00
parent 6fa1a074b7
commit 65301ef0e3
4 changed files with 21 additions and 24 deletions

6
go.mod
View File

@@ -1,8 +1,11 @@
module github.com/httprunner/httprunner/v4
go 1.18
go 1.22
toolchain go1.22.7
require (
code.byted.org/iesqa/ghdc v0.0.0-20240918093157-b4feef0e5af0
github.com/andybalholm/brotli v1.0.4
github.com/denisbrodbeck/machineid v1.0.1
github.com/fatih/color v1.16.0
@@ -39,7 +42,6 @@ require (
require (
cloud.google.com/go/compute v1.23.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
code.byted.org/iesqa/ghdc v0.0.0-20240918093157-b4feef0e5af0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect

10
go.sum
View File

@@ -34,12 +34,6 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
code.byted.org/iesqa/ghdc v0.0.0-20240911080657-3fe04d3190a5 h1:9H06vi9l4K8xjhQg5Lsu4lbtB2NBKUG/l4XyRGhLuAk=
code.byted.org/iesqa/ghdc v0.0.0-20240911080657-3fe04d3190a5/go.mod h1:0IrKgKT75jmlpi9N0Mi5xWKctJuKHFM6f+ZMQe5vnNs=
code.byted.org/iesqa/ghdc v0.0.0-20240918062858-e57e2d72ed7b h1:pbIbB1S+vhIgEeaDoIqM5GtsCtlGXYaO7VZBYbVGYZU=
code.byted.org/iesqa/ghdc v0.0.0-20240918062858-e57e2d72ed7b/go.mod h1:0IrKgKT75jmlpi9N0Mi5xWKctJuKHFM6f+ZMQe5vnNs=
code.byted.org/iesqa/ghdc v0.0.0-20240918083005-02dc9c3eed10 h1:QwIVe4NaY3i3u0sN3JGczfrtAlI0FnPQSfOCfojudoc=
code.byted.org/iesqa/ghdc v0.0.0-20240918083005-02dc9c3eed10/go.mod h1:0IrKgKT75jmlpi9N0Mi5xWKctJuKHFM6f+ZMQe5vnNs=
code.byted.org/iesqa/ghdc v0.0.0-20240918093157-b4feef0e5af0 h1:qsKGQS3A530QpOXY80ogzzhVpf25Q4WfHusSlRyNvLU=
code.byted.org/iesqa/ghdc v0.0.0-20240918093157-b4feef0e5af0/go.mod h1:0IrKgKT75jmlpi9N0Mi5xWKctJuKHFM6f+ZMQe5vnNs=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
@@ -125,6 +119,7 @@ github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
@@ -211,6 +206,7 @@ github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7P
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE=
github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74=
github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg=
github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
@@ -290,6 +286,7 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -678,6 +675,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

View File

@@ -1 +1 @@
v5.0.0-beta-2409191642
v5.0.0-beta-2409201812

View File

@@ -7,12 +7,9 @@ import (
"testing"
)
var (
driver IWebDriver
harmonyDriverExt *DriverExt
)
var harmonyDriverExt *DriverExt
func setup(t *testing.T) {
func setupHarmonyDevice(t *testing.T) {
device, err := NewHarmonyDevice()
if err != nil {
t.Fatal(err)
@@ -28,7 +25,7 @@ func setup(t *testing.T) {
}
func TestWindowSize(t *testing.T) {
setup(t)
setupHarmonyDevice(t)
size, err := driver.WindowSize()
if err != nil {
t.Fatal(err)
@@ -37,7 +34,7 @@ func TestWindowSize(t *testing.T) {
}
func TestHarmonyTap(t *testing.T) {
setup(t)
setupHarmonyDevice(t)
err := harmonyDriverExt.TapAbsXY(200, 2000)
if err != nil {
t.Fatal(err)
@@ -45,7 +42,7 @@ func TestHarmonyTap(t *testing.T) {
}
func TestSwipe(t *testing.T) {
setup(t)
setupHarmonyDevice(t)
err := harmonyDriverExt.SwipeLeft()
if err != nil {
t.Fatal(err)
@@ -53,7 +50,7 @@ func TestSwipe(t *testing.T) {
}
func TestInput(t *testing.T) {
setup(t)
setupHarmonyDevice(t)
err := harmonyDriverExt.Input("test")
if err != nil {
t.Fatal(err)
@@ -61,7 +58,7 @@ func TestInput(t *testing.T) {
}
func TestHomeScreen(t *testing.T) {
setup(t)
setupHarmonyDevice(t)
err := driver.Homescreen()
if err != nil {
t.Fatal(err)
@@ -69,7 +66,7 @@ func TestHomeScreen(t *testing.T) {
}
func TestUnlock(t *testing.T) {
setup(t)
setupHarmonyDevice(t)
err := driver.Unlock()
if err != nil {
t.Fatal(err)
@@ -77,7 +74,7 @@ func TestUnlock(t *testing.T) {
}
func TestPressBack(t *testing.T) {
setup(t)
setupHarmonyDevice(t)
err := driver.PressBack()
if err != nil {
t.Fatal(err)
@@ -85,7 +82,7 @@ func TestPressBack(t *testing.T) {
}
func TestScreenshot(t *testing.T) {
setup(t)
setupHarmonyDevice(t)
screenshot, err := driver.Screenshot()
if err != nil {
t.Fatal(err)
@@ -94,7 +91,7 @@ func TestScreenshot(t *testing.T) {
}
func TestLaunch(t *testing.T) {
setup(t)
setupHarmonyDevice(t)
err := driver.AppLaunch("")
if err != nil {
t.Fatal(err)
@@ -102,7 +99,7 @@ func TestLaunch(t *testing.T) {
}
func TestForegroundApp(t *testing.T) {
setup(t)
setupHarmonyDevice(t)
appInfo, err := driver.GetForegroundApp()
if err != nil {
t.Fatal(err)