【问题标题】:Detect if selenium test run in Bitbucket Pipeline检测硒测试是否在 Bitbucket 管道中运行
【发布时间】:2020-06-15 13:12:51
【问题描述】:

我想知道是否可以这样做:

if( "#in bitbucket pipeline" ):

        options = Options()
        options.headless = True
        cls.selenium = WebDriver(options=options)

else:
        cls.selenium = WebDriver()

仅仅是因为我需要在 bitbucket 上以 headless 模式运行我的测试,而不是 localy..

Python 3.6

django 3

【问题讨论】:

  • 查看建议的解决方案here

标签: python selenium webdriver bitbucket-pipelines xvfb


【解决方案1】:

我能够通过一种检查测试是否在 docker 容器中运行的方法来克服它

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-06-06
    • 1970-01-01
    • 2017-05-03
    • 1970-01-01
    • 2021-01-01
    • 2010-12-26
    • 2015-05-24
    • 2020-07-23
    相关资源
    最近更新 更多