From a5278343594707849247061038271e760a1b88aa Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Wed, 9 Jul 2025 23:03:31 +0800 Subject: [PATCH 1/3] fix: ignore step popup --- step.go | 1 + step_ui.go | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/step.go b/step.go index 7e5ec98b..636d497b 100644 --- a/step.go +++ b/step.go @@ -37,6 +37,7 @@ type StepConfig struct { Validators []interface{} `json:"validate,omitempty" yaml:"validate,omitempty"` StepExport []string `json:"export,omitempty" yaml:"export,omitempty"` Loops int `json:"loops,omitempty" yaml:"loops,omitempty"` + IgnorePopup bool `json:"ignore_popup,omitempty" yaml:"ignore_popup,omitempty"` // ignore popup for this step, keep for compatibility AutoPopupHandler bool `json:"auto_popup_handler,omitempty" yaml:"auto_popup_handler,omitempty"` // enable auto popup handler for this step } diff --git a/step_ui.go b/step_ui.go index 0dba2e80..7c8c9c0d 100644 --- a/step_ui.go +++ b/step_ui.go @@ -715,6 +715,7 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err var stepVariables map[string]interface{} var stepValidators []interface{} var stepAutoPopupHandler bool + var stepIgnorePopup bool var mobileStep *MobileUI switch stepMobile := step.(type) { @@ -722,11 +723,13 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err mobileStep = stepMobile.obj() stepVariables = stepMobile.Variables stepAutoPopupHandler = stepMobile.AutoPopupHandler + stepIgnorePopup = stepMobile.IgnorePopup case *StepMobileUIValidation: mobileStep = stepMobile.obj() stepVariables = stepMobile.Variables stepValidators = stepMobile.Validators stepAutoPopupHandler = stepMobile.StepMobile.AutoPopupHandler + stepIgnorePopup = stepMobile.StepMobile.IgnorePopup default: return stepResult, errors.New("invalid mobile UI step type") } @@ -797,7 +800,10 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err // automatic handling of pop-up windows on each step finished // priority: testcase config > step config, default to disabled shouldHandlePopup := false - if config != nil && config.AutoPopupHandler { + if stepIgnorePopup { + // step level config, keep for compatibility + shouldHandlePopup = false + } else if config != nil && config.AutoPopupHandler { // testcase level config has higher priority shouldHandlePopup = true } else if stepAutoPopupHandler { From 0e80d7726bfe6c1b4d8dcbc07518d46979b8c223 Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Wed, 9 Jul 2025 23:15:52 +0800 Subject: [PATCH 2/3] fix: ignore testcase popup --- config.go | 1 + step_ui.go | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config.go b/config.go index 9e20bb9a..f96a7fd9 100644 --- a/config.go +++ b/config.go @@ -46,6 +46,7 @@ type TConfig struct { 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"` // ignore popup for all steps, keep for compatibility AutoPopupHandler bool `json:"auto_popup_handler,omitempty" yaml:"auto_popup_handler,omitempty"` // enable auto popup handler AIOptions *option.AIServiceOptions `json:"ai_options,omitempty" yaml:"ai_options,omitempty"` } diff --git a/step_ui.go b/step_ui.go index 7c8c9c0d..903bc53f 100644 --- a/step_ui.go +++ b/step_ui.go @@ -797,10 +797,13 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err if s.caseRunner != nil && s.caseRunner.Config != nil { config = s.caseRunner.Config.Get() } - // automatic handling of pop-up windows on each step finished - // priority: testcase config > step config, default to disabled + // automatic handling of pop-up windows on each step finished, default to disabled + // priority: testcase config ignore_popup > step ignore_popup > config auto_popup_handler > step auto_popup_handler shouldHandlePopup := false - if stepIgnorePopup { + + if config != nil && config.IgnorePopup { + shouldHandlePopup = false + } else if stepIgnorePopup { // step level config, keep for compatibility shouldHandlePopup = false } else if config != nil && config.AutoPopupHandler { From a353d697e8109e84fed0f387e7ec6ce1a9ccf7a0 Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Thu, 10 Jul 2025 13:18:26 +0800 Subject: [PATCH 3/3] change: remove config ignore_popup --- config.go | 1 - internal/version/VERSION | 2 +- step_ui.go | 6 ++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/config.go b/config.go index f96a7fd9..9e20bb9a 100644 --- a/config.go +++ b/config.go @@ -46,7 +46,6 @@ type TConfig struct { 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"` // ignore popup for all steps, keep for compatibility AutoPopupHandler bool `json:"auto_popup_handler,omitempty" yaml:"auto_popup_handler,omitempty"` // enable auto popup handler AIOptions *option.AIServiceOptions `json:"ai_options,omitempty" yaml:"ai_options,omitempty"` } diff --git a/internal/version/VERSION b/internal/version/VERSION index a778e596..552c255e 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0-250709 +v5.0.0-250710 diff --git a/step_ui.go b/step_ui.go index 903bc53f..e103c255 100644 --- a/step_ui.go +++ b/step_ui.go @@ -798,12 +798,10 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err config = s.caseRunner.Config.Get() } // automatic handling of pop-up windows on each step finished, default to disabled - // priority: testcase config ignore_popup > step ignore_popup > config auto_popup_handler > step auto_popup_handler + // priority: step ignore_popup > config auto_popup_handler > step auto_popup_handler shouldHandlePopup := false - if config != nil && config.IgnorePopup { - shouldHandlePopup = false - } else if stepIgnorePopup { + if stepIgnorePopup { // step level config, keep for compatibility shouldHandlePopup = false } else if config != nil && config.AutoPopupHandler {