chr
2026-04-08 53e656200368a983e563550e2cc1acbc6d86b729
OpenTap/BasicSteps/SequenceCallStep.cs
@@ -30,6 +30,11 @@
            public Guid Guid2 { get; set; }
        }
        protected override void OnRootChanged(TestPlan plan)
        {
            LoadTestPlan();
        }
        /// <summary>
        /// This is the list of path of test plan loaded and used to prevent recursive TestPlan references.
        /// </summary>
@@ -87,7 +92,6 @@
                {
                    realPath = this.GetParent<TestPlan>()?.Path;
                }
                LoadTestPlan();
            }
        }
@@ -107,7 +111,7 @@
            }
        }
        [Display("共享变量")]
        //[Display("共享变量")]
        public bool ShareGlobals { get; set; }
        [Browsable(false)]
@@ -268,25 +272,30 @@
                var xml = plan.SerializeToString();
                var listeners = OpenTap.Log.GetListeners();
                var resultSetting = ResultSettings.Current;
                var fileGlobalsContext = PlanRun.fileGlobalsContext;
                using (Session.Create())
                {
                    SequenceContext.SetLocals(new VariableContext(null));
                    var plan2 = Utils.DeserializeFromString<TestPlan>(xml);
                    plan2.PrintTestPlanRunSummary = false;
                    plan2.VisualPath = plan.Path;
                    foreach (var listener in listeners)
                    {
                        OpenTap.Log.AddListener(listener);
                    }
                    TestPlanRun subRun;
                    if (ShareGlobals)
                    {
                        subRun = plan2.Execute(SequenceName, resultSetting, null, null,
                            new VariableContainer(GetMergeContainer(), this.PlanRun.FileGlobalsRuntime, this.PlanRun.StationGlobalsRuntime));
                    }
                    else
                    {
                        subRun = plan2.Execute(SequenceName, resultSetting, null, null, new VariableContainer(GetMergeContainer(), null,
                            this.PlanRun.StationGlobalsRuntime));
                    }
                           new VariableContainer(GetMergeContainer(), fileGlobalsContext, this.PlanRun.StationGlobalsRuntime));
                    //if (ShareGlobals)
                    //{
                    //    subRun = plan2.Execute(SequenceName, resultSetting, null, null,
                    //        new VariableContainer(GetMergeContainer(), fileGlobalsContext, this.PlanRun.StationGlobalsRuntime));
                    //}
                    //else
                    //{
                    //    subRun = plan2.Execute(SequenceName, resultSetting, null, null, new VariableContainer(GetMergeContainer(), null,
                    //        this.PlanRun.StationGlobalsRuntime));
                    //}
                    UpgradeVerdict(subRun.Verdict);
                }
            }