5
This is the "gbrainy" module.
7
This module provides a wrapper for LDTP to make writing Gbrainy tests easier.
12
from .main import Application
13
from ..gconfwrapper import GConf
14
from ..cmd import globals
18
gettext.install (True)
19
gettext.bindtextdomain (PACKAGE, globals.LOCALE_SHARE)
20
gettext.textdomain (PACKAGE)
21
t = gettext.translation(PACKAGE, globals.LOCALE_SHARE, fallback = True)
25
class Gbrainy(Application):
27
gbrainy manages the Gbrainy application.
35
BTN_CALCULATION = _('btnCalculation')
36
BTN_FINISH = _('btnFinish')
37
BTN_LOGIC = _('btnLogic')
38
BTN_MEMORY = _('btnMemory')
39
BTN_NEXT = _('btnNext')
41
BTN_PAUSE = _('btnPause')
43
BTN_VERBAL = _('btnVerbal')
44
MNU_ABOUT = _('mnuAbout')
45
MNU_ALLGAMES_LOGIC_MENTALCALCULATION_MEMORYANDVERBALANALOGIES_ = _('mnuAllGames(Logic,MentalCalculation,MemoryandVerbalAnalogies)')
46
MNU_CONTENTS = _('mnuContents')
47
MNU_CUSTOMGAMESELECTION = _('mnuCustomGameSelection')
48
MNU_ENDGAME = _('mnuEndGame')
49
MNU_EXTENSIONS = _('mnuExtensions')
50
MNU_FULLSCREEN = _('mnuFullscreen')
51
MNU_GETHELPONLINE = _('mnuGetHelpOnline')
52
MNU_HOWTOEXTENDGBRAINY_SFUNCTIONALITY = _('mnuHowtoExtendgbrainy*sFunctionality')
53
MNU_LOGICPUZZLESONLY = _('mnuLogicPuzzlesOnly')
54
MNU_MEMORYTRAINERSONLY = _('mnuMemoryTrainersOnly')
55
MNU_MENTALCALCULATIONTRAINERSONLY = _('mnuMentalCalculationTrainersOnly')
56
MNU_PAUSEGAME = _('mnuPauseGame')
57
MNU_PLAYER_SGAMESESSIONHISTORY = _('mnuPlayer*sGameSessionHistory')
58
MNU_PREFERENCES = _('mnuPreferences')
59
MNU_QUIT = _('mnuQuit')
60
MNU_REPORTAPROBLEM = _('mnuReportaProblem')
61
MNU_TRANSLATETHISAPPLICATION = _('mnuTranslateThisApplication')
62
MNU_VERBALANALOGIESONLY = _('mnuVerbalAnalogiesOnly')
66
def runAboutdialog(self):
68
This basic test simply verifies that the application launches
69
and that the UI reacts
70
The About dialog is the only menu that is always present in the UI
73
self.main_window.click(self.MNU_ABOUT)
75
# Wait for the dialog to open
76
# Name of about dialogs change with the app
79
while not ( timeout>0 and dlgAbout):
80
dlgs=[ w for w in ldtp.getwindowlist() if w.startswith('dlgAbout')]
87
raise AssertionError('About Dialog not found')
90
# Looking for a button to close the window
92
for btnClose in ('btnClose', 'btnOK', 'btnCancel'):
94
found = ldtp.getchild(dlgAbout, btnClose, 'push button')
102
ldtp.click(dlgAbout, btnClose)
106
Application.__init__(self)
107
self.main_window = ooldtp.context(self.WINDOW)