Ejemplo n.º 1
0
        private void executeOnVirtualUserThread(object executionParametersAsObject)
        {
            LogEvent.Debug("Starting executeOnVirtualUserThread");

            ExecutionParameters executionParameters = executionParametersAsObject as ExecutionParameters;

            TestScriptResult testScriptResult = null;

            // Fire of beginning execution event.
            fireExecutionBeginEvent(this, new TestExecutionBeginArgs(Thread.CurrentThread.Name, executionParameters._testScriptObject));

            _stopWatch = new Stopwatch();

            try
            {
                _stopWatch.Start();

                if (executionParameters._testScriptObject is TestSuite)
                {
                    testScriptResult = ((TestSuite)executionParameters._testScriptObject).Execute(executionParameters._testCases);
                }
                else if (executionParameters._testScriptObject is TestCase)
                {
                    testScriptResult = ((TestCase)executionParameters._testScriptObject).Execute();
                }
                else if (executionParameters._testScriptObject is TestStep)
                {
                    testScriptResult = ((TestStep)executionParameters._testScriptObject).Execute();
                }

                _stopWatch.Stop();

                // Fire execution complete event...
                fireExecutionCompleteEvent(this, new TestExecutionCompleteArgs(Thread.CurrentThread.Name, executionParameters._testScriptObject,
                                                                               TerminationReason.Normal, _stopWatch.Elapsed));
            }
            catch (ThreadAbortException e)
            {
                LogEvent.Error(e.ToString());
                // Eat this exception as is handled by StopExecution method.
            }
            catch (Exception e)
            {
                _stopWatch.Stop();

                fireExecutionCompleteEvent(this,
                                           new TestExecutionCompleteArgs(Thread.CurrentThread.Name, _initialTestScriptObject,
                                                                         TerminationReason.RuntimeException, _stopWatch.Elapsed, e.ToString()));
            }
            finally
            {
            }
        }
        private void onTestScriptObjectExecutionComplete(TestScriptObject testScriptObject, TestScriptResult testScriptObjectResult)
        {
            TestTreeNode node = m_treeView.FindNode(testScriptObject);

            m_testOutputViewer.AppendText(string.Format("{0} \"{1}\" execution complete\n\n",
                                                        node.GetTestScriptObjectType(), node.TestScriptObject.Title));

            node.IsExecuting      = false;
            node.TestScriptResult = testScriptObjectResult;
            node.RefreshUI();
        }
Ejemplo n.º 3
0
 private void TestStep_OnExecutionComplete(TestScriptObject testScriptObject, TestScriptResult testScriptResult)
 {
     _listenerEventsClient?.OnTestStepExecutionComplete((TestStep)testScriptObject, (TestStepResult)testScriptResult);
 }
        private void onTestScriptObjectExecutionComplete(TestScriptObject testScriptObject, TestScriptResult testScriptObjectResult)
        {
            TestTreeNode node = FindNode(testScriptObject);

            if (testScriptObjectResult.TestVerdict == TestVerdict.Pass)
            {
                node.Collapse(false);
            }

            node.IsExecuting      = false;
            node.TestScriptResult = testScriptObjectResult;
            node.UpdateUI();
        }
Ejemplo n.º 5
0
        //private void dosomething(Guid)
        //{ }

        //private void bob()
        //{
        //    var testWait = new TestWait<Session>(session, "Vendor request files not downloaded.", TimeSpan.FromSeconds(60));

        //    downLoadedFiles = testWait.Until<List<string>>((x) =>
        //    {
        //        // Download file to target folder.
        //        var result = session.GetFiles(remotePath, targetFolder + '\\', false, transferOptions);

        //        result.Check();

        //        return result.Transfers.Count > 0 ? getDestinationFiles(result.Transfers) : null;
        //    });
        //}

        private void formatResult(ExtentTest extentTest, TestScriptObject testScriptObject, TestScriptResult testScriptResult)
        {
            if (testScriptResult.TestVerdict == TestVerdict.Pass)
            {
                extentTest.Pass(testScriptResult.TestMessage);
            }
            else if (testScriptResult.TestVerdict == TestVerdict.Fail)
            {
                extentTest.Fail(testScriptResult.TestMessage);
            }
            else if (testScriptResult.TestVerdict == TestVerdict.Error)
            {
                extentTest.Error(testScriptResult.TestMessage);
            }
        }
        private void onTestScriptObjectExecutionComplete(TestScriptObject testScriptObject, TestScriptResult testScriptObjectResult)
        {
            TestTreeNode node = m_testTreeView.FindNode(testScriptObject);

            m_traceViewer.AppendText(string.Format("{0} \"{1}\" execution complete ({2}).\n\n",
                                                   node.GetTestScriptObjectType(), node.TestScriptObject.Title, node.TestScriptObject.VirtualUser));

            if (testScriptObjectResult is TestCaseResult)
            {
                decrementLabelCounter(m_inprocessStatusBarLabel, m_inprogressLabelFormat);

                switch (testScriptObjectResult.TestVerdict)
                {
                case TestVerdict.Pass:
                    incrementLabelCounter(m_passedStatusBarLabel, m_passedLabelFormat);
                    break;

                case TestVerdict.Fail:
                    incrementLabelCounter(m_failedStatusBarLabel, m_failededLabelFormat);
                    break;

                case TestVerdict.Error:
                    incrementLabelCounter(m_erroredStatusBarLabel, m_erroredLabelFormat);
                    break;

                case TestVerdict.Inconclusive:
                    incrementLabelCounter(m_inconclusiveStatusBarLabel, m_inconclusiveLabelFormat);
                    break;

                case TestVerdict.DidNotExecute:
                    incrementLabelCounter(m_didnotexecuteStatusBarLabel, m_didnotexecuteLabelFormat);
                    break;

                default:
                    break;
                }

                updateStatusBarTooltips();
            }
        }
        private void onTestScriptObjectExecutionComplete(TestScriptObject testScriptObject, TestScriptResult testScriptObjectResult)
        {
            TestTreeNode node = FindNode(testScriptObject);

            if (testScriptObjectResult.TestVerdict == TestVerdict.Pass)
            {
                node.Collapse(false);
            }

            node.IsExecuting      = false;
            node.TestScriptResult = testScriptObjectResult;
            node.UpdateUI();

            // If completed following a step over, turn step mode off.
            TestBreakpoints.StepOverMode = false;
        }