lundi 29 avril 2019

How to integrate a test report under vs code?

I'm currently performing unit tests and I would like to add my result tests in a test report. They are in C# and I use VS Code as IDE.

Before I used visual studio 2015 and I was able to create a nice test report with the "extent report" framework which works very well.

However, I would like to know if it's possible to have the same thing on VS Code please?

Here is an extract from "VS 2015" :

using AventStack.ExtentReports;
using AventStack.ExtentReports.Reporter.Configuration;
using AventStack.ExtentReports.Reporter;

.
..
...

public void TestCase1()
{
    ExtentTest test = null;

    try
    {
        test = extent.CreateTest("Test Case 1").Info("Test Started");
        test.Log(Status.Info, "Chrome Browser Launched");
        emailTextField = driver.FindElement(By.XPath(".//*[contains(@id,'email')]"));
        emailTextField.SendKeys(dataValue);
        test.Log(Status.Info, "Email id entered");
        driver.Quit();
        test.Log(Status.Pass, "Test1 Passed");

    }
    catch (Exception e)
    {
       throw;
    }
    finally
    {
        if(driver != null)
        {
            driver.Quit();
        }
    }
}

I would like to be able to reproduce this on VS Code, but it's difficult to find a real alternative on VS Code.

Aucun commentaire:

Enregistrer un commentaire