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.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..e103c255 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") } @@ -794,10 +797,14 @@ 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: step ignore_popup > config auto_popup_handler > step auto_popup_handler 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 {