lib/site_prism/loadable.rb
# Executes the given block after the page is loaded.
#
# The loadable object instance is yielded into the block.
Executes the given block after the page is loaded.
The loadable object instance is yielded into the block.
Executes the given block after the page is loaded . The loadable object instance is yielded into the block .
def when_loaded
      previously_loaded = loaded
      self.loaded = loaded?
      raise SitePrism::FailedLoadValidationError, load_error unless loaded
      yield self if block_given?
    ensure
      self.loaded = previously_loaded
    end
def when_loaded previously_loaded = loaded self . loaded = loaded? raise SitePrism :: FailedLoadValidationError , load_error unless loaded yield self if block_given? ensure self . loaded = previously_loaded end
Executes the given block after the page is loaded.
Executes the given block after the page is loaded .
# Get original loaded value, in case we are nested # inside another when_loaded block. # Within the block, check (and cache) loaded?, to see whether the # page has indeed loaded according to the rules defined by the user. # If the page hasn't loaded. Then crash and return the error message. # If one isn't defined, just return the Error code. # Return the yield value of the block if one was supplied.