def element_has_text(page, css_selector, text):
 text_present = False
 text_list = page.q(css=css_selector).text
 if ((len(text_list) > 0) and (text in text_list)):
  text_present = True
 return text_present

def element_has_text ( page , css_selector , text ) : text_present = False text_list = page . q ( css = css_selector ) . text if ( ( len ( text_list ) > 0 ) and ( text in text_list ) ) : text_present = True return text_present
return true if the given text is present in the list .