Beispiel #1
0
        /// <inheritdoc/>
        public virtual void AddTestStepStatusToTestCase(ITestStepStatus testStepStatus, ITestCaseStatus testCaseStatus)
        {
            if (!this.TestCaseToTestSteps.ContainsKey(testCaseStatus))
            {
                this.TestCaseToTestSteps.Add(testCaseStatus, new List <ITestStepStatus>());
            }

            this.TestCaseToTestSteps[testCaseStatus].Add(testStepStatus);
        }
Beispiel #2
0
        /// <inheritdoc/>
        public override void AddTestStepStatusToTestCase(ITestStepStatus testStepStatus, ITestCaseStatus testCaseStatus)
        {
            ALMSetData almConnecter = (ALMSetData)InformationObject.TestSetData;

            almConnecter.ConnectToALM();
            string testName        = testStepStatus.Name;
            string testStatus      = testStepStatus.RunSuccessful ? "Passed" : "Failed";
            string testDescription = testStepStatus.Description;
            string testExpected    = testStepStatus.Expected;
            string testActual      = testStepStatus.Actual;

            almConnecter.TestSet.AddTestStepToTestCase(testName, testStatus, testDescription, testExpected, testActual);
        }
        /// <inheritdoc/>
        public void Log(ITestStep testStep)
        {
            ITestStepStatus testStepStatus = testStep.TestStepStatus;
            List <string>   str            = new List <string>();

            str.Add(this.Tab(2) + "Name:" + testStep.Name);
            str.Add(this.Tab(2) + "Description:" + ((TestStep)testStep).Description);
            str.Add(this.Tab(2) + "Actual:" + testStepStatus.Actual);
            str.Add(this.Tab(2) + "RunSuccessful:" + testStepStatus.RunSuccessful.ToString());
            str.Add(this.Tab(2) + "----------------------------");

            foreach (string line in str)
            {
                Logger.Info(line);
            }
        }
Beispiel #4
0
        /// <inheritdoc/>
        public void UpdateTestCaseStatus(ITestStepStatus testStepStatus)
        {
            string result = this.GetTotalElapsedTime(testStepStatus).ToString();

            if (testStepStatus.RunSuccessful == false)
            {
                result = "F";
                if (!((TestStepStatus)testStepStatus).Optional)
                {
                    this.TestCaseStatus.RunSuccessful        = false;
                    this.TestCaseStatus.FriendlyErrorMessage = "Something went wrong with a test step";
                }
            }

            if (testStepStatus.Actual != "No Log")
            {
                InformationObject.CSVLogger.AddResults($"\"{testStepStatus.Name}\",\"{result}\"");
            }

            InformationObject.Reporter.AddTestStepStatusToTestCase(testStepStatus, this.TestCaseStatus);
        }
Beispiel #5
0
 private double GetTotalElapsedTime(ITestStepStatus testStepStatus)
 {
     return(Math.Abs((testStepStatus.StartTime - testStepStatus.EndTime).TotalSeconds));
 }