【问题标题】:Disabled test case in Robot FrameworkRobot Framework 中禁用的测试用例
【发布时间】:2016-05-05 19:25:54
【问题描述】:

我尝试生成一个我想要包含所有测试套件和被“-e --exclude 标记”禁用的测试用例数量的日志。我面临的问题是禁用的测试无法运行并且不会生成可用于解决此问题的日志。

例子

TestSuite.txt

*** Test Cases ***

Test 1
    [Tags]  disabled
    Keyword_1
    Keyword_2
    ...

Test 2
    Keyword_1
    Keyword_2
    ...

Test 3
    [Tags]  disabled
    Keyword_1
    Keyword_2
    ...

有什么建议吗?

【问题讨论】:

    标签: python robotframework


    【解决方案1】:

    您不能既排除测试又运行它。一种解决方法可能是创建一个 skiptest 关键字以将标记设置为禁用并通过执行。这会将测试计为通过,但会在标签中显示禁用案例的数量。

    *** Keywords ***
    Skiptest
        Set Tags          disabled
        Pass Execution    This test is disabled
    
    *** Test Cases ***
    Normal Test
        [tags]    normal
        Should Be Equal    1      1
    
    Disabled Test
        Skiptest
        Should Be Equal    1      2
    

    【讨论】:

      猜你喜欢
      • 2020-07-12
      • 1970-01-01
      • 2016-01-13
      • 2014-02-27
      • 2022-08-20
      • 2018-12-14
      • 2017-08-08
      • 1970-01-01
      • 2014-06-18
      相关资源
      最近更新 更多