美文网首页
Behave之Environment.py文件

Behave之Environment.py文件

作者: robotframe | 来源:发表于2020-06-16 19:37 被阅读0次

在behavior中,除了feature,step文件夹,还可以创建一些其他文件,如environment.py.

environment.py模块可以定义测试过程中在执行前和执行后的行为步骤。

before_step(context,step),after_step(context,step)

before_scenario(context,scenario),after_scenario(context,scenario)

before_feature(context,feature),after_feature(context,feature)

before_tag(context,tag),after_tag(context,tag)

before_all(context),after_all(context)

****

为了解决AttributeError: 'Context' object has no attribute 'browser'.的问题,我在项目路径下创建了一个environment.py文件,如下:

to resolve the errorAttributeError: 'Context' object has no attribute 'browser'.

https://stackoverflow.com/questions/41846466/attributeerror-context-object-has-no-attribute-browser

相关文章

网友评论

      本文标题:Behave之Environment.py文件

      本文链接:https://www.haomeiwen.com/subject/btarxktx.html