Skip to content

Commit

Permalink
Allow missing elements to be inspected
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Connor committed Sep 14, 2016
1 parent 013d705 commit 89a55e4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/ae_page_objects/element_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ def method_missing(name, *args, &block)
end

implicit_element.__send__(name, *args, &block)
rescue AePageObjects::LoadingElementFailed
raise unless %w(to_s inspect).include? name.to_sym

# The element is being serialized for debug / warning purposes. In
# this situation it is a valid case that the element may not exist so
# instead of raising an error just return a string indicating that the
# element does not exist.
'[element not found]'
end

def respond_to?(*args)
Expand Down

0 comments on commit 89a55e4

Please sign in to comment.