I have a few features which test resources which needs to login. Every feature has its own steps class with concrete steps. But each of this features needs to make login, so I tried to make baseSteps which contains
public void login()
new HomepagePage().login(conf.getString("login.email"), conf.getString("login.password"));
But as I see Cucumber does not allow inheritance of classes with steps and hooks.
It throws me an error: Unable to start Cucumber io.cucumber.java.InvalidMethodException: You're not allowed to extend classes that define Step Definitions or hooks. class steps.admin.CreateEditArticleSteps extends class steps.BaseSteps
What is the best practice to achieve this logic? I dont want to have login method in every steps class.