[eog] tests: fix About test



commit 6526c6446ec5f3ff21c4717e3c80a6e289d853c1
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Mon Mar 9 15:06:56 2015 +0100

    tests: fix About test

 tests/common_steps.py |   20 +++++++++++++++++++-
 tests/steps/steps.py  |    5 +++--
 2 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/tests/common_steps.py b/tests/common_steps.py
index a0f6fb6..194d0c4 100644
--- a/tests/common_steps.py
+++ b/tests/common_steps.py
@@ -13,7 +13,7 @@ from gi.repository import GLib
 
 from dogtail.rawinput import keyCombo, absoluteMotion, pressKey
 from dogtail.tree import root
-from dogtail.utils import run
+from dogtail.utils import run, GnomeShell, doDelay
 from dogtail.predicate import GenericPredicate
 from dogtail import i18n
 import pyatspi
@@ -269,3 +269,21 @@ def translate(string):
             print(translation)
         translation = translation[-1].decode('utf-8')
     return translation
+
+
+# GApplication menu steps
+ step(u'Open GApplication menu')
+def get_gmenu(context):
+    GnomeShell().getApplicationMenuButton('Image Viewer').click()
+
+
+ step(u'Close GApplication menu')
+def close_gmenu(context):
+    GnomeShell().getApplicationMenuButton('Image Viewer').click()
+    doDelay(2)
+
+
+ step(u'Click "{name}" in GApplication menu')
+def click_menu(context, name):
+    GnomeShell().clickApplicationMenuItem('Image Viewer', name)
+    doDelay(2)
diff --git a/tests/steps/steps.py b/tests/steps/steps.py
index 452b832..1c4d639 100644
--- a/tests/steps/steps.py
+++ b/tests/steps/steps.py
@@ -10,8 +10,9 @@ from dogtail import i18n
 
 @step(u'Open About dialog')
 def open_about_dialog(context):
-    context.app.menu(translate('Help')).click()
-    context.app.menu(translate('Help')).menuItem(translate('About')).click()
+    context.execute_steps(u"""
+        * Click "About" in GApplication menu
+    """)
     context.about_dialog = context.app.dialog(translate('About Image Viewer'))
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]