示例#1
0
        public string Post(string baseUrl, DriverType driverType = DriverType.Chrome, string className = null, string methodName = null)
        {
            var model    = new SeleniumTestModel();
            var rootPath = HostingEnvironment.MapPath("~/");
            var basePath = model.GetPath(rootPath);
            var id       = model.TestStart(driverType, basePath, baseUrl, className, methodName);

            return(id);
        }
示例#2
0
        public TestResultInfo Get(string id)
        {
            var model    = new SeleniumTestModel();
            var rootPath = HostingEnvironment.MapPath("~/");
            var basePath = model.GetPath(rootPath);
            var r        = model.GetTestResult(basePath, id);

            var filesPath = HostingEnvironment.MapPath($"~/Content/Results/{id}/");

            r.Files = Directory.EnumerateFiles(filesPath, "*.png").Select(c => Path.GetFileName(c)).ToArray();
            return(r);
        }
示例#3
0
        // GET: TestResult
        public ActionResult Index()
        {
            var model    = new SeleniumTestModel();
            var rootPath = HostingEnvironment.MapPath("~/");
            var basePath = model.GetPath(rootPath);
            var ids      = model.EnumResultIds(basePath);

            var results = ids
                          .OrderByDescending(c => c)
                          .Take(50)
                          .Select(c => model.GetTestResult(basePath, c))
                          .ToArray();

            return(View(results));
        }