In pytest, how can I figure out if a test failed? (from “request”)

前端 未结 2 1619
遥遥无期
遥遥无期 2021-02-13 10:16

I\'m using Selenium with PYTEST to test a site. I would like to take a screenshot of the page whenever a test fails (and only when it fails).

Is there a way that I can

2条回答
  •  渐次进展
    2021-02-13 10:42

    It can be done, not directly though. I just added added an example to the docs. It probably makes sense to makes this easier by default, i.e. without requiring the use of a conftest.py hook. If you agree, please file an issue.

提交回复
热议问题