Skip to content

Commit

Permalink
Add better error messages to be_true/be_false matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
Stewart Gleadow committed Dec 27, 2013
1 parent ade942b commit c57e61b
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit c57e61b

Please sign in to comment.