Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / qa / uitest / calc_tests8 / tdf119343.py
blob82c0e11b4d3986d7d7eabb09b83b2d48fbf2d6ed
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_sheet_from_doc
12 from libreoffice.calc.conditional_format import get_conditional_format_from_sheet
13 from uitest.debug import sleep
14 from libreoffice.calc.document import get_cell_by_position
15 from libreoffice.uno.propertyvalue import mkPropertyValues
16 import org.libreoffice.unotest
17 import pathlib
18 from uitest.path import get_srcdir_url
19 def get_url_for_data_file(file_name):
20 return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
22 #Bug 119343 - EDITING: copied and pasted cells containing formulas are not recalculated (2)
24 class tdf119343(UITestCase):
25 def test_tdf119343_copy_paste_formula(self):
26 #numberingformatpage.ui
27 calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf119343.ods"))
28 xCalcDoc = self.xUITest.getTopFocusWindow()
29 gridwin = xCalcDoc.getChild("grid_window")
30 document = self.ui_test.get_component()
32 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "M295"}))
33 self.xUITest.executeCommand(".uno:Copy")
34 gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
35 self.xUITest.executeCommand(".uno:Paste")
36 #verify
37 self.assertEqual(get_cell_by_position(document, 0, 12, 295).getString(), "Q11005355")
38 self.assertEqual(get_cell_by_position(document, 0, 12, 294).getString(), "Q1099565")
39 self.assertEqual(get_cell_by_position(document, 0, 12, 293).getString(), "Q108420")
41 self.ui_test.close_doc()
42 # vim: set shiftwidth=4 softtabstop=4 expandtab: