2023-09-01 11:18:04 +00:00
|
|
|
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
|
|
|
|
|
2023-10-09 17:04:29 +00:00
|
|
|
return _wrapper
|