我使用pytest和selenium对一个web应用程序进行e2e测试。一切都很好,但有一件事我花了一整天的时间在网上找不到。
我不能让pytest_selenium_capture_debug工作。我把它放在测试源的根目录下的conftest.py中。测试在docker容器中运行。火狐在xvfb-run上运行。我录制屏幕视频,如果测试失败,我想把它复制到主机上。
我使用的是python 3.6.11,这些库版本是
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发布于 2021-11-28 19:31:47
使用custom_selenium fixture导致的问题。为了使所有的fixture钩子都能正常工作,有必要使用由pytest-selenium定义的selenium pytest-selenium,如下所示。
@pytest.fixture
def logged_in_selenium(selenium):
...https://stackoverflow.com/questions/69245694
复制相似问题