我希望 Test Setup 和 Test Teardown 关键字在模板化测试的每次执行中运行,但似乎并非如此。这是我的测试套件的简化版本,它演示了我在说什么。我像运行它pybot template-problem.txt
。请注意,生成的日志文件显示 myTest Case Setup
和Test Case Teardown
关键字每个只运行一次。
*** Settings ***
Test Setup Test Case Setup
Test Teardown Test Case Teardown
*** Test Cases ***
Look for All Possible Outputs from the System Under Test
[Template] Look for Specific Output
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
*** Keywords ***
Test Case Setup
Comment Setting up before the test case runs
Test Case Teardown
Comment Cleaning up after the test case finishes
Look For Specific Output
[Arguments] ${output}
Comment Pretending to look for a specific output...
Log ${output}