Skip to content

Commit d495936

Browse files
rootroot
authored andcommitted
Fixed failing download reports tests
1 parent 6ed48b1 commit d495936

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

init_helpers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,14 @@ def capture_screenshot(filename):
299299
def handle_unresponsive_page():
300300
return playwright_helper_instance.handle_unresponsive_page()
301301

302+
def click_and_get_download_path(element, action, timeout, download_dir='downloads'):
303+
if isinstance(element, (tuple, list)):
304+
element = get_element_by_type(*element) # Unpack the tuple/list
305+
else:
306+
# If it's a string, treat it as a selector directly
307+
element = get_element_by_type(element)
308+
return playwright_helper_instance.click_and_get_download_path(element, action, timeout, 'downloads')
309+
302310
def find_element_and_perform_action(element, action, inputValue=None):
303311
if isinstance(element, (tuple, list)):
304312
element = get_element_by_type(*element) # Unpack the tuple/list

0 commit comments

Comments
 (0)