Adding webrat.simulate and webrat.automate for using the same step mathers in multiple modes
This commit is contained in:
parent
881d9f388d
commit
0e9f4731bb
@ -11,6 +11,10 @@ module Webrat
|
||||
end
|
||||
end
|
||||
|
||||
def webrat
|
||||
webrat_session
|
||||
end
|
||||
|
||||
def webrat_session
|
||||
@_webrat_session ||= ::Webrat.session_class.new(self)
|
||||
end
|
||||
@ -47,7 +51,9 @@ module Webrat
|
||||
:select_date, :select_time, :select_datetime,
|
||||
:field_by_xpath,
|
||||
:field_with_id,
|
||||
:selenium
|
||||
:selenium,
|
||||
:simulate, :automate
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
@ -208,6 +208,16 @@ module Webrat
|
||||
false
|
||||
end
|
||||
|
||||
def simulate
|
||||
return if Webrat.configuration.mode == :selenium
|
||||
yield
|
||||
end
|
||||
|
||||
def automate
|
||||
return unless Webrat.configuration.mode == :selenium
|
||||
yield
|
||||
end
|
||||
|
||||
def_delegators :current_scope, :fill_in, :fills_in
|
||||
def_delegators :current_scope, :set_hidden_field
|
||||
def_delegators :current_scope, :submit_form
|
||||
|
Loading…
Reference in New Issue
Block a user