예제 #1
0
        public void Valid(string Tvalue, string sType = null, string Target = null)
        {
            //Deal with Command
            var Itmes = JSupport.ComandParse(ref Tvalue, ref Target, ref sType);

            //Action
            foreach (string item in Itmes)
            {
                switch (item)
                {
                case "@弹出框校验":
                    JValid.ValidAlert(driver, Tvalue);
                    break;

                case "@文本":
                    element = JElement.GetValidXpath(driver, Tvalue, Target);
                    break;

                case "@对比":
                    if (!element.Text.Contains(Tvalue))
                    {
                        throw new Exception(string.Format("✘:文本校验失败,请检查文本:{0}", Tvalue));
                    }
                    break;

                default:
                    throw new ArgumentOutOfRangeException(string.Format("✘:sType命令中不存在:{0},请核对", Itmes));
                }
            }
        }