mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-09 17:59:36 +08:00
feat: 可选的base64
This commit is contained in:
@@ -252,6 +252,8 @@ func (dExt *XTDriver) AIAssert(assertion string, opts ...option.ActionOption) (*
|
|||||||
screenOptions := []option.ActionOption{option.WithScreenShotFileName("ai_assert"), option.WithScreenShotBase64(true)}
|
screenOptions := []option.ActionOption{option.WithScreenShotFileName("ai_assert"), option.WithScreenShotBase64(true)}
|
||||||
if options.ScreenShotWithUpload {
|
if options.ScreenShotWithUpload {
|
||||||
screenOptions = append(screenOptions, option.WithScreenShotUpload(true))
|
screenOptions = append(screenOptions, option.WithScreenShotUpload(true))
|
||||||
|
} else {
|
||||||
|
screenOptions = append(screenOptions, option.WithScreenShotBase64(true))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 1: Take screenshot and convert to base64
|
// Step 1: Take screenshot and convert to base64
|
||||||
@@ -306,9 +308,11 @@ func (dExt *XTDriver) PlanNextAction(ctx context.Context, prompt string, opts ..
|
|||||||
// Parse action options to get ResetHistory setting
|
// Parse action options to get ResetHistory setting
|
||||||
options := option.NewActionOptions(opts...)
|
options := option.NewActionOptions(opts...)
|
||||||
resetHistory := options.ResetHistory
|
resetHistory := options.ResetHistory
|
||||||
screenOptions := []option.ActionOption{option.WithScreenShotFileName("ai_planning"), option.WithScreenShotBase64(true)}
|
screenOptions := []option.ActionOption{option.WithScreenShotFileName("ai_planning")}
|
||||||
if options.ScreenShotWithUpload {
|
if options.ScreenShotWithUpload {
|
||||||
screenOptions = append(screenOptions, option.WithScreenShotUpload(true))
|
screenOptions = append(screenOptions, option.WithScreenShotUpload(true))
|
||||||
|
} else {
|
||||||
|
screenOptions = append(screenOptions, option.WithScreenShotBase64(true))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 1: Take screenshot and convert to base64
|
// Step 1: Take screenshot and convert to base64
|
||||||
|
|||||||
Reference in New Issue
Block a user