class AePageObjects::SingleWindow::SameWindowLoaderStrategy

Public Instance Methods

document_not_loaded_error_message(query) click to toggle source
# File lib/ae_page_objects/single_window/same_window_loader_strategy.rb, line 14
def document_not_loaded_error_message(query)
  "Current window does not contain document with type in #{query.permitted_types_dump}."
end
load_document_with_condition(condition) click to toggle source
# File lib/ae_page_objects/single_window/same_window_loader_strategy.rb, line 4
def load_document_with_condition(condition)
  document = load_document(condition.document_class)

  if document && condition_matches?(document, condition)
    document
  else
    nil
  end
end

Private Instance Methods

condition_matches?(document, condition) click to toggle source
# File lib/ae_page_objects/single_window/same_window_loader_strategy.rb, line 26
def condition_matches?(document, condition)
  condition.match?(document)
rescue LoadingElementFailed
  false
end
load_document(document_class) click to toggle source
# File lib/ae_page_objects/single_window/same_window_loader_strategy.rb, line 20
def load_document(document_class)
  document_class.new
rescue LoadingPageFailed
  nil
end