首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >pytest_selenium_capture_debug -selenium:测试失败时不会触发pytest挂钩

pytest_selenium_capture_debug -selenium:测试失败时不会触发pytest挂钩
EN

Stack Overflow用户
提问于 2021-09-19 17:43:22
回答 1查看 33关注 0票数 1

我使用pytest和selenium对一个web应用程序进行e2e测试。一切都很好,但有一件事我花了一整天的时间在网上找不到。

我不能让pytest_selenium_capture_debug工作。我把它放在测试源的根目录下的conftest.py中。测试在docker容器中运行。火狐在xvfb-run上运行。我录制屏幕视频,如果测试失败,我想把它复制到主机上。

我使用的是python 3.6.11,这些库版本是

代码语言:javascript
复制
pytest==6.2.4
pytest-base-url==1.4.2
pytest-helpers-namespace==2021.4.29
pytest-html==3.1.1
pytest-lazy-fixture==0.6.3
pytest-metadata==1.11.0
pytest-repeat==0.9.1
pytest-selenium==2.0.1
pytest-variables==1.9.0
selenium==3.141.0
EN

回答 1

Stack Overflow用户

发布于 2021-11-28 19:31:47

使用custom_selenium fixture导致的问题。为了使所有的fixture钩子都能正常工作,有必要使用由pytest-selenium定义的selenium pytest-selenium,如下所示。

代码语言:javascript
复制
@pytest.fixture
def logged_in_selenium(selenium):
    ...
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69245694

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档