Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / sd / qa / uitest / impress_tests / insertSlide.py
blob396079d3fa7dc19570e789eb59205ba037ccb8d4
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from uitest.framework import UITestCase
8 from libreoffice.uno.propertyvalue import mkPropertyValues
9 from uitest.uihelper.common import get_state_as_dict
10 import time
11 from uitest.debug import sleep
12 from uitest.uihelper.common import select_pos
13 #Bug 85360 - LibreOffice crashes and crashes desktop too on inserting 4th slide
15 class insertSlide(UITestCase):
17 def test_insert_slide(self):
18 self.ui_test.create_doc_in_start_center("impress")
19 xTemplateDlg = self.xUITest.getTopFocusWindow()
20 xCancelBtn = xTemplateDlg.getChild("cancel")
21 self.ui_test.close_dialog_through_button(xCancelBtn)
22 document = self.ui_test.get_component()
23 self.assertEqual(document.DrawPages.getCount(), 1) #nr. of pages
25 self.xUITest.executeCommand(".uno:InsertPage")
27 #verify
28 self.assertEqual(document.DrawPages.getCount(), 2) #nr. of pages
29 #undo
30 self.xUITest.executeCommand(".uno:Undo")
31 self.assertEqual(document.DrawPages.getCount(), 1) #nr. of pages
32 self.ui_test.close_doc()
34 def test_tdf85360_insert_4th_slide(self):
35 self.ui_test.create_doc_in_start_center("impress")
36 xTemplateDlg = self.xUITest.getTopFocusWindow()
37 xCancelBtn = xTemplateDlg.getChild("cancel")
38 self.ui_test.close_dialog_through_button(xCancelBtn)
39 document = self.ui_test.get_component()
40 self.assertEqual(document.DrawPages.getCount(), 1) #nr. of pages
42 self.xUITest.executeCommand(".uno:InsertPage")
43 self.xUITest.executeCommand(".uno:InsertPage")
44 self.xUITest.executeCommand(".uno:InsertPage")
45 self.xUITest.executeCommand(".uno:InsertPage")
46 #verify
47 self.assertEqual(document.DrawPages.getCount(), 5) #nr. of pages
48 #undo
49 self.xUITest.executeCommand(".uno:Undo")
50 self.xUITest.executeCommand(".uno:Undo")
51 self.xUITest.executeCommand(".uno:Undo")
52 self.xUITest.executeCommand(".uno:Undo")
53 self.assertEqual(document.DrawPages.getCount(), 1) #nr. of pages
54 self.ui_test.close_doc()
55 # vim: set shiftwidth=4 softtabstop=4 expandtab: