mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-03 14:59:38 +08:00
feat: add global AntiRisk configuration support
- Add AntiRisk field to TConfig struct for global anti-risk switch - Add SetAntiRisk method to configure global anti-risk setting - Implement automatic AntiRisk application in mobile UI steps - Global AntiRisk setting applies to all actions unless explicitly disabled - Maintains backward compatibility with existing action-level AntiRisk settings
This commit is contained in:
@@ -43,6 +43,7 @@ type TConfig struct {
|
||||
Path string `json:"path,omitempty" yaml:"path,omitempty"` // testcase file path
|
||||
PluginSetting *PluginConfig `json:"plugin,omitempty" yaml:"plugin,omitempty"` // plugin config
|
||||
MCPConfigPath string `json:"mcp_config_path,omitempty" yaml:"mcp_config_path,omitempty"`
|
||||
AntiRisk bool `json:"anti_risk,omitempty" yaml:"anti_risk,omitempty"` // global anti-risk switch
|
||||
IgnorePopup bool `json:"ignore_popup,omitempty" yaml:"ignore_popup,omitempty"`
|
||||
LLMService option.LLMServiceType `json:"llm_service,omitempty" yaml:"llm_service,omitempty"`
|
||||
CVService option.CVServiceType `json:"cv_service,omitempty" yaml:"cv_service,omitempty"`
|
||||
@@ -76,6 +77,12 @@ func (c *TConfig) SetVerifySSL(verify bool) *TConfig {
|
||||
return c
|
||||
}
|
||||
|
||||
// SetAntiRisk sets global anti-risk switch for current testcase.
|
||||
func (c *TConfig) SetAntiRisk(antiRisk bool) *TConfig {
|
||||
c.AntiRisk = antiRisk
|
||||
return c
|
||||
}
|
||||
|
||||
// WithParameters sets parameters for current testcase.
|
||||
func (c *TConfig) WithParameters(parameters map[string]interface{}) *TConfig {
|
||||
c.Parameters = parameters
|
||||
|
||||
Reference in New Issue
Block a user