Set tags on test case sets in RF

1. Sometimes when we execute test cases, we only want to execute the test cases under part of the test case set. At this time, we can set the label in the corresponding test case set, and then select the label to execute the corresponding test case at runtime.

grammar:

*** Settings ***
Force Tags  tagname

2. Examples
*** Settings ***
Library  api.checkin
Variables config / cfg.py Force Tags old #Set
 the label of the test case set, which means that each test case below the use case set has this label

*** Test Cases ***

In-patient check - in check - missing field
    compareResult  ${checkin_path_old_2}  201  4.0a

In-patient outpatient reference check - excess field
    compareResult  ${checkin_path_old_1}  201  4.0a

In-patient outpatient reference check - empty field
    compareResult  ${checkin_path_old_4}  201  4.0a

In-patient outpatient reference check -in field format error
    compareResult  ${checkin_path_old_3}  201  4.0a

In-patient outpatient check -in- field length is too long
    compareResult  ${checkin_path_old_5}  201  4.0a

In-patient outpatient reference verification - business value
    compareResult  ${checkin_path_old_6}  201  4.0a

In-patient outpatient reference check - incomplete XML
    compareResult  ${checkin_path_old_error}  201  4.0a

In-patient check - in check - normal XML
    compareResult  ${checkin_path_old_0}  201  4.0a

Run from the command line:

C:\Users\cale\checkapi>robot --pythonpath ./ --include old test
==============================================================================
Test
==============================================================================
Test.Checkin Opt Old
================================================== ============================ 
Outpatient Clinic Entry Check -Missing Fields | PASS |
-------------------------------------------------- ---------------------------- 
In-patient outpatient reference check -excess field | PASS |
-------------------------------------------------- ---------------------------- 
In-patient outpatient reference check -empty field | PASS |
-------------------------------------------------- ---------------------------- 
In-patient outpatient reference check -in field format error | PASS |
-------------------------------------------------- ---------------------------- 
In-patient outpatient check -in-field length is too long | PASS |
-------------------------------------------------- ---------------------------- 
In-patient outpatient reference check -service value | PASS |
-------------------------------------------------- ---------------------------- 
In-patient outpatient reference check -incomplete XML | PASS |
-------------------------------------------------- ---------------------------- 
In-patient outpatient reference verification -normal XML | PASS |
------------------------------------------------------------------------------
Test.Checkin Opt Old                                                  | PASS |
8 critical tests, 8 passed, 0 failed
8 tests total, 8 passed, 0 failed
==============================================================================
Test                                                                  | PASS |
8 critical tests, 8 passed, 0 failed
8 tests total, 8 passed, 0 failed
==============================================================================
Output:  C:\Users\cale\checkapi\output.xml
Log:     C:\Users\cale\checkapi\log.html
Report:  C:\Users\cale\checkapi\report.html

 The complete label setting scenario reference: https://www.cnblogs.com/peipei-Study/archive/2019/12/24/12084382.html

Guess you like

Origin www.cnblogs.com/pipile/p/12720962.html