Module: Capybara::Simulated::Browser::RecordedActions

Included in:
Capybara::Simulated::Browser
Defined in:
lib/capybara/simulated/browser.rb

Overview

Trace-wrap layer: prepended so the canonical method bodies above stay un-instrumented and a no-trace caller pays only the ‘record_action` early-exit. `super` forwards to the real impl within the `record_action` block, which handles begin/finish step bookkeeping + on-failure DOM snapshot.

Instance Method Summary collapse

Instance Method Details

#click(handle, keys = [], **opts) ⇒ Object



4809
4810
4811
# File 'lib/capybara/simulated/browser.rb', line 4809

def click(handle, keys = [], **opts)
  record_action(:click, -> { "click #{describe_node_handle(handle)}" }) { super }
end

#go_backObject



4803
4804
4805
# File 'lib/capybara/simulated/browser.rb', line 4803

def go_back
  record_action(:go_back, 'go_back') { super }
end

#go_forwardObject



4806
4807
4808
# File 'lib/capybara/simulated/browser.rb', line 4806

def go_forward
  record_action(:go_forward, 'go_forward') { super }
end

#refreshObject



4800
4801
4802
# File 'lib/capybara/simulated/browser.rb', line 4800

def refresh
  record_action(:refresh, 'refresh') { super }
end

#select_option(handle) ⇒ Object



4818
4819
4820
# File 'lib/capybara/simulated/browser.rb', line 4818

def select_option(handle)
  record_action(:select, -> { "select #{describe_node_handle(handle)}" }) { super }
end

#send_keys(handle, keys) ⇒ Object



4815
4816
4817
# File 'lib/capybara/simulated/browser.rb', line 4815

def send_keys(handle, keys)
  record_action(:send_keys, -> { "send_keys #{describe_node_handle(handle)} #{keys.inspect[0, 80]}" }) { super }
end

#set_value_with_events(handle, value) ⇒ Object



4812
4813
4814
# File 'lib/capybara/simulated/browser.rb', line 4812

def set_value_with_events(handle, value)
  record_action(:set, -> { "set #{describe_node_handle(handle)} = #{value.inspect[0, 80]}" }) { super }
end

#submit_form(handle) ⇒ Object



4824
4825
4826
# File 'lib/capybara/simulated/browser.rb', line 4824

def submit_form(handle)
  record_action(:submit, -> { "submit #{describe_node_handle(handle)}" }) { super }
end

#unselect_option(handle) ⇒ Object



4821
4822
4823
# File 'lib/capybara/simulated/browser.rb', line 4821

def unselect_option(handle)
  record_action(:unselect, -> { "unselect #{describe_node_handle(handle)}" }) { super }
end

#visit(url) ⇒ Object



4797
4798
4799
# File 'lib/capybara/simulated/browser.rb', line 4797

def visit(url)
  record_action(:visit, "visit #{url}") { super }
end