Re: [jbehave-user] Unexpected resolving result of the parameter value

2014-03-25 Thread Hans Schwäbli
Hello Mauro,

yes it is logical. But there are cases where it would be easier if the
parameter parsing would be smart enough to interpret homepage_browser
as homepage_firefox for example.

I think it would be more flexible and possibly easy to implement in
JBehave. Inside the parameter value JBehave could examine if there is a
parameter inside it which it needs to resolve from the examples table and
then do it.

So it would be more flexible what one could do with parameters in the
stories.




2014-03-14 21:06 GMT+01:00 Mauro Talevi mauro.tal...@aquilonia.org:

  Parameter values are always identified by surrounding spaces.   That's
 why it interprets the value as homepage_browser.

 Your solutions seems the most logical one.

 On 14/03/2014 15:44, Hans Schwäbli wrote:

  I stumpled upon an issue where I cannot use the parameters as I expected.

 See the example below. The problem line is the one starting with Then.

 Scenario: Create Screenshots
 Given Browser browser is used
 And Login with user Standard
 Then I create a screenshot with name homepage_browser
 Examples:
 |---|
 |browser|
 |---|
 |CHROME |
 |FIREFOX|
 |IE |
 |---|
  I supposed that JBehave will pass hompage_CHROME into the step method.
 But it passes hompage_browser instead.

 In the case above I can solve it in another way, like this:

 Scenario: Create Screenshots
 Given Browser browser is used
 And Login with user Standard
 Then I create a screenshot with name filename
 Examples:
 |---||
 |browser|filename|
 |---||
 |CHROME |homepage_chrome |
 |FIREFOX|homepage_firefox|
 |IE |homepage_ie |
 |---||
  Can I mix hard coded parameter values in the steps together with
 parameters orginating from an examples table? Is this possible somehow?

 I consider this just as nice to have of course, since in most cases it can
 be solved in the above way.





[jbehave-user] Unexpected resolving result of the parameter value

2014-03-14 Thread Hans Schwäbli
I stumpled upon an issue where I cannot use the parameters as I expected.

See the example below. The problem line is the one starting with Then.

Scenario: Create Screenshots
Given Browser browser is used
And Login with user Standard
Then I create a screenshot with name homepage_browser
Examples:
|---|
|browser|
|---|
|CHROME |
|FIREFOX|
|IE |
|---|
I supposed that JBehave will pass hompage_CHROME into the step method.
But it passes hompage_browser instead.

In the case above I can solve it in another way, like this:

Scenario: Create Screenshots
Given Browser browser is used
And Login with user Standard
Then I create a screenshot with name filename
Examples:
|---||
|browser|filename|
|---||
|CHROME |homepage_chrome |
|FIREFOX|homepage_firefox|
|IE |homepage_ie |
|---||
Can I mix hard coded parameter values in the steps together with parameters
orginating from an examples table? Is this possible somehow?

I consider this just as nice to have of course, since in most cases it can
be solved in the above way.