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



3560
3561
3562
# File 'lib/capybara/simulated/browser.rb', line 3560

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

#go_backObject



3554
3555
3556
# File 'lib/capybara/simulated/browser.rb', line 3554

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

#go_forwardObject



3557
3558
3559
# File 'lib/capybara/simulated/browser.rb', line 3557

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

#refreshObject



3551
3552
3553
# File 'lib/capybara/simulated/browser.rb', line 3551

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

#select_option(handle) ⇒ Object



3569
3570
3571
# File 'lib/capybara/simulated/browser.rb', line 3569

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

#send_keys(handle, keys) ⇒ Object



3566
3567
3568
# File 'lib/capybara/simulated/browser.rb', line 3566

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



3563
3564
3565
# File 'lib/capybara/simulated/browser.rb', line 3563

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



3575
3576
3577
# File 'lib/capybara/simulated/browser.rb', line 3575

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

#unselect_option(handle) ⇒ Object



3572
3573
3574
# File 'lib/capybara/simulated/browser.rb', line 3572

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

#visit(url) ⇒ Object



3548
3549
3550
# File 'lib/capybara/simulated/browser.rb', line 3548

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