The accessor methods create a method for checking if an element exists.
For example, when you include:
span(:partner_flag, class: 'content-partner-flag')
Then the method:
partner_flag?
Is created that returns true if the element exists and false if the element does not.
You could call this method in the check_element_not_exist
method:
def check_element_not_exist(page_object)
page_object = page_object.downcase.gsub(' ', '_')
exists = send("#{page_object}?")
if exists
raise "#{page_object} was found!"
end
end