On Monday, May 6, 2013 1:35:18 PM UTC-4, Rob Park wrote:On Mon, May 6, 2013 at 12:06 PM, Joe Fleck <joefl...@gmail.com> wrote:
Hi,I am new to cucumber and wondered if there is a way to pass a variable to a feature statement or call a method to get the variable needed.Ex:Feature: Retrieve state forrnAs a customerI want to print a form for this stateIn the feature statement above I want 'state' to be the variable. Â I want this to display in the Feature header output of the test result in Jenkins.JoeFor me, I'm not really sure what you're trying to do yet.Where would the value for state come from?
Hi Rob,Thank you for responding. Â The state variable could come from a yml file or a global variable in Jenkins. ÂWe have several customers who we need to run our scripts against. Â We use the gem that creates a nice html output with the results.I want to see which state was executed in the feature statement in Jenkins.Joe
What would your scenario look like?#rob
#rob
Data Tables are handy for specifying a larger piece of data:
Given the following users exist:
| name | email | phone |
| Aslak | as...@email.com | 123 |
| Matt | ma...@email.com | 234 |
| Joe | j...@email.org | 456 | Scenario: Add two numbers
Given the input "2+2"
When the calculator is run
Then the output should be "4"Â
Scenario Outline: Withdraw fixed amount
Given I have <Balance> in my account
When I choose to withdraw the fixed amount of <Withdrawal>
Then I should receive <Received> cash
And the balance of my account should be <Remaining>
Examples:
| Balance | Withdrawal | Received | Remaining |
| $500 | $50 | $50 | $450 |
Joe--
-- Rules --
Â
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
Â
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Â
Â
I want all of the scripts to run through every state we have not just a few of them.
On Mon, May 6, 2013 at 11:06 AM, Joe Fleck <joefl...@gmail.com> wrote:
Ex:Feature: Retrieve state forrnAs a customerI want to print a form for this state
In the feature statement above I want 'state' to be the variable. Â I want this to display in the Feature header output of the test result in Jenkins.
You can use environment variables:Â https://github.com/cucumber/cucumber/wiki/Environment-Variables
And you can write information to the report with `puts` in your hooks/stepdefs.
puts("Hello") or self.puts("Hello") goes to the report.Kernel.puts("Hello") goes to STDOUT.