status-desktop/test/e2e/scripts/utils/decorators.py

11 lines
270 B
Python
Raw Normal View History

def close_exists(element):
def _wrapper(method_to_decorate):
def wrapper(*args, **kwargs):
if element.is_visible:
element.close()
return method_to_decorate(*args, **kwargs)
return wrapper
return _wrapper