示例#1
0
    /// <summary>
    /// 读取资源表配置
    /// </summary>
    public void ReadConfigs()
    {
        JsonArray     summary = SimpleJson.SimpleJson.DeserializeObject <JsonArray>(ConfigReader.ReadConfig("Configs/Configs", ""));
        ConfigSummary s       = null;

        foreach (var data in summary)
        {
            s = new ConfigSummary((JsonObject)data);
            summarys.Add(s.className, s);
        }
    }
示例#2
0
        public static void TestReport(string oderNumber, string pic)
        {
            #region Test Report
            ///*
            TestReport           result = new TestReport("./TestResult.xml");
            List <ConfigSummary> css    = new List <ConfigSummary>();
            for (int i = 1; i <= 6; i++)
            {
                ConfigSummary cs = new ConfigSummary();
                cs.Argument = "ConfigArgument" + i.ToString();
                cs.Value    = "ConfigValue" + i.ToString();
                css.Add(cs);
            }

            List <TestSummary> tss = new List <TestSummary>();
            for (int i = 1; i <= 6; i++)
            {
                TestSummary ts = new TestSummary();
                ts.Argument = "TestArgument" + i.ToString();
                ts.Value    = "TestValue" + i.ToString();
                tss.Add(ts);
            }

            List <ComponentSummary> csss = new List <ComponentSummary>();
            for (int i = 1; i <= 1; i++)
            {
                ComponentSummary cs = new ComponentSummary();
                cs.Action         = "订飞机票";
                cs.Component_Name = "OderFight";
                cs.Duration       = "12s";
                cs.Start_Time     = "14:00:00";
                cs.End_Time       = "14:00:12";
                cs.Test_Step      = "12";
                cs.PASS           = "******";
                cs.FAIL           = "0%";
                cs.BLOCK          = "0%";
                csss.Add(cs);
            }

            List <TestComponentStep> TCS = new List <TestComponentStep>();
            for (int i = 1; i <= 1; i++)
            {
                TestComponentStep cs = new TestComponentStep();
                cs.Component_Name  = "OderFight";
                cs.TestGroup       = "TestGroup";
                cs.TestCaseID      = "1";
                cs.CaseDescription = "登录后订飞机票";
                cs.Expected        = "订票成功";
                cs.Result          = "Pass";
                cs.Comment         = "Order number is: " + oderNumber;
                cs.Screenshot      = pic;
                cs.StartTime       = "14:00:00";
                cs.EndTime         = "14:00:12";
                TCS.Add(cs);
            }

            result.CreateConfigSummary(css);
            result.CreateTestSummary(tss);
            result.CreateComponentSummary(csss);
            result.CreateTestComponentStepResult(TCS);


            //  */
            #endregion
        }