Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / qa / uitest / calc_tests2 / tdf114992.py
blob0e4b30c2ae9e47d97d5bb8407046139b46370f41
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 import org.libreoffice.unotest
9 import pathlib
10 #Bug: Delete a sheet in a calc document and LO crashes
11 def get_url_for_data_file(file_name):
12 return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
14 class tdf114992(UITestCase):
15 def test_tdf114992_delete_sheet_crash(self):
16 calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf114992.ods"))
17 xCalcDoc = self.xUITest.getTopFocusWindow()
18 gridwin = xCalcDoc.getChild("grid_window")
19 document = self.ui_test.get_component()
21 self.ui_test.execute_dialog_through_command(".uno:Remove") #delete sheet
22 xDialog = self.xUITest.getTopFocusWindow()
23 xOKButton = xDialog.getChild("yes")
24 xOKButton.executeAction("CLICK", tuple())
26 self.assertEqual(document.Sheets.getCount(), 1)
27 self.xUITest.executeCommand(".uno:Undo")
28 self.assertEqual(document.Sheets.getCount(), 2)
30 self.ui_test.close_doc()
32 # vim: set shiftwidth=4 softtabstop=4 expandtab: