I have recently started rest assured to automate APIs. My current framework folder structure has an ApiTestCases class in a folder under src/test/java. I have a testNG suite xml to run the tests. How do I implement extent reports with this structure? I have tried to look online but its confusing. Please tell step by step detailed instructions. Also, do I need to create a Utility folder under src/test/java?
Please help me get started with this! Thus far I have added the extent report dependency version 3.0 in my POM.xml
-
Why not use Allure?demouser123– demouser1232018年05月01日 12:49:03 +00:00Commented May 1, 2018 at 12:49
-
Hello Rohan, have you tried this link? softwaretestingmaterial.com/generate-extent-reportsAalok– Aalok2018年05月01日 22:40:58 +00:00Commented May 1, 2018 at 22:40
2 Answers 2
The below sample script worked for me in creating Extent reports and make changes according to your testcases for rest assured api framework.
//For creating html
ExtentReports extent = new ExtentReports("./report/result.html",false);
//For creating each test
ExtentTest test = extent.startTest("Your testcase name","short description of your testcase");
test.assignCategory("Type of testing");//For example Smoke or sanity or regression
test.assignAuthor("Name of the author");//Author name who created the testcase
//For testcase status along with description
test.log(LogStatus.PASS,"The value entered successfully");
extent.endTest(test);
extent.flush();
If you have testbase in your project you can implement extent report basic methods in that class like below
Then call that method in your test class
Explore related questions
See similar questions with these tags.