Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / qa / uitest / writer_dialogs / openDialogs.py
blob1e58c5acccd911af67fe9716351c47049d28a109
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
11 import unittest
12 from uitest.uihelper.testDialog import testDialog
14 dialogs = [
15 {"command": ".uno:OpenRemote", "closeButton": "cancel"},
16 #{"command": ".uno:NewDoc", "closeButton": "close"},
17 # tested in sw/qa/uitest/writer_tests2/tdf146375.py
18 {"command": ".uno:SaveAsTemplate", "closeButton": "cancel"},
19 #{"command": ".uno:ExportToPDF", "closeButton": "cancel", "skipTestOK": True},
20 # tested in sw/qa/uitest/writer_tests4/exportToPDF.py
21 #{"command": ".uno:ExportToEPUB", "closeButton": "cancel", "skipTestOK": True},
22 # tested in writerperfect/qa/uitest/epubexport/epubexport.py
23 {"command": ".uno:Print", "closeButton": "cancel", "skipTestOK": True},
24 # no printer in CI
25 # tested in sw/qa/uitest/writer_tests5/tdf123378.py
26 {"command": ".uno:PrinterSetup", "closeButton": "cancel"},
27 # {"command": ".uno:SetDocumentProperties", "closeButton": "cancel"},
28 # tested in sw/qa/uitest/writer_tests2/documentProperties.py
29 # {"command": ".uno:PasteSpecial", "closeButton": "cancel"},
30 # tested in sw/qa/uitest/writer_tests2/pasteSpecial.py
31 # {"command": ".uno:SearchDialog", "closeButton": "close"},
32 # tested in sw/qa/uitest/findReplace/findReplace.py
33 # {"command": ".uno:GotoPage", "closeButton": "cancel"},
34 # tested in uitest/writer_tests/goToPage.py
35 # {"command": ".uno:AcceptTrackedChanges", "closeButton": "close"},
36 # tested in sw/qa/uitest/writer_tests/trackedChanges.py
37 {"command": ".uno:ProtectTraceChangeMode", "closeButton": "cancel"},
38 # {"command": ".uno:ChangeDatabaseField", "closeButton": "close"},
39 # tested in sw/qa/uitest/writer_tests2/exchangeDatabase.py
40 # {"command": ".uno:InsertBreak", "closeButton": "cancel"},
41 # tested in uitest/writer_tests/insertBreakDialog.py
42 # {"command": ".uno:InsertObject", "closeButton": "cancel"},
43 # tested in sw/qa/uitest/writer_tests4/tdf148395.py
44 # {"command": ".uno:InsertSection", "closeButton": "cancel"},
45 # tested in sw/qa/uitest/writer_tests7/tdf140863.py
46 {"command": ".uno:InsertFrame", "closeButton": "cancel"},
47 {"command": ".uno:InsertObjectFloatingFrame", "closeButton": "cancel"},
48 {"command": ".uno:FontworkGalleryFloater", "closeButton": "cancel"},
49 # {"command": ".uno:HyperlinkDialog", "closeButton": "close"},
50 # dialog opens but is not recognised by execute_dialog_through_command
51 # {"command": ".uno:InsertBookmark", "closeButton": "close"},
52 # tested in sw/qa/uitest/writer_tests2/bookmark.py
53 # {"command": ".uno:InsertReferenceField", "closeButton": "cancel"},
54 # Tested in sw/qa/uitest/writer_tests7/tdf135938.py
55 # {"command": ".uno:InsertSymbol", "closeButton": "cancel"},
56 # tested in sw/qa/uitest/writer_tests3/specialCharacter.py
57 # {"command": ".uno:InsertFootnoteDialog", "closeButton": "cancel"},
58 # tested in sw/qa/uitest/writer_tests3/insertFootEndnote.py
59 {"command": ".uno:InsertIndexesEntry", "closeButton": "close"},
60 {"command": ".uno:InsertAuthoritiesEntry", "closeButton": "close"},
61 {"command": ".uno:InsertMultiIndex", "closeButton": "cancel"},
62 # button is labeled "Close" but is called "cancel"
63 {"command": ".uno:InsertFieldCtrl", "closeButton": "cancel", "skipTestOK": True},
64 # when running the test through the make command the OK button (insert) is enabled for some reason
65 # {"command": ".uno:InsertEnvelope", "closeButton": "cancel"},
66 # tested in sw/qa/uitest/writer_tests3/insertEnvelope.py
67 # {"command": ".uno:InsertSignatureLine", "closeButton": "cancel"},
68 # tested in sw/qa/uitest/writer_tests3/insertSignatureLine.py
69 # {"command": ".uno:FontDialog", "closeButton": "cancel"},
70 # tested in sw/qa/uitest/writer_tests2/formatCharacter.py
71 # {"command": ".uno:ParagraphDialog", "closeButton": "cancel"},
72 # tested in sw/qa/uitest/writer_tests2/formatParagraph.py
73 # {"command": ".uno:BulletsAndNumberingDialog", "closeButton": "cancel"},
74 # tested in sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
75 # {"command": ".uno:PageDialog", "closeButton": "cancel"},
76 # tested in uitest/writer_tests/pageDialog.py
77 # {"command": ".uno:TitlePageDialog", "closeButton": "cancel"},
78 # tested in sw/qa/uitest/writer_tests5/titlePage.py
79 # {"command": ".uno:RubyDialog", "closeButton": "close"},
80 # dialog opens but is not recognised by execute_dialog_through_command
81 # {"command": ".uno:FormatColumns", "closeButton": "cancel"},
82 # tested in sw/qa/uitest/writer_tests5/columns.py
83 # {"command": ".uno:Watermark", "closeButton": "cancel"},
84 # tested in sw/qa/uitest/writer_tests/watermark.py
85 # {"command": ".uno:EditStyle", "closeButton": "cancel"},
86 # tested in sw/qa/uitest/writer_tests2/horizontalLine.py
87 #{"command": ".uno:LoadStyles", "closeButton": "cancel"},
88 # tested in sw/qa/uitest/sidebar/stylesSidebar.py
89 # {"command": ".uno:InsertTable", "closeButton": "cancel"},
90 # tested in uitest/writer_tests/insertTableDialog.py
91 # {"command": ".uno:SpellDialog", "closeButton": "close"},
92 # an extra dialog appears
93 # {"command": ".uno:ThesaurusDialog", "closeButton": "cancel"},
94 # fails in CI, but works fine locally
95 {"command": ".uno:Hyphenate", "closeButton": "ok", "skipTestOK": True},
96 # do not test the OK button twice
97 {"command": ".uno:ChineseConversion", "closeButton": "cancel"},
98 # {"command": ".uno:WordCountDialog", "closeButton": "close"},
99 # tested in sw/qa/uitest/writer_tests/wordCount.py
100 # {"command": ".uno:AutoCorrectDlg", "closeButton": "cancel"},
101 # tested in sw/qa/uitest/writer_tests5/autocorrectOptions.py
102 {"command": ".uno:EditGlossary", "closeButton": "close"},
103 # {"command": ".uno:ChapterNumberingDialog", "closeButton": "cancel"},
104 # tested in sw/qa/uitest/chapterNumbering/chapterNumbering.py
105 # {"command": ".uno:LineNumberingDialog", "closeButton": "cancel"},
106 # tested in sw/qa/uitest/writer_tests3/lineNumbering.py
107 {"command": ".uno:FootnoteDialog", "closeButton": "cancel"},
108 # {"command": ".uno:MailMergeWizard", "closeButton": "cancel"},
109 # may hang forever in e_book_client_connect_direct_sync
110 # tested in sw/qa/uitest/writer_tests7/tdf134243.py
111 {"command": ".uno:AddressBookSource", "closeButton": "cancel"},
112 {"command": ".uno:RunMacro", "closeButton": "cancel"},
113 {"command": ".uno:ScriptOrganizer", "closeButton": "close"},
114 {"command": ".uno:OpenXMLFilterSettings", "closeButton": "close"},
115 {"command": "service:com.sun.star.deployment.ui.PackageManagerDialog", "closeButton": "close"},
116 # {"command": ".uno:ConfigureDialog", "closeButton": "cancel"},
117 # tested in uitest/writer_tests/customizeDialog.py
118 #{"command": ".uno:OptionsTreeDialog", "closeButton": "cancel"},
119 # used in various places
120 {"command": ".uno:ShowLicense", "closeButton": "close", "skipTestOK": True},
121 # {"command": ".uno:About", "closeButton": "close"},
122 # tested in sw/qa/uitest/writer_tests5/about_test.py
125 def load_tests(loader, tests, pattern):
126 return unittest.TestSuite(openDialogs(dialog)
127 for dialog in dialogs)
129 # Test to open all listed dialogs one by one, close it with the given close button
130 # and if there is an "OK" button open the dialog again and close it by using the OK button
131 # the test only checks if writer crashes by opening the dialog
132 class openDialogs(UITestCase):
133 def check(self, dialog):
134 testDialog(self, "writer", dialog)
136 dialogCount = 0
137 for dialog in dialogs:
138 dialogCount = dialogCount + 1
141 def ch(dialog):
142 return lambda self: self.check(dialog)
145 setattr(openDialogs, "test_%02d_%s" % (dialogCount, dialog["command"]), ch(dialog))
146 # vim: set shiftwidth=4 softtabstop=4 expandtab: