我在 steps 目录下有两个不同的 python 文件: driverlogon.py和 triplogon.py
driverlogon.py定义步骤
@when(u'enter the {driver_id}')
def step_enter_the_driver_id(context,driver_id):
SelectDriver.input_driver(driver_id)
triplogon.py定义步骤
@when(u'enter the configured block number')
def step_enter_the_configured_block_number(context):
ByBlock.enter_block(context.block)
当我运行这个程序时,我收到以下错误消息,
在这种情况下,它们有不同的文本,甚至函数的内容也不同。
为什么会这样,谁能帮我理解这个?提前致谢
Exception AmbiguousStep: @when('enter the configured block number') has already been defined in
existing step @when('enter the {driver_id}') at steps/driverlogon.py:26
Traceback (most recent call last):
File "C:\Program Files (x86)\Python\Lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Program Files (x86)\Python\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files (x86)\Python\Scripts\behave.exe\__main__.py", line 7, in <module>
File "c:\program files (x86)\python\lib\site-packages\behave\__main__.py", line 183, in main
return run_behave(config)
File "c:\program files (x86)\python\lib\site-packages\behave\__main__.py", line 127, in run_behave
failed = runner.run()
File "c:\program files (x86)\python\lib\site-packages\behave\runner.py", line 804, in run
return self.run_with_paths()
File "c:\program files (x86)\python\lib\site-packages\behave\runner.py", line 809, in run_with_paths
self.load_step_definitions()
File "c:\program files (x86)\python\lib\site-packages\behave\runner.py", line 796, in load_step_definitions
load_step_modules(step_paths)
File "c:\program files (x86)\python\lib\site-packages\behave\runner_util.py", line 412, in load_step_modules
exec_file(os.path.join(path, name), step_module_globals)
File "c:\program files (x86)\python\lib\site-packages\behave\runner_util.py", line 386, in exec_file
exec(code, globals_, locals_)
File "steps\triplogon.py", line 23, in <module>
蛊毒传说
波斯汪
沧海一幻觉
千万里不及你
相关分类