0
我有這樣的結構在我的項目:錯誤:套房不含測試
Tests
|__ Keywords
|__ Keywords.robot
|__ Libs
|__ Scenarios
|__ UI
|__ TestScen.robot
|__ Variables
|__ Variables.robot
|__ RunTest.py
這是TestScen.robot
:
*** Settings ***
Library Selenium2Library
Resource ../../Variables/Variables.robot
*** Variables ***
*** Keywords ***
Test Login
log to console Test Login
go to ${url}
Input Text id=${uNameId} ${uiUserName}
Input Text id=${passId} ${uiPassword}
Click Element id=${signInId}
log to console YaaaaY!
這是RunTest.py
:
import argparse
from robot import run
import os
import datetime
import sys
def get_args():
parser = argparse.ArgumentParser(description='Robot Test Framework')
parser.add_argument('--file',
metavar='f',
default="Scenarios",
help='get path of root scenario')
parser.add_argument('--testSuite',
metavar='"scenario name"',
default=[],
nargs='*',
help='get names of test suits')
parser.add_argument('--tags',
metavar='tag',
default=[],
nargs='*',
help='get name of tags')
parser.add_argument('--testCases',
metavar='testCases',
default=[],
nargs='*',
help='get name of testCases')
parser.add_argument('--skip',
metavar='skip',
default=["skip"],
nargs='*',
help='get name of skip testCases')
args = parser.parse_args()
return args
if __name__ == "__main__":
dir_name = datetime.datetime.now().strftime('%Y-%m-%d %H-%M-%S')
os.mkdir('Output/' + dir_name)
args = get_args()
run(
args.file,
report='Output/' + dir_name + '/report.html',
log='Output/' + dir_name + '/log.html',
output='Output/' + dir_name + '/output.xml',
include=args.tags,
test=args.testCases,
exclude=args.skip,
critical="Critical",
suite=args.testSuite
)
我跑RunTest.py
這方式:
python RunTest.py --file Scenarios/UI
這是輸出:
[ ERROR ] Suite 'UI' contains no tests.
Try --help for usage information.
問題是什麼?爲什麼框架無法識別我的場景文件?
這真是一個真正愚蠢的錯誤! :-D謝謝指出! – 2015-04-06 11:42:08