简体   繁体   English

Python-Behave,在mutliple子目录中运行功能

[英]Python-Behave, running features in mutliple subdirectories

How can I run behave tests with this kind of file structure: 如何使用这种文件结构运行行为测试:

+-- features/
     +-- user_page/
     |     +-- user_crud.feature   
     |     +-- user_search.feature 
     +-- customer_page/
     |     +-- customer_crud.feature
     |     +-- customer_search.feature
+-- steps/
     +-- user_page/
     |     +-- user_crud.py
     |     +-- user_search.py
     +-- customer_page/
     |     +-- customer_crud.py
     |     +-- customer_search.py

I want to be able to organize features and steps in its proper page. 我希望能够在其正确的页面中组织功能和步骤。 Currently I can run a test 1 folder at a time with steps not having any sub folders. 目前,我可以一次运行测试1文件夹,步骤没有任何子文件夹。

example: 例:

behave /features/user_page/customer_search.feature

According to the document of Behave, it seems you have to put your step definition in the steps folder directly unless you wanna touch some of the source code. 根据Behave的文档,您似乎必须直接将步骤定义放在steps文件夹中,除非您想要触摸某些源代码。

In order to organize features and steps , I would recommend you use tags. 为了organize features and steps ,我建议您使用标签。 Or if you mean you want to get better result by organize features and steps , you could try the Junit or JSON formatters 或者,如果您希望通过organize features and stepsget better result ,则可以尝试使用Junit或JSON格式化程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM