Generating and viewing reports with Playwright

 

Generating and viewing reports with Playwright

When working with test automation we need ways to see the outputs of our test. This blog post looks at some of the ways we can see the outputs of playwright test. Some of these are not that useful but good to know when debugging your test.


The first command is --reporter=line, this command will just show how many test were passed or failed.




The second command is --reporter=list which will list out the how many of each test were run





The next command is --reporter=dot which will show dots in green or red for each executed test.  This is not that useful but can be used if you are not interested in detail.




Next, we can use the parameter junit to generate xml output that we can then pass through some tool to view the results




The final and the most useful type of report is the use of html parameter. This command will generate an html report. This will auto generate an html page within your test framework. We can then view the results using the command npx playwright show-report 





Comments