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



4217
4218
4219
# File 'lib/capybara/simulated/browser.rb', line 4217

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

#go_backObject



4211
4212
4213
# File 'lib/capybara/simulated/browser.rb', line 4211

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

#go_forwardObject



4214
4215
4216
# File 'lib/capybara/simulated/browser.rb', line 4214

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

#refreshObject



4208
4209
4210
# File 'lib/capybara/simulated/browser.rb', line 4208

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

#select_option(handle) ⇒ Object



4226
4227
4228
# File 'lib/capybara/simulated/browser.rb', line 4226

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

#send_keys(handle, keys) ⇒ Object



4223
4224
4225
# File 'lib/capybara/simulated/browser.rb', line 4223

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



4220
4221
4222
# File 'lib/capybara/simulated/browser.rb', line 4220

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



4232
4233
4234
# File 'lib/capybara/simulated/browser.rb', line 4232

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

#unselect_option(handle) ⇒ Object



4229
4230
4231
# File 'lib/capybara/simulated/browser.rb', line 4229

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

#visit(url) ⇒ Object



4205
4206
4207
# File 'lib/capybara/simulated/browser.rb', line 4205

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