Conversation
lib/ae_page_objects/element_proxy.rb
Outdated
|
|
||
| implicit_element.__send__(name, *args, &block) | ||
| rescue AePageObjects::LoadingElementFailed | ||
| raise unless %w(to_s inspect).include? name.to_sym |
There was a problem hiding this comment.
I included both to_s and inspect here because I figured that both methods would be better off returning a string rather than raising an error. I could be convinced otherwise.
|
Can you add tests? I tried to reproduce this in an existing selenium test for a simple project and wasn't been able to, so I think there is more to it than what was described above. |
89a55e4 to
eb7072f
Compare
|
@rmacklin you are right, the root cause of the flakiness was something else. The fix I've made is still valid as the failing I've added unit tests for the fix. |
|
I'm still not totally clear on the root issue here. But if this is limited to |
|
Seems like a pretty good improvement. I think things would become even cleaner if we collapsed |
When
assert_predicateassertions failMinitestwill inspect the target object as part of the error message generation.Currently AePageObjects will pass the
inspectcall on to theElementwhich will attempt to load the DOM element and will result inAePageObjects::LoadingElementFailedbeing thrown.This PR allow
inspectto be called onElementProxyobjects where the DOM element is absent without throwing an error.