运行Python 行为自动化项目,并试图在另一个步骤内执行步骤


@step(u'Child step')
def login_to_something(context):
    context.execute_steps(u'parent step 1')
    context.execute_steps(u'parent step 2') 

它无法如上所述的父步骤1 execute_steps,并且会引发以下错误: - " Behave.Parser.ParserError:无法解析"

当发动机无法识别或区分步骤内的步骤时,可能是您看到的错误。然后,发动机可能没有某种语义。

我明白了你的意思,是的,介词不重要,只有步骤就足够了。.但是预期的语义中缺少一些东西,因此解析器错误。

 def login_to_something(context):
    context.execute_steps('''
        when write the step 1 here
        then write the step 2 here
    '''
    )

我无法从您在问题语句中共享的更多信息中获取。

检查功能文件的凹痕。我们还多次面对这个问题。

最新更新