def click_css(page, css, source_index=0, require_notification=True):
 def _is_visible(element):
  'Is the given element visible?'
  return (element.is_displayed() and all(((size > 0) for size in element.size.itervalues())))
 disable_animations(page)
 page.q(css=css).filter(_is_visible).nth(source_index).click()
 if require_notification:
  wait_for_notification(page)
 page.wait_for_ajax()

def click_css ( page , css , source_index = 0 , require_notification = True ) : def _is_visible ( element ) : return ( element . is_displayed ( ) and all ( ( ( size > 0 ) for size in element . size . itervalues ( ) ) ) ) disable_animations ( page ) page . q ( css = css ) . filter ( _is_visible ) . nth ( source_index ) . click ( ) if require_notification : wait_for_notification ( page ) page . wait_for_ajax ( )
click the button/link with the given css and index on the specified page .