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
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")
28 self
.assertEqual(document
.DrawPages
.getCount(), 2) #nr. of pages
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")
47 self
.assertEqual(document
.DrawPages
.getCount(), 5) #nr. of pages
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: