mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-03 20:47:10 +08:00
fix: ToolSleepMS tool call
This commit is contained in:
@@ -191,10 +191,6 @@ type ActionOptions struct {
|
||||
ResetHistory bool `json:"reset_history,omitempty" yaml:"reset_history,omitempty" desc:"Whether to reset conversation history before AI planning"`
|
||||
OutputSchema interface{} `json:"output_schema,omitempty" yaml:"output_schema,omitempty" desc:"Custom output schema for structured AI query response"`
|
||||
|
||||
// Time related
|
||||
Seconds float64 `json:"seconds,omitempty" yaml:"seconds,omitempty" desc:"Sleep duration in seconds"`
|
||||
Milliseconds int64 `json:"milliseconds,omitempty" yaml:"milliseconds,omitempty" desc:"Sleep duration in milliseconds"`
|
||||
|
||||
// Control options
|
||||
Context context.Context `json:"-" yaml:"-"`
|
||||
Identifier string `json:"identifier,omitempty" yaml:"identifier,omitempty" desc:"Action identifier for logging"`
|
||||
@@ -368,7 +364,8 @@ func (o *ActionOptions) ApplyTapOffset(absX, absY float64) (float64, float64) {
|
||||
}
|
||||
|
||||
func (o *ActionOptions) ApplySwipeOffset(absFromX, absFromY, absToX, absToY float64) (
|
||||
float64, float64, float64, float64) {
|
||||
float64, float64, float64, float64,
|
||||
) {
|
||||
if len(o.SwipeOffset) == 4 {
|
||||
absFromX += float64(o.SwipeOffset[0])
|
||||
absFromY += float64(o.SwipeOffset[1])
|
||||
|
||||
@@ -140,16 +140,14 @@ func TestUnifiedActionRequest_CustomOptions(t *testing.T) {
|
||||
func TestUnifiedActionRequest_BasicTypeFields(t *testing.T) {
|
||||
// Test basic type fields (no longer pointers)
|
||||
unifiedReq := &ActionOptions{
|
||||
Platform: "android",
|
||||
Serial: "device123",
|
||||
Count: 5,
|
||||
Keycode: 123,
|
||||
Delta: 10,
|
||||
Width: 800,
|
||||
Height: 600,
|
||||
Seconds: 2.5,
|
||||
Milliseconds: 1500,
|
||||
TabIndex: 3,
|
||||
Platform: "android",
|
||||
Serial: "device123",
|
||||
Count: 5,
|
||||
Keycode: 123,
|
||||
Delta: 10,
|
||||
Width: 800,
|
||||
Height: 600,
|
||||
TabIndex: 3,
|
||||
}
|
||||
|
||||
// Test direct field access (no need for Getter methods)
|
||||
@@ -158,8 +156,6 @@ func TestUnifiedActionRequest_BasicTypeFields(t *testing.T) {
|
||||
assert.Equal(t, 10, unifiedReq.Delta)
|
||||
assert.Equal(t, 800, unifiedReq.Width)
|
||||
assert.Equal(t, 600, unifiedReq.Height)
|
||||
assert.Equal(t, 2.5, unifiedReq.Seconds)
|
||||
assert.Equal(t, int64(1500), unifiedReq.Milliseconds)
|
||||
assert.Equal(t, 3, unifiedReq.TabIndex)
|
||||
|
||||
// Test zero value detection
|
||||
@@ -169,7 +165,5 @@ func TestUnifiedActionRequest_BasicTypeFields(t *testing.T) {
|
||||
assert.Equal(t, 0, emptyReq.Delta)
|
||||
assert.Equal(t, 0, emptyReq.Width)
|
||||
assert.Equal(t, 0, emptyReq.Height)
|
||||
assert.Equal(t, 0.0, emptyReq.Seconds)
|
||||
assert.Equal(t, int64(0), emptyReq.Milliseconds)
|
||||
assert.Equal(t, 0, emptyReq.TabIndex)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user