Class: SPV::Element

Inherits:
SimpleDelegator
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/site_prism_vcr/element.rb

Overview

Extends a native Capybara element with new methods.

Instance Method Summary collapse

Constructor Details

#initialize(element, parent, &block) ⇒ Element

Returns a new instance of Element.



11
12
13
14
15
# File 'lib/site_prism_vcr/element.rb', line 11

def initialize(element, parent, &block)
  super element

  @applier = Applier.new(parent, &block)
end

Instance Method Details

#click_and_apply_vcr(&block) ⇒ Object



17
18
19
# File 'lib/site_prism_vcr/element.rb', line 17

def click_and_apply_vcr(&block)
  shift_event { click }.apply_vcr(&block)
end