As per my understanding, a single step definition file methods can be reused by steps with the same name in other feature files.
then, what is the purpose of splitting a single cucumber Step Definition file into multiple step files?
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.
Sign up to join this communitySame reason why you would split large modules in your regular code base: maintainability & navigability.
Over time as your step definitions grow you will have steps that are closely related to certain parts or functionalities of your system, but not related to other steps in the step definitions. Once the file becomes large enough it will become harder to maintain and find the steps you are looking for. That's a great indicator that you should starting splitting up in multiple step definition files. For small projects, you may never reach this size.
To cope with the complexity and ease of maintenance.
Once we reach a size where it becomes difficult to maintain a single step definition file, then we split generally based on per page object however as we need to maintain state, we need to create global objects like webdriver and page objects and share the reference of the objects between files.