mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 07:26:55 +08:00
feat: 回滚多余逻辑
This commit is contained in:
+3
-4
@@ -24,10 +24,9 @@ type IAsserter interface {
|
|||||||
|
|
||||||
// AssertOptions represents the input options for assertion
|
// AssertOptions represents the input options for assertion
|
||||||
type AssertOptions struct {
|
type AssertOptions struct {
|
||||||
Assertion string `json:"assertion"` // The assertion text to verify
|
Assertion string `json:"assertion"` // The assertion text to verify
|
||||||
Screenshot string `json:"screenshot"` // Base64 encoded screenshot
|
Screenshot string `json:"screenshot"` // Base64 encoded screenshot
|
||||||
Size types.Size `json:"size"` // Screen dimensions
|
Size types.Size `json:"size"` // Screen dimensions
|
||||||
ResetHistory bool `json:"reset_history"` // whether to reset conversation history before assertion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AssertionResult represents the response from an AI assertion
|
// AssertionResult represents the response from an AI assertion
|
||||||
|
|||||||
@@ -164,11 +164,6 @@ func (w *WingsService) Assert(ctx context.Context, opts *AssertOptions) (*Assert
|
|||||||
return nil, errors.Wrap(err, "validate assertion parameters failed")
|
return nil, errors.Wrap(err, "validate assertion parameters failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset history if requested
|
|
||||||
if opts.ResetHistory {
|
|
||||||
w.resetHistory()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clean screenshot data URL prefix
|
// Clean screenshot data URL prefix
|
||||||
cleanScreenshot := w.cleanScreenshotDataURL(opts.Screenshot)
|
cleanScreenshot := w.cleanScreenshotDataURL(opts.Screenshot)
|
||||||
|
|
||||||
@@ -177,7 +172,7 @@ func (w *WingsService) Assert(ctx context.Context, opts *AssertOptions) (*Assert
|
|||||||
|
|
||||||
// Prepare Wings API request for assertion
|
// Prepare Wings API request for assertion
|
||||||
apiRequest := WingsActionRequest{
|
apiRequest := WingsActionRequest{
|
||||||
Historys: w.history,
|
Historys: []History{},
|
||||||
DeviceInfo: deviceInfo,
|
DeviceInfo: deviceInfo,
|
||||||
StepText: opts.Assertion,
|
StepText: opts.Assertion,
|
||||||
BizId: w.bizId,
|
BizId: w.bizId,
|
||||||
|
|||||||
@@ -323,6 +323,7 @@ func createXTDriverWithConfig(config DriverCacheConfig) (*XTDriver, error) {
|
|||||||
// Default AI options
|
// Default AI options
|
||||||
aiOpts = []option.AIServiceOption{
|
aiOpts = []option.AIServiceOption{
|
||||||
option.WithCVService(option.CVServiceTypeVEDEM),
|
option.WithCVService(option.CVServiceTypeVEDEM),
|
||||||
|
option.WithLLMConfig(option.RecommendedConfigurations()["ui_focused"]),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user