From c57e61bc3364193a03f32766b83d92abf883c99a Mon Sep 17 00:00:00 2001 From: Stewart Gleadow Date: Fri, 27 Dec 2013 18:32:54 +1100 Subject: [PATCH] Add better error messages to be_true/be_false matchers --- gem/lib/frank-cucumber/frank_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gem/lib/frank-cucumber/frank_helper.rb b/gem/lib/frank-cucumber/frank_helper.rb index 050f8ce..2c91374 100644 --- a/gem/lib/frank-cucumber/frank_helper.rb +++ b/gem/lib/frank-cucumber/frank_helper.rb @@ -127,11 +127,11 @@ 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. @@ -139,11 +139,11 @@ def check_element_exists_and_is_visible( 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.