5
This is the "gnome_sudoku" module.
7
This module provides a wrapper for LDTP to make writing Gnome_sudoku 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 Gnome_sudoku(Application):
27
gnome_sudoku manages the Gnome_sudoku application.
30
LAUNCHER = 'gnome-sudoku'
35
BTN_APPLY = _('btnApply')
36
BTN_CLEAR = _('btnClear')
37
BTN_HIDE = _('btnHide')
38
BTN_HINT = _('btnHint')
40
BTN_REDO = _('btnRedo')
41
BTN_UNDO = _('btnUndo')
42
MNU_ABOUT = _('mnuAbout')
43
MNU_CLEARBOTTOMNOTES = _('mnuClearBottomNotes')
44
MNU_CLEARTOPNOTES = _('mnuClearTopNotes')
45
MNU_CLOSE = _('mnuClose')
46
MNU_CONTENTS = _('mnuContents')
47
MNU_EMPTY = _('mnuEmpty')
48
MNU_EMPTY1 = _('mnuEmpty1')
49
MNU_EMPTY2 = _('mnuEmpty2')
50
MNU_EMPTY3 = _('mnuEmpty3')
51
MNU_FULLSCREEN = _('mnuFullscreen')
52
MNU_GETHELPONLINE = _('mnuGetHelpOnline')
53
MNU_HINT = _('mnuHint')
55
MNU_PRINT = _('mnuPrint')
56
MNU_PRINTMULTIPLESUDOKUS = _('mnuPrintMultipleSudokus')
57
MNU_PUZZLESTATISTICS = _('mnuPuzzleStatistics')
58
MNU_REDO = _('mnuRedo')
59
MNU_REPORTAPROBLEM = _('mnuReportaProblem')
60
MNU_RESET = _('mnuReset')
61
MNU_TRANSLATETHISAPPLICATION = _('mnuTranslateThisApplication')
62
MNU_UNDO = _('mnuUndo')
65
def runAboutdialog(self):
67
This basic test simply verifies that the application launches
68
and that the UI reacts
69
The About dialog is the only menu that is always present in the UI
72
self.main_window.click(self.MNU_ABOUT)
74
# Wait for the dialog to open
75
# Name of about dialogs change with the app
78
while not ( timeout>0 and dlgAbout):
79
dlgs=[ w for w in ldtp.getwindowlist() if w.startswith('dlgAbout')]
86
raise AssertionError('About Dialog not found')
89
# Looking for a button to close the window
91
for btnClose in ('btnClose', 'btnOK', 'btnCancel'):
93
found = ldtp.getchild(dlgAbout, btnClose, 'push button')
101
ldtp.click(dlgAbout, btnClose)
104
self.main_window.click('mnuClose')
107
Application.__init__(self)
108
self.main_window = ooldtp.context(self.WINDOW)