python - 运行 Python + Behave 自动化项目并尝试在其他步骤中执行步骤
问题描述
@step(u'Child step')
def login_to_something(context):
context.execute_steps(u'parent step 1')
context.execute_steps(u'parent step 2')
如上所述,它无法执行父步骤 1,它会引发以下错误:-“behave.parser.ParserError: Failed to parse”
解决方案
当 Behave 引擎无法识别或区分步骤中的步骤时,可能是您看到的错误。然后有一些东西可能不是引擎所期望的语义。
我明白了你的意思,是的,介词应该无关紧要,只要一步就足够了。但是在预期的语义中缺少一些东西,所以解析器错误。
def login_to_something(context):
context.execute_steps('''
when write the step 1 here
then write the step 2 here
'''
)
我无法从您在问题陈述中分享的更多信息中获得信息。
推荐阅读
- powershell - 如何一个接一个地运行powershell cmdlet
- javascript - 数组 foreach() 函数
- c# - 如果有效负载包含意外字段,如何返回 BadRequest
- azure-active-directory - 在 Portal.Azure.Com 中注册应用程序需要哪些权限
- java - Java - 尝试同时传递无值和布尔值,但返回 null
- django - 创建具有 3rd 方依赖项的可安装 Django 应用程序
- ios - 如何更改 DrawersKit,使其从开头出现
- vuejs2 - 通过计算属性返回数组对象中的最后一项?
- python - 为什么在 CPython 中 `len(l) != 0` 比 `bool(l)` 快?
- excel - 如何同时使用 IsNumeric 和 Not IsNumeric 函数?