AndreXP
2009-Jan-30 12:26 UTC
[rspec-users] Pass a variable from rake to steps file in cucumber
Can anybody tell me how to pass a variable from the rake command to my steps file using cucumber? I have the following in my Rakefile: ## Rakefile Cucumber::Rake::Task.new do |t| profile = ENV[''PROFILE''] || ''default'' browser_type = ENV[''BROWSER''] || ''*chrome'' t.cucumber_opts = "--profile #{profile}" end I would like to have access to the "browser_type" variable in my "Before do" in my_steps.rb file. ## my_steps.rb Before do $browser = Selenium::SeleniumDriver.new($server_host, $server_port, "browser_type", $root_url, $time_out) end Thanks for the help. -- View this message in context: http://www.nabble.com/Pass-a-variable-from-rake-to-steps-file-in-cucumber-tp21746008p21746008.html Sent from the rspec-users mailing list archive at Nabble.com.
aslak hellesoy
2009-Feb-10 20:42 UTC
[rspec-users] Pass a variable from rake to steps file in cucumber
dude. have you lost your memory? didn''t we have this conversation a week ago? http://www.nabble.com/-Cucumber--and-rake-pass-command-line-params-tt21789574.html aslak On Fri, Jan 30, 2009 at 1:26 PM, AndreXP <andre.x.pretorius at gmail.com> wrote:> > Can anybody tell me how to pass a variable from the rake command to my steps > file using cucumber? I have the following in my Rakefile: > > ## Rakefile > Cucumber::Rake::Task.new do |t| > profile = ENV[''PROFILE''] || ''default'' > browser_type = ENV[''BROWSER''] || ''*chrome'' > t.cucumber_opts = "--profile #{profile}" > end > > I would like to have access to the "browser_type" variable in my "Before do" > in my_steps.rb file. > > ## my_steps.rb > Before do > $browser = Selenium::SeleniumDriver.new($server_host, $server_port, > "browser_type", $root_url, $time_out) > end > > Thanks for the help. > -- > View this message in context: http://www.nabble.com/Pass-a-variable-from-rake-to-steps-file-in-cucumber-tp21746008p21746008.html > Sent from the rspec-users mailing list archive at Nabble.com. > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Aslak (::)
David Chelimsky
2009-Feb-10 22:30 UTC
[rspec-users] Pass a variable from rake to steps file in cucumber
On Tue, Feb 10, 2009 at 2:42 PM, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> dude. have you lost your memory? didn''t we have this conversation a week ago? > > http://www.nabble.com/-Cucumber--and-rake-pass-command-line-params-tt21789574.htmlSorry - my fault - was going back through some email that was pending moderation :) Note the date is Jan 30. Cheers, David> > aslak > > On Fri, Jan 30, 2009 at 1:26 PM, AndreXP <andre.x.pretorius at gmail.com> wrote: >> >> Can anybody tell me how to pass a variable from the rake command to my steps >> file using cucumber? I have the following in my Rakefile: >> >> ## Rakefile >> Cucumber::Rake::Task.new do |t| >> profile = ENV[''PROFILE''] || ''default'' >> browser_type = ENV[''BROWSER''] || ''*chrome'' >> t.cucumber_opts = "--profile #{profile}" >> end >> >> I would like to have access to the "browser_type" variable in my "Before do" >> in my_steps.rb file. >> >> ## my_steps.rb >> Before do >> $browser = Selenium::SeleniumDriver.new($server_host, $server_port, >> "browser_type", $root_url, $time_out) >> end >> >> Thanks for the help. >> -- >> View this message in context: http://www.nabble.com/Pass-a-variable-from-rake-to-steps-file-in-cucumber-tp21746008p21746008.html >> Sent from the rspec-users mailing list archive at Nabble.com. >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > > > > -- > Aslak (::) > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
aslak hellesoy
2009-Feb-10 23:58 UTC
[rspec-users] Pass a variable from rake to steps file in cucumber
On Tue, Feb 10, 2009 at 11:30 PM, David Chelimsky <dchelimsky at gmail.com> wrote:> On Tue, Feb 10, 2009 at 2:42 PM, aslak hellesoy > <aslak.hellesoy at gmail.com> wrote: >> dude. have you lost your memory? didn''t we have this conversation a week ago? >> >> http://www.nabble.com/-Cucumber--and-rake-pass-command-line-params-tt21789574.html > > Sorry - my fault - was going back through some email that was pending > moderation :) Note the date is Jan 30. >Haha. Andre, please disregard my comment. Aslak> Cheers, > David > >> >> aslak >> >> On Fri, Jan 30, 2009 at 1:26 PM, AndreXP <andre.x.pretorius at gmail.com> wrote: >>> >>> Can anybody tell me how to pass a variable from the rake command to my steps >>> file using cucumber? I have the following in my Rakefile: >>> >>> ## Rakefile >>> Cucumber::Rake::Task.new do |t| >>> profile = ENV[''PROFILE''] || ''default'' >>> browser_type = ENV[''BROWSER''] || ''*chrome'' >>> t.cucumber_opts = "--profile #{profile}" >>> end >>> >>> I would like to have access to the "browser_type" variable in my "Before do" >>> in my_steps.rb file. >>> >>> ## my_steps.rb >>> Before do >>> $browser = Selenium::SeleniumDriver.new($server_host, $server_port, >>> "browser_type", $root_url, $time_out) >>> end >>> >>> Thanks for the help. >>> -- >>> View this message in context: http://www.nabble.com/Pass-a-variable-from-rake-to-steps-file-in-cucumber-tp21746008p21746008.html >>> Sent from the rspec-users mailing list archive at Nabble.com. >>> >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >> >> >> >> -- >> Aslak (::) >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Aslak (::)