Ejemplo n.º 1
0
 public ActionResult Edit(TestsuiteModel testsuiteModel)
 {
     if (ModelState.IsValid)
     {
         _settingsService.StoreTestsuite(Mapper.Map <TestsuiteDto>(testsuiteModel));
         return(RedirectToAction("Index"));
     }
     return(View(testsuiteModel));
 }
Ejemplo n.º 2
0
        //
        // GET: /History/

        /// <summary>
        /// The History for a Testcasecombination.
        /// </summary>
        /// <param name="testsystem">ID of testsystem</param>
        /// <param name="testsuite">ID of testsuite</param>
        /// <param name="testcase">ID of testcase</param>
        /// <param name="browser">ID of browser</param>
        /// <param name="language">ID of language</param>
        /// <returns>A Testcase View</returns>
        public ActionResult Resulthistory(int testsystem = 0, int testcase = -1, int browser = -1, int language = -1, int testsuite = 0)
        {
            if (testsystem == 0 && Session["testsystem"] != null)
            {
                testsystem = (int)Session["testsystem"];
            }
            if (testsuite == 0 && Session["testsuite"] != null)
            {
                testsuite = (int)Session["testsuite"];
            }
            Session["testsystem"] = testsystem;
            Session["testsuite"]  = testsuite;

            IList <TestsystemModel> testsystems = Mapper.Map <IList <TestsystemModel> >(_testViewerService.GetTestsystems());

            ViewBag.LstTestsystems = testsystems;
            if (testsystem == 0 && testsystems.Count > 0)
            {
                testsystem = testsystems[0].ID;
            }

            IList <TestsuiteModel> testsuites = Mapper.Map <IList <TestsuiteModel> >(_testViewerService.GetTestSuites(testsystem));

            ViewBag.LstTestsuites = testsuites;
            if ((testsuite == 0 || testsuites.All(t => t.ID != testsuite)) && testsuites.Count > 0)
            {
                testsuite = testsuites[0].ID;
            }

            TestsuiteModel currentTestsuite = testsuites.Single(t => t.ID == testsuite);

            ViewBag.LstTestcases = currentTestsuite.Testcases;
            if (testcase == 0 && currentTestsuite.Testcases.Count > 0)
            {
                testcase = currentTestsuite.Testcases[0].ID;
            }
            ViewBag.LstBrowsers  = currentTestsuite.Browsers;
            ViewBag.LstLanguages = currentTestsuite.Languages;

            ViewBag.Testsystem = testsystem;
            ViewBag.Testsuite  = testsuite;
            ViewBag.Testcase   = testcase;
            ViewBag.Browser    = browser;
            ViewBag.Language   = language;
            //ViewBag.LastUpdated = _objTestViewer.GetLastUpdated(testsystem);

            ViewBag.CurrentTestsuite  = currentTestsuite;
            ViewBag.CurrentTestsystem = testsystems.Single(t => t.ID == testsystem);

            IList <HistoryResult> historyResults = _testViewerService.GetResultsHistory(testsystem, testcase, browser, language, testsuite, 200);

            return(View(historyResults));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Index function for Testing View.
        /// </summary>
        /// <param name="testsystem">ID of the Testsystem</param>
        /// <param name="testsuite">ID of the Testsuite</param>
        /// <returns>A Testing Index View</returns>
        public ActionResult Index(int testsystem = 0, int testsuite = 0)
        {
            if (testsystem == 0 && Session["testsystem"] != null)
            {
                testsystem = (int)Session["testsystem"];
            }
            if (testsuite == 0 && Session["testsuite"] != null)
            {
                testsuite = (int)Session["testsuite"];
            }

            IList <TestsystemModel> testsystems = Mapper.Map <IList <TestsystemModel> >(_testViewerService.GetTestsystems());

            ViewBag.LstTestsystems = testsystems;
            if (testsystem == 0 && testsystems.Count > 0)
            {
                TestsystemModel dev = testsystems.FirstOrDefault(t => t.Name == "dev");
                testsystem = dev != null ? dev.ID : testsystems[0].ID;
            }

            IList <TestsuiteModel> testsuites = Mapper.Map <IList <TestsuiteModel> >(_testViewerService.GetTestSuites(testsystem));

            ViewBag.LstTestsuites = testsuites;
            if ((testsuite == 0 || testsuites.All(t => t.ID != testsuite)) && testsuites.Count > 0)
            {
                TestsuiteModel objMain = testsuites.FirstOrDefault(t => t.Name == RegtestingMvcConfiguration.Defaulttestsuite);
                testsuite = objMain != null ? objMain.ID : testsuites[0].ID;
            }

            Session["testsystem"] = testsystem;
            Session["testsuite"]  = testsuite;

            ViewBag.CurrentTestsuite  = testsuites.Single(t => t.ID == testsuite);
            ViewBag.CurrentTestsystem = testsystems.Single(t => t.ID == testsystem);

            return(View());
        }