From 17f96e03c85d91feb4f6f13e80149737c65e519d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 17 Jul 2024 04:19:49 +0200 Subject: [PATCH] tests: handle both Save and Save All dialogs Thunderbird 115 in Whonix Workstation 17 has a bit different buttons. Handle both versions. --- tests/test_thunderbird.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_thunderbird.py b/tests/test_thunderbird.py index d193470..713ae1b 100644 --- a/tests/test_thunderbird.py +++ b/tests/test_thunderbird.py @@ -475,11 +475,14 @@ def receive_message(tb, signed=False, encrypted=False, attachment=None): # for some reasons some Thunderbird versions do not expose 'Attach File' # dialog through accessibility API, use xdotool instead save_as = tb.app.findChild( - GenericPredicate(name='Save All Attachments', + GenericPredicate(name='Save All Attachments|Save Attachment', roleName='file chooser')) click(*save_as.childNamed('Home').position) click(*save_as.childNamed('Desktop').position) - save_as.childNamed('Open').doActionNamed('click') + if save_as.name == 'Save Attachment': + save_as.childNamed('Save').doActionNamed('click') + else: + save_as.childNamed('Open').doActionNamed('click') # save_as = tb.app.dialog('Save .*Attachment.*') # places = save_as.child(roleName='table', # name='Places')