I an using Selenium with Pytest to automate tests in the company I work for (as a Jr Automation QA) and I can generate a HTML report if I run the tests with the code "pytest --html=report.html" but I can only see the logs for the failed tests and I would like to, somehow, being able to implement logging for every step of every test in a way where they are readable in the report and a non-technical employee can understand what has been performed and what has failed. I uderstand this is possible with logging but for some reason I cannot make it work.
Could anyone explain how to achieve this?
As I understand it, Selenium does not come with a standard html reporter, so whatever reporting solution you are currently using is probably a third-party tool or plugin. In that case you will need to find out what html reporting tool you are using, and how the logging works for that tool.
As an example, one popular html reporting solution for selenium is Extent Report, which requires a log status parameter when logging (such as PASS, FAIL, SKIP, and INFO). More on Extent test here: https://www.browserstack.com/guide/extent-reports-in-selenium.
Finally, ensure that you're not trying to log your extra steps using generic log statements (such as console.log). Since you mentioned that failed test steps are already logged in your html report, you will want to find out which conditional statements or handlers are triggering those logs. Once you've located them, you should be able to find the syntax & expressions for logging elsewhere using your html reporter.
Hope that helps.