Story should not have repeated steps.
class Action(Story):
I.a1s1
I.a1s2
I.a1s1 # error
Is it good idea? If i need to repeat step more than once? I need to implement the same step several times?
Hello, thanks for reaching out!
Service objects are intended to be some kind of a pipeline. These pipelines correspond to business processes in real life.
Duplication in story steps means it's a duplication in the business process definition. Which in most cases looks like a general design error.
That's why these rule is here.
On the other hand, if you need to apply same logic to different parts of data - extract that logic from story step definition.
For example, extract User entity class and wrap with it as many different users inside story state as you need.
Hope that make sense.
Have a good day :cocktail: :palm_tree:
Best regards, Artem.