예제 #1
0
 public override void OnExit(MethodExecutionArgs args)
 {
     if (args != null && ExtentReportsHelper.GetLastNode() != null)
     {
         ExtentReportsHelper.EndStepNode(ExtentReportsHelper.GetLastNode());
     }
 }
예제 #2
0
        public override void OnEntry(MethodExecutionArgs args)
        {
            if (args != null)
            {
                string nodeName = args.Method.Name;
                if (args.Method.GetParameters().Length > 0 &&
                    (args.Method.GetParameters()[0].Name == "controlName" ||
                     args.Method.GetParameters()[0].Name == "itemName"))
                {
                    if (args.Method.GetParameters().Length > 1 && args.Method.GetParameters()[1].Name == "controlType")
                    {
                        Type eNumType = args.Method.GetParameters()[1].ParameterType;
                        nodeName += $" ({args.Arguments[0]} {Enum.GetName(eNumType, args.Arguments[1]).ToLower()})";
                    }
                    else
                    {
                        nodeName += $" ({args.Arguments[0]})";
                    }
                }

                if (nodeName.StartsWith("Validate"))
                {
                    nodeName = $"<span style='color:#00CCFF'>{nodeName}</span>";
                }

                ExtentReportsHelper.CreateStepNode(nodeName);
            }
        }