2
gnome module contains the definition of the test suites used for gnome
6
from .main import SingleApplicationTestSuite
7
from ..application.gnome import Application, Seahorse, GEdit, GnomeScreenshot, Calculator
9
class GCalctoolTestSuite(SingleApplicationTestSuite):
11
Default test suite for Calculator
13
APPLICATION_FACTORY = Calculator
15
self.application.open()
16
self.application.push("C")
19
self.application.close()
24
class GCalctoolViewTestSuite(GCalctoolTestSuite):
26
Test suite for views populates the screen with some data in setup
29
GCalctoolTestSuite.setup(self)
30
self.application.push("13.37")
32
class GnomeScreenshotTestSuite(SingleApplicationTestSuite):
33
APPLICATION_FACTORY = GnomeScreenshot
35
class SeahorseTestSuite(SingleApplicationTestSuite):
37
Default test suite for Seahorse
39
APPLICATION_FACTORY = Seahorse
41
self.application.open()
44
self.application.close()
47
#TODO: it should delete all the "My Personal Keys"
51
class GEditTestSuite(SingleApplicationTestSuite):
53
Default test suite for GEdit
55
APPLICATION_FACTORY = GEdit
57
self.application.open()
60
self.application.close()
63
# Exit using the Quit menu
66
gedit = ooldtp.context(self.application.name)
67
quit_menu = gedit.getchild(self.application.MNU_CLOSE)
68
except ldtp.LdtpExecutionError:
69
raise ldtp.LdtpExecutionError, "The quit menu was not found."
70
quit_menu.selectmenuitem()
71
except ldtp.LdtpExecutionError:
72
raise ldtp.LdtpExecutionError, "Mmm, something went wrong when closing the application."
74
result = ldtp.waittillguiexist(self.application.QUESTION_DLG,
78
question_dialog = ooldtp.context(self.application.QUESTION_DLG)
79
question_dlg_btn_close = question_dialog.getchild(self.application.QUESTION_DLG_BTN_CLOSE)
80
question_dlg_btn_close.click()
83
gedit = ooldtp.context(self.application.name)
84
new_menu = gedit.getchild(self.application.MNU_NEW)
85
except ldtp.LdtpExecutionError:
86
raise ldtp.LdtpExecutionError, "The new menu was not found."
87
new_menu.selectmenuitem()
89
result = ldtp.waittillguiexist(
90
self.application.name, self.application.TXT_FIELD)
92
raise ldtp.LdtpExecutionError, "Failed to set up new document."