How to make definition definitions of cucumbers in accordance with the function executable file

I would like to change the cucumber so that when I execute this function (for example, "login.feature"), I want only login_steps.rb to be loaded for web steps. Other step files should not load.

IMO, it would be very useful to have the same steps, but which differ in implementation, respectively, on behalf of the function that is being executed.

Since I have almost a hundred scenarios, and I would prefer the steps to be high-level, that would make sense.

Any ideas?

+3
source share
3 answers

( ) , env.rb step_definitions.

. .

+1

, - , Cellophane gem. , . , , , , , , .

+1

,

.feature file

Scenario: Some description of the scenario
Given [some context]
When [some event]
Then [outcome]

.rb( )

Given /^[some context]$/ do
// code module
// code module
end
  • , [some context] .

,

Given [some context]
When [some context]
Then [some context]
And [some context]

. i. , When, Then And .


Alternatively, you can read the behad document for a better understanding - http://behat.readthedocs.org/
0
source

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


All Articles