I want to write a customized HTML report for my sanity test automation. So, this is what I have in my mind:
- Create a Singleton Class (Jon Skeet's version of a thread safe Singleton with fully lazy instantiation in C#)
- Create a method to create a HTML file inside the constructor (So the HTML file is created only once when the single constructor is called)
- Through out my code, I can call the HTML write() or append() method to write data into my HTML file
Do you see any problem with my logic? If it is so naive and a bad practice, can you please point me to some examples that write HTML reports in C# so I can adapt it in my project?
Thank you!
EDIT
So, when i say custom reporting this is what I am thinking...
A MasterIndex.HTML - that will have a list of all scenarios I have run. Each of the item in this list are clickable. Multiple detailed HTML reports - When I click on each of the items/scenarios on my MasterIndex file, it will take me to another html with the steps I have done to execute that test scenario with Pass/Fail.