ae_page_objects icon indicating copy to clipboard operation
ae_page_objects copied to clipboard

Fix exception contracts

Open dtognazzini opened this issue 9 years ago • 0 comments

2 changes:

  1. Node delegates some methods to the underlying Capybara node. These delegations nest Capybara::ElementNotFound under AePageObjects::LoadingElementFailed. AePageObjects::LoadingElementFailed indicates that an AePageObjects::Element failed to load. Capybara::ElementNotFound indicates that a Capybara element failed to be found. The Capybara exception should only be nested under the AePageObjects exception when the Capybara exception is the cause for an AePageObjects element failing to load.
  2. Replaced use of find() delegation in Node with node.find(). In every case, Node wants to find the underlying Capybara element. Before this change, subclasses could define a find method and override the behavior in Node of finding the underlying Capybara node. For example, AePageObjects::Collection does this today. Subclasses should be able to define methods without overriding this behavior.

dtognazzini avatar Jul 15 '16 20:07 dtognazzini