mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-04 23:16:57 +08:00
fix: failed to record the android ui step type in the step result
This commit is contained in:
@@ -670,8 +670,8 @@ func (r *localRunner) start() {
|
|||||||
close(r.controller.rebalance)
|
close(r.controller.rebalance)
|
||||||
r.wgMu.Unlock()
|
r.wgMu.Unlock()
|
||||||
|
|
||||||
//// wait for goroutines before closing
|
// wait for goroutines before closing
|
||||||
//r.wg.Wait()
|
r.wg.Wait()
|
||||||
|
|
||||||
close(r.doneChan)
|
close(r.doneChan)
|
||||||
|
|
||||||
|
|||||||
+18
-15
@@ -356,6 +356,9 @@ func (s *StepMobile) Name() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *StepMobile) Type() StepType {
|
func (s *StepMobile) Type() StepType {
|
||||||
|
if s.step.Android != nil {
|
||||||
|
return stepTypeAndroid
|
||||||
|
}
|
||||||
return stepTypeIOS
|
return stepTypeIOS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -548,21 +551,6 @@ func (r *HRPRunner) initUIClient(uuid string, osType string) (client *uixt.Drive
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runStepMobileUI(s *SessionRunner, step *TStep) (stepResult *StepResult, err error) {
|
func runStepMobileUI(s *SessionRunner, step *TStep) (stepResult *StepResult, err error) {
|
||||||
stepResult = &StepResult{
|
|
||||||
Name: step.Name,
|
|
||||||
StepType: stepTypeIOS,
|
|
||||||
Success: false,
|
|
||||||
ContentSize: 0,
|
|
||||||
}
|
|
||||||
screenshots := make([]string, 0)
|
|
||||||
|
|
||||||
// merge step variables with session variables
|
|
||||||
stepVariables, err := s.ParseStepVariables(step.Variables)
|
|
||||||
if err != nil {
|
|
||||||
err = errors.Wrap(err, "parse step variables failed")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var osType string
|
var osType string
|
||||||
var mobileStep *MobileStep
|
var mobileStep *MobileStep
|
||||||
if step.IOS != nil {
|
if step.IOS != nil {
|
||||||
@@ -575,6 +563,21 @@ func runStepMobileUI(s *SessionRunner, step *TStep) (stepResult *StepResult, err
|
|||||||
mobileStep = step.Android
|
mobileStep = step.Android
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stepResult = &StepResult{
|
||||||
|
Name: step.Name,
|
||||||
|
StepType: StepType(osType),
|
||||||
|
Success: false,
|
||||||
|
ContentSize: 0,
|
||||||
|
}
|
||||||
|
screenshots := make([]string, 0)
|
||||||
|
|
||||||
|
// merge step variables with session variables
|
||||||
|
stepVariables, err := s.ParseStepVariables(step.Variables)
|
||||||
|
if err != nil {
|
||||||
|
err = errors.Wrap(err, "parse step variables failed")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// init wda/uia driver
|
// init wda/uia driver
|
||||||
uiDriver, err := s.caseRunner.hrpRunner.initUIClient(mobileStep.Serial, osType)
|
uiDriver, err := s.caseRunner.hrpRunner.initUIClient(mobileStep.Serial, osType)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user