tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sd / qa / uitest / impress_tests / insertSlide.py
blobb1c6139a645dc8ff1d7aa456ec119c1176138e99
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 #Bug 85360 - LibreOffice crashes and crashes desktop too on inserting 4th slide
14 class insertSlide(UITestCase):
16 def test_insert_slide(self):
17 with self.ui_test.create_doc_in_start_center("impress") as document:
18 xTemplateDlg = self.xUITest.getTopFocusWindow()
19 xCancelBtn = xTemplateDlg.getChild("close")
20 self.ui_test.close_dialog_through_button(xCancelBtn)
21 self.assertEqual(len(document.DrawPages), 1) #nr. of pages
23 self.xUITest.executeCommand(".uno:InsertPage")
25 #verify
26 self.assertEqual(len(document.DrawPages), 2) #nr. of pages
27 #undo
28 self.xUITest.executeCommand(".uno:Undo")
29 self.assertEqual(len(document.DrawPages), 1) #nr. of pages
31 def test_tdf85360_insert_4th_slide(self):
32 with self.ui_test.create_doc_in_start_center("impress") as document:
33 xTemplateDlg = self.xUITest.getTopFocusWindow()
34 xCancelBtn = xTemplateDlg.getChild("close")
35 self.ui_test.close_dialog_through_button(xCancelBtn)
36 self.assertEqual(len(document.DrawPages), 1) #nr. of pages
38 self.xUITest.executeCommand(".uno:InsertPage")
39 self.xUITest.executeCommand(".uno:InsertPage")
40 self.xUITest.executeCommand(".uno:InsertPage")
41 self.xUITest.executeCommand(".uno:InsertPage")
42 #verify
43 self.assertEqual(len(document.DrawPages), 5) #nr. of pages
44 #undo
45 self.xUITest.executeCommand(".uno:Undo")
46 self.xUITest.executeCommand(".uno:Undo")
47 self.xUITest.executeCommand(".uno:Undo")
48 self.xUITest.executeCommand(".uno:Undo")
49 self.assertEqual(len(document.DrawPages), 1) #nr. of pages
50 # vim: set shiftwidth=4 softtabstop=4 expandtab: