How can I print test description for current test in Extent Report? Here is my snippet:
[SetUp]
public void StartUpTest()
{
extent.CreateTest(TestContext.CurrentContext.Test.Name);
init(extent);
loginConfig = new LoginConfig();
forgotPasswordPage = new ForgotPasswordPage(driver, extent);
}
[Test, Description("Verify Message of Forgot Password page.")]
public void verifyMessage()
{
extentReportsHelper.Log("Verify Message of Forgot Password page.");
String actualMessage = forgotPasswordPage.validateMessage();
Assert.AreEqual(expectedMessage, actualMessage);
}
Here is my extent report:
I have used ExtentReports by anshooarora NuGet package. In that have following method to create test in which we can pass description as well but not sure how to access description from test case.
public ExtentTest CreateTest(string name, string description = "")
{
ExtentTest extentTest = new ExtentTest(this, name, description);
SaveTest(extentTest.Model);
return extentTest;
}