What is the best way to organize function files?

I am a big fan of Specflow and BDD. This is perfect for me in a variety of projects.

One of the tasks that I have not yet decided is to organize my function files and scripts in such a way as to simplify navigation and research. Imagine that after a year someone else wants to come and find out about the system. When to start? Most importantly, what's less important? Any relationship between functions? Does the system describe a specific scenario? Did the author think about this problem?

Can anyone share some methods, reading or tools that focus on this?

+8
source share
3 answers

, , .

, , . , , , .

, ( CucumberJS ):

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         

, , , . , , , , . , , .

. , .

+9

, : /, , , API , , .

Robot Framework Cucumber.

0

, , , , . .

.

( ""):

Cucumber, .story .feature. , .

- . , , , .

. , , , , , . , , .

, -, , .

( ), . ? . , . SauceLabs:

, , , . , .

, , , , . , .

, ,

If you have the Delete action in the user interface, Delete in the test and Archive in the production code, it may be difficult for developers or business people to find the scripts associated with this action. It might be easier to find a script if the test always follows the user interface (if the middle team member using the BDD tool is more familiar with the user interface than with the source code).

0
source

Source: https://habr.com/ru/post/1674068/


All Articles