Пример #1
0
        /// <summary>
        /// Launches tests.
        /// </summary>
        /// <param name="parameters">Parameters passed from the View.</param>
        /// <param name="single">True if "Run current" button is in use. If "Run current" button has
        /// been clicked, results collected by this moment will not be cleared.</param>
        /// <param name="conformance"></param>
        protected void InternalRun(TestSuiteParameters parameters, bool single, bool conformance)
        {
            _running = true;
            EnableScrolling(true);

            if (!single)
            {
                _testResults.Clear();
                _testExecutionTime = DateTime.Now;
            }

            if (parameters.FeatureDefinition == FeatureDefinitionMode.Define)
            {
                _testResults.Clear();
            }
            _conformance   = conformance;
            _runningSingle = single;

            ReportTestSuiteStarted(parameters, conformance);

            if (parameters.FeatureDefinition == FeatureDefinitionMode.Define)
            {
                _td.RequestFeatures(parameters);
            }
            else
            {
                _td.Run(parameters);
            }
        }
Пример #2
0
        private void btnDiscoveryTest_Click(object sender, EventArgs e)
        {
            listViewTrace.Items.Clear();
            richTextBoxStepRequest.Text = string.Empty;
            richTextBoxStepAnswer.Text = string.Empty;
            richTextBoxException.Text = string.Empty;
            
            btnDiscoveryTest.Enabled = false;
            btnStop.Enabled = true;
            btnPause.Enabled = true;
            btnHalt.Enabled = true;
            _testIsRunning = true;

            TestSuiteParameters parameters = new TestSuiteParameters();
            foreach (TestInfo ti in _selectedTests)
            {
                parameters.TestCases.Add(ti.Method);
            }
            parameters.Address = tbAddress.Text;


            try
            {
                _td = new TestDispatcher();
                _td.OnException += new Action<Exception>(_tr_OnException);
                _td.OnStepCompleted += ts_OnStepCompleted;
                _td.OnTestSuiteCompleted += new Action(_tr_OnTestSuiteCompleted);
                _td.Run(parameters);
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
Пример #3
0
        public void RunTests(Task task)
        {
            _view.BeginTesting();
            TestSuiteParameters parameters = GetTestSuiteParameters(task);

            _currentTask = new List <TestCaseSettings>();

            if (task.FeatureDefnitionSettings != null)
            {
                _td.ResetFeatures();
                _currentTask.Add(task.FeatureDefnitionSettings);
            }

            bool testsExist = false;

            foreach (TestCaseSettings tc in task.Tests)
            {
                TestInfo ti = _testInfos.Where(TI => TI.Category == tc.Category && TI.Id == tc.TestID).FirstOrDefault();
                if (ti != null)
                {
                    parameters.TestCases.Add(ti);
                    _currentTask.Add(tc);
                    testsExist = true;
                }
            }

            if (testsExist)
            {
                parameters.FeatureDefinition = FeatureDefinitionMode.Default;
            }
            else
            {
                parameters.FeatureDefinition = FeatureDefinitionMode.Define;
            }

            _currentTestIdx = 0;
            EnterNextTask();
            // setup DUT

            _td.Run(parameters);
        }
Пример #4
0
        /// <summary>
        /// Launches tests.
        /// </summary>
        /// <param name="parameters">Parameters passed from the View.</param>
        /// <param name="single">True if "Run current" button is in use. If "Run current" button has
        /// been clicked, results collected by this moment will not be cleared.</param>
        void InternalRun(TestSuiteParameters parameters, bool single)
        {
            _running       = true;
            _runningSingle = single;
            _testsCount    = parameters.TestCases.Count;

            DeviceEnvironment env = ContextController.GetDeviceEnvironment();

            parameters.UserName        = env.Credentials.UserName;
            parameters.Password        = env.Credentials.Password;
            parameters.UseUTCTimestamp = env.Credentials.UseUTCTimeStamp;
            parameters.Operator        = new Utils.Operator(View.Window);
            parameters.VideoForm       = View.GetVideoForm();

            parameters.EnvironmentSettings = new Tests.Common.TestEngine.EnvironmentSettings()
            {
                DnsIpv4            = env.EnvironmentSettings.DnsIpv4,
                NtpIpv4            = env.EnvironmentSettings.NtpIpv4,
                DnsIpv6            = env.EnvironmentSettings.DnsIpv6,
                NtpIpv6            = env.EnvironmentSettings.NtpIpv6,
                DefaultGateway     = env.EnvironmentSettings.GatewayIpv4,
                DefaultGatewayIpv6 = env.EnvironmentSettings.GatewayIpv6
            };

            if (!single)
            {
                _testResults.Clear();
                _testExecutionTime = DateTime.Now;
            }

            if (TestSuiteStarted != null)
            {
                TestSuiteStarted(parameters);
            }

            _td.Run(parameters);
        }