fix: tap offset

This commit is contained in:
lilong.129
2025-07-02 20:14:53 +08:00
parent 3171cb8aaf
commit b5e3dd6734
3 changed files with 21 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/stretchr/testify/assert"
hrp "github.com/httprunner/httprunner/v5"
"github.com/httprunner/httprunner/v5/uixt/option"
)
func TestLoadTestCases(t *testing.T) {
@@ -63,3 +64,17 @@ func TestLoadCase(t *testing.T) {
assert.Equal(t, tcJSON.Steps[1].StepName, tcYAML.Steps[1].StepName)
assert.Equal(t, tcJSON.Steps[1].Request, tcJSON.Steps[1].Request)
}
func TestLoadCaseWithTapOffset(t *testing.T) {
// Load the android_swipe_tap_loadmore.json test case
testCasePath := "../examples/uitest/demo_ios_wda_log.json"
tc := &hrp.TestCaseDef{}
err := hrp.LoadFileObject(testCasePath, tc)
assert.Nil(t, err)
action := tc.Steps[3].IOS.Actions[0]
assert.Equal(t, option.ACTION_TapByOCR, action.Method)
assert.Equal(t, "推荐", action.Params)
assert.Equal(t, "点击推荐", action.ActionOptions.Identifier)
assert.Equal(t, []int{0, -1}, action.ActionOptions.ScreenFilterOptions.TapOffset)
}