module MarsoContext
Public Class Methods
feature(ctx={})
click to toggle source
# File lib/marso/domain/feature/feature_template.rb, line 4 def self.feature(ctx={}) Marso::Feature.new({ :id => "#{id}", :name => "#{name}", :in_order_to => "#{in_order_to}", :as_a => "#{as_a}", :i => "#{i}" }) end
scenario_context(ctx={})
click to toggle source
# File lib/marso/domain/scenario/scenario_template.rb, line 4 def self.scenario_context(ctx={}) Marso::ScenarioContext.new({ :id => "#{id}", :before_run => lambda { |id, ctx| # Enter the code you want to execute before running the scenario. # Uncomment the code below if you want to open a Firefox browser. # ctx[:browser] = Marso.openNewBrowser() }, :get_scenario => lambda { |id, ctx| Marso::Scenario.new({:id => id, :name => "#{name}"}, ctx) .given("#{given}") { # TODO: Enter your code here } .when("#{_when}"){ # TODO: Enter your code here } .then("#{_then}"){ # TODO: Enter your code here } }, :after_run => lambda { |id, ctx| # Enter the code you want to execute after the scenario is done running. # Uncomment the code below if you want to close the Firefox browser. # ctx[:browser].close } }, ctx) end
story(ctx={})
click to toggle source
# File lib/marso/domain/story/story_template.rb, line 4 def self.story(ctx={}) Marso::Story.new({ :id => "#{id}", :name => "#{name}", :in_order_to => "#{in_order_to}", :as_a => "#{as_a}", :i => "#{i}" }, ctx) end