예제 #1
0
        /// <summary>
        /// RunTestCases
        /// </summary>
        protected virtual void RunTestCases()
        {
            IList <Testcase> testsToExecute = _testcaseManager.GetSelectedTestCases(_testcasesTreeview);

            if (WriteLogToDiskCheckBox.Checked)
            {
                string         testPath = Server.MapPath("");
                TestcaseLogger logger   = new TestcaseLogger(testPath, this.TestcaseExecutor);

                // verify user has write access to folder
                try
                {
                    logger.WriteStartupFile();
                }
                catch (UnauthorizedAccessException)
                {
                    _errorsLabel.Text = String.Format("Error: Write to log feature requires write access to '{0}' directory.", testPath);
                    return;
                }
            }

            // Get a testcase executor and start
            int threadId = TestcaseExecutor.Start(testsToExecute, Request);

            _threadId.Text = "[Current ThreadId: " + threadId.ToString() + "]";

            string startupScript = @"
            TestExecutor.set_threadId(" + threadId + @");
            TestExecutor.set_logDetail(" + ((int)LogDetail) + @");
            TestExecutor.TestcaseExecutedCallback = TreeView_TestcaseExecuted;
            TestExecutor.start();";

            SystemWebExtensionsAbstractions.RegisterStartupScript(this, typeof(Page), "LTAF.Startup", startupScript, true);
        }
예제 #2
0
        /// <summary>
        /// Sets up the service locators and the UI
        /// </summary>
        internal void OnInitInternal()
        {
            SystemWebExtensionsAbstractions.Initialize(this);

            if (!_aspNetService.GetIsPostBack(this))
            {
                _testcaseTypes = new Dictionary <string, Type>();
                SetupServiceLocator(_aspNetService.GetApplicationPath(this));
            }

            if (_generateInterface)
            {
                GenerateInterface();
            }

            _testcasesTreeview.Load += new EventHandler(TestcasesTreeview_Load);
        }