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 uitest
.uihelper
.common
import get_state_as_dict
9 from uitest
.uihelper
.common
import select_pos
10 from uitest
.uihelper
.calc
import enter_text_to_cell
11 from libreoffice
.calc
.document
import get_cell_by_position
12 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
13 from uitest
.uihelper
.common
import get_state_as_dict
, type_text
14 from uitest
.debug
import sleep
15 import org
.libreoffice
.unotest
18 def get_url_for_data_file(file_name
):
19 return pathlib
.Path(org
.libreoffice
.unotest
.makeCopyFromTDOC(file_name
)).as_uri()
21 #Bug 124816 - CRASH: inserting a new row
23 class tdf124816(UITestCase
):
24 def test_tdf124816_crash_inserting_new_row(self
):
25 calc_doc
= self
.ui_test
.load_file(get_url_for_data_file("tdf124816.xlsx"))
26 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
27 gridwin
= xCalcDoc
.getChild("grid_window")
28 document
= self
.ui_test
.get_component()
30 #Go to Sheet - Insert Row - Insert row before
31 self
.xUITest
.executeCommand(".uno:InsertRowsBefore")
32 self
.xUITest
.executeCommand(".uno:Undo")
34 self
.assertEqual(get_cell_by_position(document
, 0, 1, 0).getString(), "1")
35 self
.ui_test
.close_doc()
36 # vim: set shiftwidth=4 softtabstop=4 expandtab: