Closed chris-gunawardena closed 7 years ago
Hi, have a look at this example:
The idea is to have one class that handles all the steps related to one screen/unit of functionality/feature, etc. (e.g. https://github.com/vndly/green-coffee-example/blob/master/app/src/androidTest/java/com/mauriciotogneri/greencoffeeexample/test/steps/LoginSteps.java)
Then you use the steps in the class that extends from GreenCoffeeTest (e.g. https://github.com/vndly/green-coffee-example/blob/master/app/src/androidTest/java/com/mauriciotogneri/greencoffeeexample/test/features/LoginFeatureTest.java#L48)
Like that you can include a set of common steps in different features easily.
I hope that solves your problem and let me know otherwise.
Thanks Mauricio, didn't realise start() method can take multiple arguments.
You are welcome! Let me know if you have some ideas or features to improve the library.
We have common steps like "Given I'm logged in" that needs to be shared between tests, what the best way to do this? I already tried extending off a CommonSteps class that extends from GreenCoffeeSteps but it's not inheriting the step definitions.