mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-07 00:17:37 +08:00
fix: ignore step popup
This commit is contained in:
@@ -37,6 +37,7 @@ type StepConfig struct {
|
|||||||
Validators []interface{} `json:"validate,omitempty" yaml:"validate,omitempty"`
|
Validators []interface{} `json:"validate,omitempty" yaml:"validate,omitempty"`
|
||||||
StepExport []string `json:"export,omitempty" yaml:"export,omitempty"`
|
StepExport []string `json:"export,omitempty" yaml:"export,omitempty"`
|
||||||
Loops int `json:"loops,omitempty" yaml:"loops,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
|
AutoPopupHandler bool `json:"auto_popup_handler,omitempty" yaml:"auto_popup_handler,omitempty"` // enable auto popup handler for this step
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -715,6 +715,7 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err
|
|||||||
var stepVariables map[string]interface{}
|
var stepVariables map[string]interface{}
|
||||||
var stepValidators []interface{}
|
var stepValidators []interface{}
|
||||||
var stepAutoPopupHandler bool
|
var stepAutoPopupHandler bool
|
||||||
|
var stepIgnorePopup bool
|
||||||
|
|
||||||
var mobileStep *MobileUI
|
var mobileStep *MobileUI
|
||||||
switch stepMobile := step.(type) {
|
switch stepMobile := step.(type) {
|
||||||
@@ -722,11 +723,13 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err
|
|||||||
mobileStep = stepMobile.obj()
|
mobileStep = stepMobile.obj()
|
||||||
stepVariables = stepMobile.Variables
|
stepVariables = stepMobile.Variables
|
||||||
stepAutoPopupHandler = stepMobile.AutoPopupHandler
|
stepAutoPopupHandler = stepMobile.AutoPopupHandler
|
||||||
|
stepIgnorePopup = stepMobile.IgnorePopup
|
||||||
case *StepMobileUIValidation:
|
case *StepMobileUIValidation:
|
||||||
mobileStep = stepMobile.obj()
|
mobileStep = stepMobile.obj()
|
||||||
stepVariables = stepMobile.Variables
|
stepVariables = stepMobile.Variables
|
||||||
stepValidators = stepMobile.Validators
|
stepValidators = stepMobile.Validators
|
||||||
stepAutoPopupHandler = stepMobile.StepMobile.AutoPopupHandler
|
stepAutoPopupHandler = stepMobile.StepMobile.AutoPopupHandler
|
||||||
|
stepIgnorePopup = stepMobile.StepMobile.IgnorePopup
|
||||||
default:
|
default:
|
||||||
return stepResult, errors.New("invalid mobile UI step type")
|
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
|
// automatic handling of pop-up windows on each step finished
|
||||||
// priority: testcase config > step config, default to disabled
|
// priority: testcase config > step config, default to disabled
|
||||||
shouldHandlePopup := false
|
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
|
// testcase level config has higher priority
|
||||||
shouldHandlePopup = true
|
shouldHandlePopup = true
|
||||||
} else if stepAutoPopupHandler {
|
} else if stepAutoPopupHandler {
|
||||||
|
|||||||
Reference in New Issue
Block a user