@world.absorb
def wait_for_invisible(css_selector, timeout=GLOBAL_WAIT_FOR_TIMEOUT):
 wait_for(func=(lambda _: EC.invisibility_of_element_located((By.CSS_SELECTOR, css_selector))), timeout=timeout, timeout_msg='Timed out waiting for {} to be invisible.'.format(css_selector))

@ world . absorb def wait_for_invisible ( css_selector , timeout = GLOBAL_WAIT_FOR_TIMEOUT ) : wait_for ( func = ( lambda _ : EC . invisibility_of_element_located ( ( By . CSS_SELECTOR , css_selector ) ) ) , timeout = timeout , timeout_msg = 'Timed out waiting for {} to be invisible.' . format ( css_selector ) )
wait for the element to be either invisible or not present on the dom .