组织功能文件的最佳方法是什么? [英] What's the best way to organize feature files?

查看:78
本文介绍了组织功能文件的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尚未解决的一个挑战是以某种方式组织我的特征文件和场景,这使得在Specflow和BDD中轻松导航和探索.

One challenge I haven't solved yet is organizing my feature files and scenarios in a way, which makes it easy to navigate and explore in Specflow and BDD.

想象一下,一年后,其他人想一起来学习该系统.从哪儿开始?什么最重要,什么不那么重要?功能之间有关系吗?系统是否处理特定的情况?作者考虑过这个问题吗?

Imagine one year later someone else wants to come along and learn about the system. Where to start? What's most important, what's less important? Any relations between features? Does the system handle a particular scenario? Has the author thought about this problem?

任何人都可以分享一些侧重于此的技术,阅读或工具吗?

Can anyone share some techniques, reads or tools, which focus on that?

推荐答案

这个问题确实与个人喜好有关,但是我的答案是如何使我的目录更易于理解.

This question really is about personal preference, but my answer is how I make my directories easier to understand.

在我从事的项目中,我不得不考虑很多类似的问题.我知道稍后,其他人将浏览黄瓜目录以添加更多内容或进行各种错误修复.

With the projects that I've been working on, I've had to think about problems like this quite a bit. I know that later down the line, other people will look through the cucumber directories to add more or do various pieces of bug fixing.

通常来说,我们采用了这种方法(我将以CucumberJS结构为例):

Generally speaking, we have taken this approach (I'll use our CucumberJS structure as an example):

project
|   features
|   |   elements
|   |   |   pages
|   |   |   |   home.js
|   |   |   |   index.js // grab all of the things in the pages directory
|   |   |   |   search.js
|   |   |   index.js // grab everything in elements directory and the index of pages
|   |   |   urls.js
|   |   |   test_customers.js
|   |   feature_files
|   |   |   home
|   |   |   |   homepage_links.feature
|   |   |   |   homepage_accessibility.feature
|   |   |   |   homepage_check_welsh_translation.feature
|   |   |   search
|   |   |   |   search.feature
|   |   |   |   search_security.feature
|   |   step_definitions
|   |   |   common // Won't go into this, but we have a library of reusable steps and functions in here for different projects that we can just port over from git
|   |   |   project
|   |   |   |   pages
|   |   |   |   |   search
|   |   |   |   |   |   search_steps.js
|   |   |   |   |   |   search_security_steps.js
|   |   |   |   |   home
|   |   |   |   |   |   home_steps.js
|   |   |   |   |   |   home_accessibility_steps.js
|   |   |   |   navigation_steps.js
|   |   |   |   login_steps.js
|   |   support
|   |   |   env.js // Timeouts
|   |   |   hooks.js // Setup/Teardown for scenarios
|   |   |   world.js // Setting up the drivers
|   reports
|   |   2017
|   |   |   03
|   |   |   |   05
|   |   |   |   |   report.html
|   |   |   |   |   report.js
|   |   |   |   06
|   |   |   |   |   report.html
|   |   |   |   |   report.js
|   |   |   |   07
|   |   |   |   |   report.html
|   |   |   |   |   report.js
|   |   report.json
|   screenshots
|   |   failed
|   |   |   2017-03-05
|   |   |   |   search_security_xss_204057.png
|   |   |   2017-03-06
|   |   |   |   search_security_xss_100532.png
|   |   |   |   search_security_xss_101054.png
|   |   |   |   search_security_xss_101615.png
|   |   search_security
|   |   |   2017-03-06
|   |   |   |   search_security_xss_100528.png
|   |   |   |   search_security_xss_101050.png
|   |   |   |   search_security_xss_101611.png
|   |   |   |   search_security_xss_101841.png
|   .gitignore
|   README.md         

假设您是一个项目的新手,所以您想了解已编写了哪些方案. 您知道它是功能集的一部分,因此您沿该路线走,您正在寻找功能文件,因此沿该路线走.您对如何测试搜索功能的安全性感兴趣,因此您可以在那里找到文件.

Say you're new to a project, so you want to find out what scenarios have been written. You know it's part of the feature set, so you go down that route, you're looking for the feature file, so you go down that route. You're interested in how the security has been tested for the search feature, so you go into there and locate the file.

在我们其余的文件夹结构中,这是相同的理论.一切都与您期望的一样.

It's the same theory throughout the rest of our folder structure. Everything is exactly where you'd expect it to be.

这篇关于组织功能文件的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆