Method: AppMap::RSpec::Recording#initialize

Defined in:
lib/appmap/rspec.rb

#initialize(example) ⇒ Recording



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/appmap/rspec.rb', line 124

def initialize(example)
  super

  webdriver_port = lambda do
    return unless defined?(page) && page&.driver

    # This is the ugliest thing ever but I don't want to lose it.
    # All the WebDriver calls are getting app-mapped and it's really unclear
    # what they are.
    page.driver.options[:http_client].instance_variable_get('@server_url').port
  end

  warn "Starting recording of example #{example}" if AppMap::RSpec::LOG
  @trace = AppMap.tracing.trace
  @webdriver_port = webdriver_port.()
end