示例#1
0
        /// <summary>
        /// Executes the test script object
        /// </summary>
        /// <param name="testScriptObject"></param>
        /// <param name="testCases"></param>
        private void executeTestScriptObject(ExecutionParameters executionParameters)
        {
            // Structuring this way as eventually the id or build might be a commmand line item for CI/CD
            if (TestProperties.GetProperty("TestRunId") == null)
            {
                // Not previously set, so create test run id and push to test properties.
                TestProperties.SetPropertyValue("TestRunId", DateTime.Now.Ticks.ToString());
            }

            SuppressExecution = executionParameters._suppressExecution;

            _initialTestScriptObject = executionParameters._testScriptObject;

            // Must be a case or step...
            if (executionParameters._testProfile == null)
            {
                executionParameters._testProfile = new TestProfile(1, new TimeSpan(0, 0, 0), "VirtualUser");
            }

            _mainExecutionThread      = new Thread(new ParameterizedThreadStart(executeOnMainThread));
            _mainExecutionThread.Name = "MainExecutionThread";
            _mainExecutionThread.SetApartmentState(ApartmentState.STA);
            _mainExecutionThread.IsBackground = true;
            _mainExecutionThread.Start(executionParameters);
        }
示例#2
0
        private void TestStep_OnExecutionBegin(TestScriptObject testScriptObject, TestStepBeginExecutionArgs args)
        {
            TestProperties.SetPropertyValue("CurrentTestStep", testScriptObject);

            _listenerEventsClient?.OnTestStepExecutionBegin((TestStep)testScriptObject, args);
        }