5
This is the "sol" module.
7
This module provides a wrapper for LDTP to make writing Sol 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 Sol(Application):
27
sol manages the Sol application.
32
WINDOW = 'frmKlondike'
34
BTN_DEAL = _('btnDeal')
35
BTN_HINT = _('btnHint')
36
BTN_LEAVEFULLSCREEN = _('btnLeaveFullscreen')
38
BTN_REDOMOVE = _('btnRedoMove')
39
BTN_RESTART = _('btnRestart')
40
BTN_SELECTGAME = _('btnSelectGame')
41
BTN_UNDOMOVE = _('btnUndoMove')
42
MNU_ABOUT = _('mnuAbout')
43
MNU_CLOSE = _('mnuClose')
44
MNU_CONTENTS = _('mnuContents')
45
MNU_DEAL = _('mnuDeal')
46
MNU_EMPTY = _('mnuEmpty')
47
MNU_EMPTY1 = _('mnuEmpty1')
48
MNU_EMPTY2 = _('mnuEmpty2')
49
MNU_EMPTY3 = _('mnuEmpty3')
50
MNU_EMPTY4 = _('mnuEmpty4')
51
MNU_EMPTY5 = _('mnuEmpty5')
52
MNU_EMPTY6 = _('mnuEmpty6')
53
MNU_GETHELPONLINE = _('mnuGetHelpOnline')
54
MNU_HINT = _('mnuHint')
55
MNU_INSTALLCARDTHEMES___ = _('mnuInstallcardthemes***')
56
MNU_KLONDIKE = _('mnuKlondike')
57
MNU_KLONDIKE2 = _('mnuKlondike2')
59
MNU_REDOMOVE = _('mnuRedoMove')
60
MNU_REPORTAPROBLEM = _('mnuReportaProblem')
61
MNU_RESTART = _('mnuRestart')
62
MNU_SELECTGAME = _('mnuSelectGame')
63
MNU_STATISTICS = _('mnuStatistics')
64
MNU_TRANSLATETHISAPPLICATION = _('mnuTranslateThisApplication')
65
MNU_UNDOMOVE = _('mnuUndoMove')
68
def runAboutdialog(self):
70
This basic test simply verifies that the application launches
71
and that the UI reacts
72
The About dialog is the only menu that is always present in the UI
75
self.main_window.click(self.MNU_ABOUT)
77
# Wait for the dialog to open
78
# Name of about dialogs change with the app
81
while not ( timeout>0 and dlgAbout):
82
dlgs=[ w for w in ldtp.getwindowlist() if w.startswith('dlgAbout')]
89
raise AssertionError('About Dialog not found')
92
# Looking for a button to close the window
94
for btnClose in ('btnClose', 'btnOK', 'btnCancel'):
96
found = ldtp.getchild(dlgAbout, btnClose, 'push button')
104
ldtp.click(dlgAbout, btnClose)
108
self.main_window.click('mnuClose')
111
Application.__init__(self)
112
self.main_window = ooldtp.context(self.WINDOW)