簡體   English   中英

Robot Framework中禁用的測試用例

[英]Disabled test case in Robot Framework

我嘗試生成一個日志,該日志包含所有測試套件以及“ -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
    ...

有什么建議么?

您不能同時排除測試並運行它。 一種解決方法是創建一個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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM