Alexander,

you have the option to use hierarchy, declaring in the runner a concrete step class that inherits from an abstract class. But before use it, I prefer to use steps composition, I mean, to create lots of specifics business step classes and use them when needed. for example: loginSteps(that could be reused in GivenScenarios), buyingSteps, sailingSteps, docManagementSteps, adminstrativeSteps)...

Normally a business step will need one or more specific pages to help the user to accomplish his goal....

And each of this businessStep classes could inherits from an abstract class that has specific selenium methods...

regards,

Cristiano



On 23/02/12 14:01, Alex Lehmann wrote:
I have come across a problem, I wonder how anybody else handles this or has a solution (maybe I'm missing something obvious, I have somewhat limited Java experience):

When writing selenium tests, I can create a AbstractPage class and a concrete class for each suite of test cases to keep the duplication to a minimum, e.g. each test suite probably has to fill in a login form, check a title etc, which uses methods from the AbstractPage class. However, for the Steps classes, I have to write a new class for each test suite, which means that it is not possible to reuse step methods that a similar in different tests, since the annotations have to match and cannot be in a abstract class I guess. Is it possible to move step methods to a common class and still use the different instances of a Page class or is it possible to use an abstract class for steps classes?


bye, Alexander



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to