Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to provide enum options as part of step completion? #15

Open
benheap opened this issue Apr 22, 2014 · 1 comment
Open

Comments

@benheap
Copy link

benheap commented Apr 22, 2014

Hi

We've been using this plugin for a little while now and found it vastly superior to both earlier plugins for jbehave on intellij and also eclipse.

However I was wondering firstly whether the following improvement is technically possible and if so the secondly whether it would be implemented?

We generally write a steps in the following way:

@when("Toolbar bold button is clicked")
@then("Toolbar bold button is enabled")
@then("Toolbar bold button is visible")

However for a toolbar that has say 30 buttons on it this means replicating these three steps 30 times over which results in 90 steps. This is not great for code duplication.

So we currently use the approach of:

@when("Toolbar $buttonname button is clicked")
@then("Toolbar $buttonname button is enabled")
@then("Toolbar $buttonname button is visible")

and then use a map (if we're passing button name as a string) or an switch statement (if we are passing an enum) in a page object method to carry out a common method on whichever button locator has been specified.

However this makes story writing somewhat harder as when those steps are used the author of the story needs to know what string or enum value to set and thus usually has to inspect the code to find what they need.

What would be ideal would be the ability to provide in the plugin during step completion a list of parameter options (e..g. Bold, Italic, Underline) that a story author can select for this step.

Is this feasible? Would it require changes to JBehave itself or merely the plugin if so?

many thanks

Ben

@harley84
Copy link
Collaborator

Good idea, hopefully I or someone else will sometime have time to look into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants