Module: SpecTest::Enclosers

Defined in:
lib/spectest/enclosers.rb

Instance Method Summary collapse

Instance Method Details

#is_enclosed_by(identifier, encloser = nil, &block) ⇒ Object

Used to identify a web object as existing within an enclosing object like a frame or an iframe. There is a duplicate method in spectest.rb. This method needs to be here so that page objects can declare web objects to be in an enclosed context.

Parameters:

  • identifier (String)

    how an encloser will be referred to

  • encloser (defaults to: nil)

    a parent encloser that is passed from a previous call

  • block (optional)

    that contains calls to web objects within the encloser



12
13
14
15
16
# File 'lib/spectest/enclosers.rb', line 12

def is_enclosed_by(identifier, encloser=nil, &block)
  encloser = [] if encloser.nil?
  encloser << identifier
  block.call(encloser)
end