机器人框架中禁用的测试用例

时间:2016-01-28 12:12:17

标签: python robotframework

我尝试生成一个日志,我希望包含所有测试套件以及“-e --exclude tag”禁用的测试用例数。我遇到的问题是禁用的测试不会运行,也不会生成可用于解决此问题的日志。

实施例

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
    ...

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

您不能同时排除测试并运行它。解决方法可能是创建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
相关问题