【问题标题】:Display text on screen that matches @allure.title('...') text for display during video recording of pytesting在屏幕上显示与 @allure.title('...') 文本匹配的文本,以便在 pytesting 的视频录制期间显示
【发布时间】:2020-11-16 23:45:59
【问题描述】:

我们正在使用 pytest 和 Allure 来测试我们的软件,结果非常好。我们设置的一部分是 GUI 测试的视频录制。在屏幕上显示当前正在运行的测试的文本将非常有用。有谁知道是否有办法将 @allure.title('...') 显示为窗口上的标题栏?

【问题讨论】:

    标签: python windows pytest allure


    【解决方案1】:

    您可以通过document.title 命令使用WebDriver execute_script 方法。

    def test_some_case():
        case_title = 'Some Title'
        allure.dynamic.title(case_title)
        driver.execute_script('document.title = arguments[0];', case_title)
    
        some_checks()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-31
      相关资源
      最近更新 更多