module Crabfarm::RSpec::NavigatorSpecHelpers

Public Instance Methods

browser(_session_id=nil) click to toggle source
# File lib/crabfarm/rspec/navigator_spec_helpers.rb, line 39
def browser(_session_id=nil)
  ensure_context_for :browser
  @navigator_context.pool.driver _session_id
end
last_state() click to toggle source
# File lib/crabfarm/rspec/navigator_spec_helpers.rb, line 29
def last_state
  @last_state
end
navigate(_name=nil, _params={}) click to toggle source
spy_reducer(_name_or_class) click to toggle source
# File lib/crabfarm/rspec/navigator_spec_helpers.rb, line 33
def spy_reducer(_name_or_class)
  ensure_context_for :spy_reducer
  reducer_class = Utils::Resolve.reducer_class _name_or_class
  spy_manager.new_spy_for reducer_class
end
state() click to toggle source
# File lib/crabfarm/rspec/navigator_spec_helpers.rb, line 25
def state
  @navigator_state || navigate(@navigator_params)
end

Private Instance Methods

ensure_context_for(_name) click to toggle source
# File lib/crabfarm/rspec/navigator_spec_helpers.rb, line 50
def ensure_context_for(_name)
  raise "'#{_name}' is only available in navigator specs." if @navigator_context.nil?
end
spy_manager() click to toggle source
# File lib/crabfarm/rspec/navigator_spec_helpers.rb, line 46
def spy_manager
  @navigator_spy_manager ||= ReducerSpyManager.new
end