Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exception contracts #184

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix exception contracts #184

wants to merge 2 commits into from

Conversation

dtognazzini
Copy link
Contributor

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.

Donnie Tognazzini added 2 commits July 15, 2016 14:51
find() is defined by Collection and may be defined by other subclasses. Calling node.find()
directly avoids subclasses messing up load ensuring.
@dtognazzini dtognazzini force-pushed the fixExceptionContract branch from 3058ddb to 5a7a9ac Compare July 15, 2016 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant