예제 #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);
        }
        private void onBeginningTestScriptObjectExecution(TestScriptObject testScriptObject, TestScriptObjectBeginExecutionArgs args)
        {
            TestTreeNode node = FindNode(testScriptObject);

            node.IsExecuting = true;
            node.UpdateUI();
            SelectedNode = node;
        }
예제 #3
0
 public TestTreeNode(TestScriptObject testScriptObject)
     : this()
 {
     TestScriptObject = testScriptObject;
     HasChanged       = false;
     UpdateTitleAndToolTip();
     UpdateUI();
 }
예제 #4
0
 private void onBeginningTestScriptObjectExecution(TestScriptObject testScriptObject, TestScriptObjectBeginExecutionArgs args)
 {
     if (testScriptObject is TestCase)
     {
         incrementLabelCounter(this.m_inprocessStatusBarLabel, m_inprogressLabelFormat);
         decrementLabelCounter(m_totalAvailableStatusBarLabel, m_totalLabelFormat);
     }
 }
        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();
        }
        private void onBeginningTestScriptObjectExecution(TestScriptObject testScriptObject)
        {
            TestTreeNode node = m_treeView.FindNode(testScriptObject);

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

            node.IsExecuting = true;
            node.RefreshUI();
            m_treeView.SelectedNode = node;
        }
예제 #7
0
        public TestTreeNode(TestScriptObject testScriptObject)
            : this()
        {
            TestScriptObject = testScriptObject;
            HasChanged       = false;
            UpdateTitleAndToolTip();
            UpdateUI();

            TestBreakpoints.OnTestBreakpointInserted    += TestBreakpoints_OnTestBreakpointInserted;
            TestBreakpoints.OnTestBreakpointDeleted     += TestBreakpoints_OnTestBreakpointDeleted;
            TestBreakpoint.OnTestBreakpointStateChanged += TestBreakpoint_OnTestBreakpointStateChanged;
        }
        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();
        }
        private void onBeginningTestScriptObjectExecution(TestScriptObject testScriptObject)
        {
            TestTreeNode node = m_testTreeView.FindNode(testScriptObject);

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

            if (testScriptObject is TestCase)
            {
                decrementLabelCounter(this.m_totalAvailableStatusBarLabel, m_totalLabelFormat);
                incrementLabelCounter(this.m_inprocessStatusBarLabel, m_inprogressLabelFormat);
            }

            m_testTreeView.SelectedNode = node;
        }
예제 #10
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 TestScriptObject_OnTestPropertyChanged(TestScriptObject testScriptObject, TestPropertyChangedEventArgs args)
        {
            m_testPropertyGrid.Refresh();

            if (m_testTreeView.RootNode.HasChanged)
            {
                m_fileSaveAsMenuItem.Enabled  = true;
                m_fileSaveMenuItem.Enabled    = true;
                m_saveToolStripButton.Enabled = true;
            }

            if (args.Property.Equals("Tags"))
            {
                resetTagComboBox(false);
            }
        }
        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;
        }
예제 #13
0
    void CmdFire()
    {
        GameObject objectSpawned = Instantiate <GameObject> (prefabSpawn);

        objectSpawned.transform.SetParent(transform);

        /*GameObject objectChildSpawned = Instantiate<GameObject> (prefabSpawn);
         * objectChildSpawned.transform.SetParent (objectSpawned.transform);
         * objectChildSpawned.transform.Rotate(new Vector3 (90, 180, 0));
         *
         * /*GameObject goText = Instantiate<GameObject> (ConstanteInGame.textPrefab);
         * goText.name = "goText";
         * goText.transform.SetParent (objectChildSpawned.transform);
         * TextMesh text = goText.GetComponent<TextMesh> ();
         * text.color = Color.black;
         * text.font = ConstanteInGame.fontArial;
         * text.fontSize = 20;
         * text.text = "BLABLAbla";*//*
         * //goText.AddComponent<NetworkIdentity> ();
         *
         * //ClientScene.RegisterPrefab(goText);
         *
         *
         * objectSpawned.GetComponent<Rigidbody> ().velocity = new Vector3 (6, 0);
         *
         * NetworkServer.Spawn (objectSpawned);
         * NetworkServer.Spawn (objectChildSpawned);
         * NetworkServer.Spawn (goText);
         */
        //RpcSyncBlockOnce (goText.transform.localPosition, goText.transform.localRotation, goText, goText.transform.parent.gameObject);

        TestScriptObject testScript = objectSpawned.GetComponent <TestScriptObject> ();

        testScript.x = 2;
        testScript.y = 3;
        testScript.z = 4;

        NetworkServer.Spawn(objectSpawned);

        RpcGenerate(objectSpawned);

        //RpcSyncBlockOnce (goText.transform.localPosition, goText.transform.localRotation, goText, goText.transform.parent.gameObject);


        Destroy(objectSpawned, 2);
    }
        /// <summary>
        /// Executes the test script object
        /// </summary>
        /// <param name="testScriptObject"></param>
        /// <param name="testCases"></param>
        private void executeTestScriptObject(ExecutionParameters executionParameters)
        {
            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);
        }
        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();
            }
        }
예제 #16
0
 private void TestStep_OnExecutionComplete(TestScriptObject testScriptObject, TestScriptResult testScriptResult)
 {
     _listenerEventsClient?.OnTestStepExecutionComplete((TestStep)testScriptObject, (TestStepResult)testScriptResult);
 }
예제 #17
0
        private void TestStep_OnExecutionBegin(TestScriptObject testScriptObject, TestStepBeginExecutionArgs args)
        {
            TestProperties.SetPropertyValue("CurrentTestStep", testScriptObject);

            _listenerEventsClient?.OnTestStepExecutionBegin((TestStep)testScriptObject, args);
        }
예제 #18
0
    public void RpcGenerate(GameObject goScript)
    {
        TestScriptObject testScript = goScript.GetComponent <TestScriptObject> ();

        testScript.generateCube(goScript);
    }