In this blog, we are going to learn how we can Generate
Protractor Beautiful Report in our Protractor Test Automation Framework.
Before Moving Further, let’s first understand the
feature of this report.
- Browser's Logs
(only for Chrome)
- Stack Trace
(with suspected line highlight)
- Screenshot
- Screenshot
only on failed spec
- Search
- Filters (can
display only Passed/Failed/Pending/Has Browser Logs)
- Inline
Screenshots
- Details
(Browser/Session ID/OS)
- Duration time
for test cases (only Jasmine2)
To Know More about the report please visit there official Page.
Below Steps we need to follow to achieve this task:
1) In
command Prompt, Type npm i protractor-beautiful-reporter
This will install beautiful reporter in package.json file
2) After Installation inside our config.js or runner file we need to pass a directory path as a parameter when creating a new instance of the screenshot reporter:
3) Now
inside Onprepare function add below code
4) Final
Code would look something like below:
5) Now
when we execute our runner file We Could be able to See Report generated in
Report/screenshots folder.
Hi Ankur,
ReplyIts really good to see the report, but I have one question how can we log our custom message like actual vs expected(how we use to log in extent report). I know actual vs expected message will be displayed to failed case in protractor but I want to log for pass case also and I want to include step description too. Can you please help on my query