From e307a07068a24a4a8c46ea39894eafdb9adce267 Mon Sep 17 00:00:00 2001 From: Lukas Ruzicka Date: Jan 28 2019 16:22:09 +0000 Subject: Create a step for menu clicking. --- diff --git a/gedit/features/steps/steps.py b/gedit/features/steps/steps.py index 5b28b39..06d1e0c 100644 --- a/gedit/features/steps/steps.py +++ b/gedit/features/steps/steps.py @@ -41,6 +41,13 @@ def app_window_is_displayed(context, app): actual = 0 assert actual > 0, '%d %s window(s) displayed' % (actual, app) +@step('Click {button} in application menu') +def click_in_menu(context, button): + menu = context.app.instance.findChild(lambda x: x.name == 'Menu') + button = context.app.instance.findChild(lambda x: x.name == button and x.roleName == 'push button') + menu.click() + sleep(1) + button.click() @step(u'Click "{name}" in side panel') def click_item_in_sidepanel(context, name):