summaryrefslogtreecommitdiff
path: root/sc/qa/uitest/pasteSpecial
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-07-05 13:07:54 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-07-05 14:00:41 +0200
commitbec391133da18e1c7c0e7f3d562bceeb6f93b497 (patch)
tree1286d14d08923b2633e48742c0679ff9c8105a15 /sc/qa/uitest/pasteSpecial
parent89a3caee73c476133af804d9a0a650e72e711d95 (diff)
uitest: sc: move pasteSpecial tests to their own folder
Change-Id: I19dcb65937bb25ccc74f347788a554450fb291f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118410 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/uitest/pasteSpecial')
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf114710.py43
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf118308.py50
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf142932.py56
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf57274.py38
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf62267.py43
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf65856.py86
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf69450.py52
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf84810.py47
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf86253.py49
9 files changed, 464 insertions, 0 deletions
diff --git a/sc/qa/uitest/pasteSpecial/tdf114710.py b/sc/qa/uitest/pasteSpecial/tdf114710.py
new file mode 100644
index 000000000000..e3d772bc8c8d
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf114710.py
@@ -0,0 +1,43 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class tdf114710(UITestCase):
+
+ def test_tdf114710(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf114710.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:O7"}))
+ self.xUITest.executeCommand(".uno:Copy")
+
+ with self.ui_test.load_empty_file("writer") as writer_document:
+
+ self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+
+ xList = xDialog.getChild('list')
+
+ for childName in xList.getChildren():
+ xChild = xList.getChild(childName)
+ if get_state_as_dict(xChild)['Text'] == "Graphics Device Interface metafile (GDI)":
+ break
+
+ xChild.executeAction("SELECT", tuple())
+ self.assertEqual(
+ get_state_as_dict(xList)['SelectEntryText'], "Graphics Device Interface metafile (GDI)")
+
+
+ # Without the fix in place, this test would have crashed here
+ self.assertEqual(1, writer_document.GraphicObjects.getCount())
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
+
diff --git a/sc/qa/uitest/pasteSpecial/tdf118308.py b/sc/qa/uitest/pasteSpecial/tdf118308.py
new file mode 100644
index 000000000000..8ae0f2d6f5d0
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf118308.py
@@ -0,0 +1,50 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+
+class tdf118308(UITestCase):
+
+ def test_tdf118308(self):
+ with self.ui_test.create_doc_in_start_center("calc") as document:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ enter_text_to_cell(gridwin, "A1", "A")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+
+ with self.ui_test.load_empty_file("calc") as calc_document:
+
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+
+ # Without the fix in place, this test would have failed here
+ # since a different dialog would have been opened and the children
+ # wouldn't have been found
+ xText = xDialog.getChild("text")
+ xNumbers = xDialog.getChild("numbers")
+ xDatetime = xDialog.getChild("datetime")
+ xFormats = xDialog.getChild("formats")
+
+ self.assertEqual("true", get_state_as_dict(xText)["Selected"])
+ self.assertEqual("true", get_state_as_dict(xNumbers)["Selected"])
+ self.assertEqual("true", get_state_as_dict(xDatetime)["Selected"])
+ self.assertEqual("false", get_state_as_dict(xFormats)["Selected"])
+
+
+ self.assertEqual("A", get_cell_by_position(calc_document, 0, 0, 0).getString())
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
+
diff --git a/sc/qa/uitest/pasteSpecial/tdf142932.py b/sc/qa/uitest/pasteSpecial/tdf142932.py
new file mode 100644
index 000000000000..9dd51fc31514
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf142932.py
@@ -0,0 +1,56 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_url_for_data_file
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict
+
+class tdf142932(UITestCase):
+
+ def test_tdf142932(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf142932.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:SelectRow")
+
+ self.assertEqual("some comment", get_cell_by_position(calc_doc, 0, 4, 0).Annotation.String)
+
+ self.xUITest.executeCommand(".uno:Copy")
+
+ with self.ui_test.execute_dialog_through_command(".uno:Insert") as xDialog:
+ xAfter = xDialog.getChild('after')
+ xAfter.executeAction("CLICK", tuple())
+ pass
+
+ self.assertEqual(get_state_as_dict(gridwin)["SelectedTable"], "1")
+
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+ xText = xDialog.getChild("text")
+ xComments = xDialog.getChild("comments")
+ xSkipEmpty = xDialog.getChild("skip_empty")
+ self.assertEqual('true', get_state_as_dict(xText)['Selected'])
+ self.assertEqual('false', get_state_as_dict(xComments)['Selected'])
+ xSkipEmpty.executeAction("CLICK", tuple())
+ self.assertEqual('true', get_state_as_dict(xSkipEmpty)['Selected'])
+
+ # Without the fix in place, this test would have crashed here
+
+ self.assertEqual("A", get_cell_by_position(calc_doc, 1, 0, 0).getString())
+ self.assertEqual("row", get_cell_by_position(calc_doc, 1, 1, 0).getString())
+ self.assertEqual("with", get_cell_by_position(calc_doc, 1, 2, 0).getString())
+ self.assertEqual("comment", get_cell_by_position(calc_doc, 1, 3, 0).getString())
+ self.assertEqual("for", get_cell_by_position(calc_doc, 1, 4, 0).getString())
+ self.assertEqual("a", get_cell_by_position(calc_doc, 1, 5, 0).getString())
+ self.assertEqual("certain", get_cell_by_position(calc_doc, 1, 6, 0).getString())
+ self.assertEqual("cell", get_cell_by_position(calc_doc, 1, 7, 0).getString())
+
+ self.assertEqual("", get_cell_by_position(calc_doc, 1, 4, 0).Annotation.String)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/pasteSpecial/tdf57274.py b/sc/qa/uitest/pasteSpecial/tdf57274.py
new file mode 100644
index 000000000000..564060d208a2
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf57274.py
@@ -0,0 +1,38 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_url_for_data_file
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+#Bug: Paste Special Link Checkbox fails to insert cell references when the source cell is blank
+
+class tdf57274(UITestCase):
+
+ def test_tdf57274_tdf116385_row_only(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf57274.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #* Source Cells, range B6..E6
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B6:E6"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B11"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial", close_button="") as xDialog:
+ #We paste here using Paste Special with 'Link' Checkbox activated
+ xLink = xDialog.getChild("link")
+ xLink.executeAction("CLICK", tuple())
+
+ xOkBtn = xDialog.getChild("ok")
+ with self.ui_test.execute_blocking_action(xOkBtn.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #we would expect a reference to cell E6 here and a zero being displayed, but the cell is also simply blank.
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 10).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 10).getFormula(), "=$Sheet1.$E$6")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/pasteSpecial/tdf62267.py b/sc/qa/uitest/pasteSpecial/tdf62267.py
new file mode 100644
index 000000000000..6a569e0f1098
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf62267.py
@@ -0,0 +1,43 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+#Bug 62267 - Conditional formatting lost after paste special of text, numbers and dates.
+#If you have a cell with conditional formatting and you use paste special only inserting only text,
+#numbers and dates the formatting is lost. Undo do not recover the conditional formatting.
+
+class tdf62267(UITestCase):
+
+ def test_tdf62267(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf62267.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #* Copy A1, then paste special to C1;
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+ #it's the default - text, numbers and dates
+ pass
+
+ #--> Cell formatting should stay as before
+ with self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog", close_button="cancel") as xCondFormatMgr:
+
+
+ # check that we have exactly 1 conditional format
+ xList = xCondFormatMgr.getChild("CONTAINER")
+ list_state = get_state_as_dict(xList)
+ self.assertEqual(list_state['Children'], '1')
+
+ xTreeEntry = xList.getChild('0')
+ self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], "A1\tCell value = 1")
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/pasteSpecial/tdf65856.py b/sc/qa/uitest/pasteSpecial/tdf65856.py
new file mode 100644
index 000000000000..e66a02597af1
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf65856.py
@@ -0,0 +1,86 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_url_for_data_file
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from libreoffice.calc.document import get_cell_by_position
+
+class tdf65856(UITestCase):
+
+ def test_tdf65856_paste_special_shift_right(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf65856.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #- mark D1:E14; copy
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "D1:E14"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ #mark cell D1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+
+ xmove_right = xDialog.getChild("move_right")
+ xmove_right.executeAction("CLICK", tuple())
+
+
+ #check
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 0).getString(), "T1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getString(), "TE1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 0).getString(), "TES1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 0).getString(), "TEST1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 0).getString(), "TEST1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 0).getString(), "TEST1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 0).getString(), "TEST1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 13).getString(), "T14")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 13).getString(), "TE14")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 13).getString(), "TES14")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 13).getString(), "TEST14")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 13).getString(), "TEST14")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 13).getString(), "TEST14")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 13).getString(), "TEST14")
+
+ def test_tdf65856_paste_special_shift_right_2(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf65856_2.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #- select range C2:D4; copy
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C2:D4"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ #mark cell B2
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+
+ xmove_right = xDialog.getChild("move_right")
+ xmove_right.executeAction("CLICK", tuple())
+
+
+ #check
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 1).getFormula(), "=D2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 1).getFormula(), "=D2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 2).getFormula(), "=E3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 2).getFormula(), "=E3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 3).getFormula(), "=F4")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 3).getFormula(), "=F4")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
+
diff --git a/sc/qa/uitest/pasteSpecial/tdf69450.py b/sc/qa/uitest/pasteSpecial/tdf69450.py
new file mode 100644
index 000000000000..01148f39655b
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf69450.py
@@ -0,0 +1,52 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+
+class tdf69450(UITestCase):
+
+ def test_tdf69450(self):
+ with self.ui_test.create_doc_in_start_center("calc") as document:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #add text to A1 and B1
+ enter_text_to_cell(gridwin, "A1", "A")
+ enter_text_to_cell(gridwin, "B1", "B")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+
+ xtext = xDialog.getChild("text")
+ xnumbers = xDialog.getChild("numbers")
+ xdatetime = xDialog.getChild("datetime")
+ xformats = xDialog.getChild("formats")
+
+ xtext.executeAction("CLICK", tuple())
+ xnumbers.executeAction("CLICK", tuple())
+ xdatetime.executeAction("CLICK", tuple())
+ xformats.executeAction("CLICK", tuple())
+
+
+ #check B1 text
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
+ self.xUITest.executeCommand(".uno:Bold")
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial"):
+ pass
+
+ #check B1 text
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
+
diff --git a/sc/qa/uitest/pasteSpecial/tdf84810.py b/sc/qa/uitest/pasteSpecial/tdf84810.py
new file mode 100644
index 000000000000..c4504492fe6f
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf84810.py
@@ -0,0 +1,47 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from uitest.framework import UITestCase
+
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+from uitest.uihelper.calc import enter_text_to_cell
+
+
+class ManualCalcTests(UITestCase):
+ def test_paste_special(self):
+ # EN-8:Paste special with options
+ # This test is to check that paste special combined with some options and link is ok.
+ # Refers to tdf#84810
+
+ with self.ui_test.create_doc_in_start_center("calc") as document:
+
+ # Write text to cell A1
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ enter_text_to_cell(xGridWin, "A1", "abcd")
+
+ # Copy cell A1 to clipboard
+ xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+
+ # Set cursor to cell A3
+ xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+
+ # Choose Paste Special Options and paste data
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg:
+ xAllChkBox = xPasteSpecialDlg.getChild("paste_all")
+ xAllChkBox.executeAction("CLICK", tuple())
+ xLinkChkBox = xPasteSpecialDlg.getChild("link")
+ xLinkChkBox.executeAction("CLICK", tuple())
+
+ # Assert successful paste
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "abcd")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/pasteSpecial/tdf86253.py b/sc/qa/uitest/pasteSpecial/tdf86253.py
new file mode 100644
index 000000000000..66456523dfac
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf86253.py
@@ -0,0 +1,49 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class tdf86253(UITestCase):
+
+ def test_tdf86253(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf86253.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #* Copy A1, then paste special only "formatting" to C1:C17;
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:C17"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+
+ xtext = xDialog.getChild("text")
+ xnumbers = xDialog.getChild("numbers")
+ xdatetime = xDialog.getChild("datetime")
+ xformats = xDialog.getChild("formats")
+
+ xtext.executeAction("CLICK", tuple())
+ xnumbers.executeAction("CLICK", tuple())
+ xdatetime.executeAction("CLICK", tuple())
+ xformats.executeAction("CLICK", tuple())
+
+
+ #--> Cell formatting for C1:C17 is changed. But, if you go to "Format - Conditional Formatting - Manage",
+ #you will see that a new formatting condition is created with the range "C1:C6", rather than "C1:C17". This is wrong behavior.
+ with self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog", close_button="cancel") as xCondFormatMgr:
+
+
+ # check that we have exactly 1 conditional format and range is C1:C17
+ xList = xCondFormatMgr.getChild("CONTAINER")
+ list_state = get_state_as_dict(xList)
+ self.assertEqual(list_state['Children'], '1')
+
+ xTreeEntry = xList.getChild('0')
+ self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], "A1:A6,C1:C17\tCell value >= 0")
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: