1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 from uitest
.framework
import UITestCase
12 from uitest
.uihelper
.testDialog
import testDialog
15 {"command": ".uno:OpenRemote", "closeButton": "cancel"},
16 {"command": ".uno:SaveAsTemplate", "closeButton": "cancel"},
17 {"command": ".uno:SaveAsRemote", "closeButton": "cancel"},
18 # {"command": ".uno:ExportToPDF", "closeButton": "cancel", "skipTestOK": True},
19 # tested in sc/qa/uitest/calc_tests4/exportToPDF.py
20 {"command": ".uno:Print", "closeButton": "cancel", "skipTestOK": True},
22 {"command": ".uno:PrinterSetup", "closeButton": "cancel"},
23 # {"command": ".uno:SetDocumentProperties", "closeButton": "cancel"},
24 # tested in sc/qa/uitest/calc_tests/documentProperties.py
25 # {"command": ".uno:PasteSpecial", "closeButton": "cancel"},
26 # would need to copy first something into the clipboard
27 # {"command": ".uno:SearchDialog", "closeButton": "close"},
28 # tested in sc/qa/uitest/search_replace/*
29 # {"command": ".uno:InsertObjectChart", "closeButton": "cancel"},
30 # tested in uitest/calc_tests/create_chart.py
31 # {"command": ".uno:DataDataPilotRun", "closeButton": "cancel", "skipTestOK": True},
32 # tested in sc/qa/uitest/calc_tests8/tdf137726.py
33 # {"command": ".uno:FunctionDialog", "closeButton": "cancel"},
34 # Cancel button tested in uitest/calc_tests/function_wizard.py
35 # OK button tested in sc/qa/uitest/calc_tests7/tdf123479.py
36 # {"command": ".uno:InsertName", "closeButton": "close"},
37 # tested in sc/qa/uitest/range_name/create_range_name.py
38 {"command": ".uno:InsertObjectFloatingFrame", "closeButton": "cancel"},
39 {"command": ".uno:FontworkGalleryFloater", "closeButton": "cancel"},
40 # {"command": ".uno:HyperlinkDialog", "closeButton": "ok"},
41 # dialog opens but is not recognised by execute_dialog_through_command
42 #{"command": ".uno:InsertSymbol", "closeButton": "cancel"},
43 # Tested in uitest/demo_ui/char_dialog.py
44 {"command": ".uno:EditHeaderAndFooter", "closeButton": "cancel"},
45 # {"command": ".uno:InsertSignatureLine", "closeButton": "cancel"},
46 # tested in sc/qa/uitest/signatureLine/insertSignatureLine.py
47 # {"command": ".uno:FormatCellDialog", "closeButton": "cancel"},
48 # tested in sc/qa/uitest/calc_tests/formatCells.py
49 # {"command": ".uno:RowHeight", "closeButton": "cancel"},
50 # tested in sc/qa/uitest/calc_tests/rows.py
51 # {"command": ".uno:SetOptimalRowHeight", "closeButton": "cancel"},
52 # tested in sc/qa/uitest/calc_tests9/tdf126673.py
53 # {"command": ".uno:ColumnWidth", "closeButton": "cancel"},
54 # tested in sc/qa/uitest/calc_tests/columns.py
55 # {"command": ".uno:SetOptimalColumnWidth", "closeButton": "cancel"},
56 # tested in sc/qa/uitest/textToColumns/tdf89907.py
57 # {"command": ".uno:PageFormatDialog", "closeButton": "cancel"},
58 # tested in sc/qa/uitest/pageFormat/tdf123508.py
59 {"command": ".uno:EditPrintArea", "closeButton": "cancel", "skipTestOK": True},
60 # tested in sc/qa/uitest/calc_tests/printRange.py
61 # {"command": ".uno:ConditionalFormatMenu", "closeButton": "cancel"},
62 # dialog does not open
63 # {"command": ".uno:AutoFormat", "closeButton": "cancel"},
64 # dialog does not open
65 # {"command": ".uno:ChooseDesign", "closeButton": "cancel"},
66 # dialog opens but is not recognised by execute_dialog_through_command
67 {"command": ".uno:StyleNewByExample", "closeButton": "cancel"},
68 {"command": ".uno:InsertCell", "closeButton": "cancel"},
69 {"command": ".uno:DeleteCell", "closeButton": "cancel"},
70 # {"command": ".uno:Insert", "closeButton": "cancel", "skipTestOK": True},
71 # OK button tested in uitest/calc_tests/gridwin.py
72 # {"command": ".uno:Add", "closeButton": "cancel"},
73 # tested in sc/qa/uitest/range_name/tdf148072.py
74 # {"command": ".uno:InsertExternalDataSource", "closeButton": "cancel"},
75 # dialog opens and closes, but is not recognized as closed by close_dialog_through_button
76 # {"command": ".uno:Delete", "closeButton": "cancel"},
77 # tested in sc/qa/uitest/calc_tests3/clearCells.py
78 # {"command": ".uno:RandomNumberGeneratorDialog", "closeButton": "close"},
79 # tested in sc/qa/uitest/calc_tests/fillRandomNumber.py
80 # {"command": ".uno:AddName", "closeButton": "cancel"},
81 # Cancel button tested in uitest/demo_ui/edit.py
82 # "add" button tested in uitest/calc_tests/create_range_name.py
83 #{"command": ".uno:DefineName", "closeButton": "cancel"},
84 # tested in sc/qa/uitest/calc_tests9/tdf130371.py
85 # {"command": ".uno:SheetInsertName", "closeButton": "close"},
86 # dialog does not open
87 #{"command": ".uno:CreateNames", "closeButton": "cancel", "skipTestOK": True},
88 # tested in sc/qa/uitest/range_name/tdf137617.py
89 # OK button triggers a new dialog
90 #{"command": ".uno:DefineLabelRange", "closeButton": "cancel"},
91 # tested in sc/qa/uitest/calc_tests4/tdf131170.py
92 # {"command": ".uno:RenameTable", "closeButton": "cancel"},
93 # tested in sc/qa/uitest/calc_tests/sheetRename.py
94 # {"command": ".uno:Move", "closeButton": "cancel"},
95 # tested in sc/qa/uitest/calc_tests6/moveCopySheet.py
96 {"command": ".uno:SetTabBgColor", "closeButton": "cancel"},
97 {"command": ".uno:TableEvents", "closeButton": "cancel"},
98 # {"command": ".uno:DataSort", "closeButton": "cancel"},
99 # cancel button tested in sc/qa/uitest/calc_tests/sorting.py
100 # OK button tested in sc/qa/uitest/calc_tests/naturalSort.py
101 # {"command": ".uno:DataFilterAutoFilter", "closeButton": "ok", "skipTestOK": True},
102 # tested in sc/qa/uitest/autofilter/autofilterBugs.py
103 # {"command": ".uno:DataFilterStandardFilter", "closeButton": "cancel"},
104 # tested in sc/qa/uitest/calc_tests2/standardFilter.py
105 #{"command": ".uno:DataFilterSpecialFilter", "closeButton": "cancel", "skipTestOK": True},
106 # tested in sc/qa/uitest/calc_tests6/tdf147830.py
107 # {"command": ".uno:DefineDBName", "closeButton": "cancel"},
108 # tested in sc/qa/uitest/range_name/tdf119954.py
109 {"command": ".uno:SelectDB", "closeButton": "cancel"},
110 # {"command": ".uno:InsertPivotTable", "closeButton": "cancel"},
111 # dialog does not open
112 # {"command": ".uno:Validation", "closeButton": "cancel"},
113 # tested in sc/qa/uitest/validity/validity.py
114 # {"command": ".uno:DataSubTotals", "closeButton": "cancel"},
115 # tested in sc/qa/uitest/calc_tests2/subtotals.py
116 # {"command": ".uno:DataForm", "closeButton": "close"},
117 # tested in sc/qa/uitest/calc_tests2/dataform.py
118 # {"command": ".uno:DataConsolidate", "closeButton": "cancel"},
119 # tested in sc/qa/uitest/calc_tests2/consolidate.py
120 {"command": ".uno:Group", "closeButton": "cancel"},
121 # {"command": ".uno:SamplingDialog", "closeButton": "cancel"},
122 # tested in sc/qa/uitest/statistics/sampling.py
123 # {"command": ".uno:DescriptiveStatisticsDialog", "closeButton": "cancel"},
124 # tested in sc/qa/uitest/statistics/descriptiveStatistics.py
125 # {"command": ".uno:AnalysisOfVarianceDialog", "closeButton": "cancel"},
126 # tested in sc/qa/uitest/statistics/anova.py
127 # {"command": ".uno:CorrelationDialog", "closeButton": "cancel"},
128 # tested in sc/qa/uitest/statistics/correlation.py
129 # {"command": ".uno:CovarianceDialog", "closeButton": "cancel"},
130 # tested in sc/qa/uitest/statistics/covariance.py
131 # {"command": ".uno:ExponentialSmoothingDialog", "closeButton": "cancel"},
132 # tested in sc/qa/uitest/statistics/exponentialSmoothing.py
133 # {"command": ".uno:MovingAverageDialog", "closeButton": "cancel"},
134 # tested in sc/qa/uitest/statistics/movingAverage.py
135 # {"command": ".uno:RegressionDialog", "closeButton": "cancel"},
136 # tested in sc/qa/uitest/statistics/regression.py
137 # {"command": ".uno:TTestDialog", "closeButton": "cancel"},
138 # tested in sc/qa/uitest/statistics/tTest.py
139 # {"command": ".uno:FTestDialog", "closeButton": "cancel"},
140 # tested in sc/qa/uitest/statistics/fTest.py
141 # {"command": ".uno:ZTestDialog", "closeButton": "cancel"},
142 # tested in sc/qa/uitest/statistics/zTest.py
143 # {"command": ".uno:ChiSquareTestDialog", "closeButton": "cancel"},
144 # tested in sc/qa/uitest/statistics/chiSquare.py:53
145 {"command": ".uno:FourierAnalysisDialog", "closeButton": "cancel"},
146 # {"command": ".uno:SpellDialog", "closeButton": "close"},
147 # an extra dialog appears
148 {"command": ".uno:Hyphenate", "closeButton": "cancel"},
149 #{"command": ".uno:ChineseConversion", "closeButton": "cancel"},
150 # tested in sc/qa/uitest/calc_tests6/tdf104378.py
151 # {"command": ".uno:AutoCorrectDlg", "closeButton": "cancel"},
152 # tested in sc/qa/uitest/calc_tests6/autocorrectOptions.py
153 {"command": ".uno:GoalSeekDialog", "closeButton": "cancel", "skipTestOK": True},
154 # OK button triggers a new dialog
155 {"command": ".uno:SolverDialog", "closeButton": "close", "skipTestOK": True},
156 # OK button triggers a new dialog
157 # {"command": ".uno:ShareDocument", "closeButton": "cancel"},
158 # tested in sc/qa/uitest/calc_tests6/shareSpreadsheet.py
159 # {"command": ".uno:Protect", "closeButton": "cancel"},
160 # tested in sc/qa/uitest/protect/protectSheet.py
161 # {"command": ".uno:ToolProtectionDocument", "closeButton": "cancel"},
162 # tested in sc/qa/uitest/protect/protectSpreadsheet.py
163 {"command": ".uno:RunMacro", "closeButton": "cancel"},
164 {"command": ".uno:ScriptOrganizer", "closeButton": "close"},
165 {"command": ".uno:ShowLicense", "closeButton": "close", "skipTestOK": True},
166 # {"command": ".uno:About", "closeButton": "close"},
167 # tested in sc/qa/uitest/calc_tests7/tdf106667.py
171 def load_tests(loader
, tests
, pattern
):
172 return unittest
.TestSuite(openDialogs(dialog
)
173 for dialog
in dialogs
)
175 # Test to open all listed dialogs one by one, close it with the given close button
176 # and if there is an "OK" button open the dialog again and close it by using the OK button
177 # the test only checks if calc crashes by opening the dialog, see e.g. tdf#120227, tdf#125985, tdf#125982
178 class openDialogs(UITestCase
):
179 def check(self
, dialog
):
180 testDialog(self
, "calc", dialog
)
183 for dialog
in dialogs
:
184 dialogCount
= dialogCount
+ 1
188 return lambda self
: self
.check(dialog
)
191 setattr(openDialogs
, "test_%02d_%s" % (dialogCount
, dialog
["command"]), ch(dialog
))
192 # vim: set shiftwidth=4 softtabstop=4 expandtab: