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

Add better error messages for selector matchers #15

Merged
merged 1 commit into from
Jan 19, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gem/lib/frank-cucumber/frank_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,23 +127,23 @@ def element_exists( selector )
# @raise an rspec exception if the assertion fails
# @see #element_exists, #check_element_does_not_exist
def check_element_exists( selector )
element_exists( selector ).should be_true
element_exists( selector ).should be_true, "Could not find element matching selector (#{selector})"
end

def check_element_exists_and_is_visible( selector )
element_is_not_hidden( selector ).should be_true
element_is_not_hidden( selector ).should be_true, "Could not find visible element matching selector (#{selector})"
end

# Assert whether there are no views in the current view heirarchy which match the specified selector.
# @param [String] selector a view selector.
# @raise an rspec exception if the assertion fails
# @see #element_exists, #check_element_exists
def check_element_does_not_exist( selector )
element_exists( selector ).should be_false
element_exists( selector ).should be_false, "Found element matching selector when it should not exist (#{selector})"
end

def check_element_does_not_exist_or_is_not_visible( selector )
element_is_not_hidden( selector ).should be_false
element_is_not_hidden( selector ).should be_false, "Found visible element matching selector when it should not be visible (#{selector})"
end

# Indicate whether there are any views in the current view heirarchy which contain the specified accessibility label.
Expand Down