tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sw / qa / uitest / writer_tests4 / insertBreakDialog.py
blob4d968f723c8ab4edf4af1a6d74c360c75749c16c
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 from uitest.uihelper.common import select_pos
13 class WriterInsertBreakDialog(UITestCase):
15 def getPages(self, total):
16 document = self.ui_test.get_component()
18 self.assertEqual(document.CurrentController.PageCount, total)
20 def test_insert_line_break(self):
22 with self.ui_test.create_doc_in_start_center("writer"):
24 with self.ui_test.execute_dialog_through_command(".uno:InsertBreak") as xDialog:
25 xOption = xDialog.getChild("linerb")
26 xOption.executeAction("CLICK", tuple())
28 self.getPages(1)
31 def test_insert_column_break(self):
33 with self.ui_test.create_doc_in_start_center("writer"):
35 with self.ui_test.execute_dialog_through_command(".uno:InsertBreak") as xDialog:
36 xOption = xDialog.getChild("columnrb")
37 xOption.executeAction("CLICK", tuple())
39 self.getPages(1)
42 def test_insert_page_break(self):
44 with self.ui_test.create_doc_in_start_center("writer"):
46 for i in range(9):
47 with self.subTest(i=i):
48 with self.ui_test.execute_dialog_through_command(".uno:InsertBreak") as xDialog:
50 xOption = xDialog.getChild("pagerb")
51 xOption.executeAction("CLICK", tuple())
53 xStyleList = xDialog.getChild("stylelb")
54 select_pos(xStyleList, str(i))
56 self.getPages(i + 2)
59 def test_cancel_button_insert_line_break_dialog(self):
61 with self.ui_test.create_doc_in_start_center("writer"):
63 with self.ui_test.execute_dialog_through_command(".uno:InsertBreak", close_button="cancel"):
64 pass
66 self.getPages(1)
69 # vim: set shiftwidth=4 softtabstop=4 expandtab: