tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / sc / qa / uitest / conditional_format / tdf118206.py
blobefbebdd60462dc99a33bef4b99112a318909f797
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/.
9 from uitest.framework import UITestCase
10 from uitest.uihelper.common import get_url_for_data_file
12 from libreoffice.calc.document import get_cell_by_position
13 from libreoffice.uno.propertyvalue import mkPropertyValues
16 # Bug 118206 - [GTK3] Calc hangs copying/cutting a conditional format column
17 class tdf118206(UITestCase):
18 def test_tdf118206(self):
19 with self.ui_test.load_file(get_url_for_data_file("tdf118206.xlsx")) as calc_doc:
20 xCalcDoc = self.xUITest.getTopFocusWindow()
21 gridwin = xCalcDoc.getChild("grid_window")
22 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
23 self.xUITest.executeCommand(".uno:SelectColumn")
24 self.xUITest.executeCommand(".uno:Copy")
25 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
26 self.xUITest.executeCommand(".uno:SelectColumn")
27 self.xUITest.executeCommand(".uno:Paste")
29 #verify
30 self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getString(), "On Back Order")
31 self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getValue(), 0)
32 self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 7).getValue(), 1)
34 #Undo
35 self.xUITest.executeCommand(".uno:Undo")
36 self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 0).getString(), "On Back Order")
37 self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 1).getValue(), 0)
38 self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 7).getValue(), 1)
39 self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getString(), "")
40 self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getString(), "")
41 self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 7).getString(), "")
43 # vim: set shiftwidth=4 softtabstop=4 expandtab: