mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-13 00:11:28 +08:00
fix: parse result for finished type
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v5.0.0-beta-2503220107
|
v5.0.0-beta-2503220119
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ func (p *ActionParser) parseActionText(actionText, thought string) ([]ParsedActi
|
|||||||
"type": regexp.MustCompile(`type\(content='([^']+)'\)`),
|
"type": regexp.MustCompile(`type\(content='([^']+)'\)`),
|
||||||
"scroll": regexp.MustCompile(`scroll\(start_box='([^']+)', direction='([^']+)'\)`),
|
"scroll": regexp.MustCompile(`scroll\(start_box='([^']+)', direction='([^']+)'\)`),
|
||||||
"wait": regexp.MustCompile(`wait\(\)`),
|
"wait": regexp.MustCompile(`wait\(\)`),
|
||||||
"finished": regexp.MustCompile(`finished\(\)`),
|
"finished": regexp.MustCompile(`finished\(content='([^']+)'\)`),
|
||||||
"call_user": regexp.MustCompile(`call_user\(\)`),
|
"call_user": regexp.MustCompile(`call_user\(\)`),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -93,9 +93,6 @@ func TestVLMPlanning(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestXHSPlanning(t *testing.T) {
|
func TestXHSPlanning(t *testing.T) {
|
||||||
err := loadEnv()
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
imageBase64, size, err := loadImage("testdata/xhs-feed.jpeg")
|
imageBase64, size, err := loadImage("testdata/xhs-feed.jpeg")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
@@ -165,6 +162,39 @@ func TestXHSPlanning(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestChatList(t *testing.T) {
|
||||||
|
imageBase64, size, err := loadImage("testdata/chat_list.jpeg")
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
userInstruction := "请结合图片的文字信息,请告诉我一共有多少个群聊,哪些群聊右下角有绿点"
|
||||||
|
|
||||||
|
planner, err := NewPlanner(context.Background())
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
opts := &PlanningOptions{
|
||||||
|
UserInstruction: userInstruction,
|
||||||
|
Message: &schema.Message{
|
||||||
|
Role: schema.User,
|
||||||
|
MultiContent: []schema.ChatMessagePart{
|
||||||
|
{
|
||||||
|
Type: schema.ChatMessagePartTypeImageURL,
|
||||||
|
ImageURL: &schema.ChatMessageImageURL{
|
||||||
|
URL: imageBase64,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Size: size,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行规划
|
||||||
|
result, err := planner.Call(opts)
|
||||||
|
|
||||||
|
// 验证结果
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.NotNil(t, result)
|
||||||
|
}
|
||||||
|
|
||||||
func TestValidateInput(t *testing.T) {
|
func TestValidateInput(t *testing.T) {
|
||||||
imageBase64, size, err := loadImage("testdata/popup_risk_warning.png")
|
imageBase64, size, err := loadImage("testdata/popup_risk_warning.png")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user