diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-06-13 17:17:05 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-06-13 21:33:01 +0200 |
commit | 77a28966f06a7f872b305ff8e2c603e675a5c8d1 (patch) | |
tree | 883de8d67f1453748f0644743641a087f6101edd /sc/qa/uitest | |
parent | 31bf1a7f18de43014700869910767c8264cbd743 (diff) |
uitest: sc: reset values in paste special dialog
in preparation for https://gerrit.libreoffice.org/c/core/+/135110
Change-Id: I0bfa8ddd9b814239a0e284b1b219cf760ee34826
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135733
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/uitest')
-rw-r--r-- | sc/qa/uitest/pasteSpecial/tdf118308.py | 12 | ||||
-rw-r--r-- | sc/qa/uitest/pasteSpecial/tdf142932.py | 7 | ||||
-rw-r--r-- | sc/qa/uitest/pasteSpecial/tdf57274.py | 2 | ||||
-rw-r--r-- | sc/qa/uitest/pasteSpecial/tdf62267.py | 5 | ||||
-rw-r--r-- | sc/qa/uitest/pasteSpecial/tdf65856.py | 5 | ||||
-rw-r--r-- | sc/qa/uitest/pasteSpecial/tdf69450.py | 3 | ||||
-rw-r--r-- | sc/qa/uitest/pasteSpecial/tdf84810.py | 4 | ||||
-rw-r--r-- | sc/qa/uitest/pasteSpecial/tdf86253.py | 3 |
8 files changed, 19 insertions, 22 deletions
diff --git a/sc/qa/uitest/pasteSpecial/tdf118308.py b/sc/qa/uitest/pasteSpecial/tdf118308.py index 130814710ef4..0c0f3689b742 100644 --- a/sc/qa/uitest/pasteSpecial/tdf118308.py +++ b/sc/qa/uitest/pasteSpecial/tdf118308.py @@ -11,6 +11,7 @@ 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 +from libreoffice.calc.paste_special import reset_default_values class tdf118308(UITestCase): @@ -35,16 +36,7 @@ class tdf118308(UITestCase): # 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"]) - + reset_default_values(self, xDialog) self.assertEqual("A", get_cell_by_position(calc_document, 0, 0, 0).getString()) diff --git a/sc/qa/uitest/pasteSpecial/tdf142932.py b/sc/qa/uitest/pasteSpecial/tdf142932.py index 7e75cf0aff71..18e45f2b55bc 100644 --- a/sc/qa/uitest/pasteSpecial/tdf142932.py +++ b/sc/qa/uitest/pasteSpecial/tdf142932.py @@ -11,6 +11,7 @@ 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 +from libreoffice.calc.paste_special import reset_default_values class tdf142932(UITestCase): @@ -33,11 +34,9 @@ class tdf142932(UITestCase): 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") + reset_default_values(self, xDialog) + 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']) diff --git a/sc/qa/uitest/pasteSpecial/tdf57274.py b/sc/qa/uitest/pasteSpecial/tdf57274.py index 0a323d93f0fe..977c06393836 100644 --- a/sc/qa/uitest/pasteSpecial/tdf57274.py +++ b/sc/qa/uitest/pasteSpecial/tdf57274.py @@ -10,6 +10,7 @@ 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 libreoffice.calc.paste_special import reset_default_values #Bug: Paste Special Link Checkbox fails to insert cell references when the source cell is blank @@ -25,6 +26,7 @@ class tdf57274(UITestCase): 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: + reset_default_values(self, xDialog) #We paste here using Paste Special with 'Link' Checkbox activated xLink = xDialog.getChild("link") xLink.executeAction("CLICK", tuple()) diff --git a/sc/qa/uitest/pasteSpecial/tdf62267.py b/sc/qa/uitest/pasteSpecial/tdf62267.py index bd11b98191b1..608875db49e2 100644 --- a/sc/qa/uitest/pasteSpecial/tdf62267.py +++ b/sc/qa/uitest/pasteSpecial/tdf62267.py @@ -9,6 +9,7 @@ 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 +from libreoffice.calc.paste_special import reset_default_values #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, @@ -25,8 +26,8 @@ class tdf62267(UITestCase): 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"): - #it's the default - text, numbers and dates + with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog: + reset_default_values(self, xDialog) pass #--> Cell formatting should stay as before diff --git a/sc/qa/uitest/pasteSpecial/tdf65856.py b/sc/qa/uitest/pasteSpecial/tdf65856.py index 32ec6205c8e5..7a3b1f90e21b 100644 --- a/sc/qa/uitest/pasteSpecial/tdf65856.py +++ b/sc/qa/uitest/pasteSpecial/tdf65856.py @@ -10,6 +10,7 @@ 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 +from libreoffice.calc.paste_special import reset_default_values class tdf65856(UITestCase): @@ -24,11 +25,11 @@ class tdf65856(UITestCase): #mark cell D1 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"})) with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog: + reset_default_values(self, 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") @@ -56,11 +57,11 @@ class tdf65856(UITestCase): #mark cell B2 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"})) with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog: + reset_default_values(self, 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") diff --git a/sc/qa/uitest/pasteSpecial/tdf69450.py b/sc/qa/uitest/pasteSpecial/tdf69450.py index 966ad8a4d80c..133a4f67823a 100644 --- a/sc/qa/uitest/pasteSpecial/tdf69450.py +++ b/sc/qa/uitest/pasteSpecial/tdf69450.py @@ -10,6 +10,7 @@ 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 +from libreoffice.calc.paste_special import reset_default_values class tdf69450(UITestCase): @@ -25,6 +26,7 @@ class tdf69450(UITestCase): self.xUITest.executeCommand(".uno:Copy") gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"})) with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog: + reset_default_values(self, xDialog) xtext = xDialog.getChild("text") xnumbers = xDialog.getChild("numbers") @@ -36,7 +38,6 @@ class tdf69450(UITestCase): xdatetime.executeAction("CLICK", tuple()) xformats.executeAction("CLICK", tuple()) - #check B1 text self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B") diff --git a/sc/qa/uitest/pasteSpecial/tdf84810.py b/sc/qa/uitest/pasteSpecial/tdf84810.py index c4504492fe6f..95d72df17a59 100644 --- a/sc/qa/uitest/pasteSpecial/tdf84810.py +++ b/sc/qa/uitest/pasteSpecial/tdf84810.py @@ -11,9 +11,8 @@ 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 - +from libreoffice.calc.paste_special import reset_default_values class ManualCalcTests(UITestCase): def test_paste_special(self): @@ -36,6 +35,7 @@ class ManualCalcTests(UITestCase): # Choose Paste Special Options and paste data with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: + reset_default_values(self, xPasteSpecialDlg) xAllChkBox = xPasteSpecialDlg.getChild("paste_all") xAllChkBox.executeAction("CLICK", tuple()) xLinkChkBox = xPasteSpecialDlg.getChild("link") diff --git a/sc/qa/uitest/pasteSpecial/tdf86253.py b/sc/qa/uitest/pasteSpecial/tdf86253.py index 7e8ab372bd6c..6e6e1bcd4983 100644 --- a/sc/qa/uitest/pasteSpecial/tdf86253.py +++ b/sc/qa/uitest/pasteSpecial/tdf86253.py @@ -9,6 +9,7 @@ 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 +from libreoffice.calc.paste_special import reset_default_values class tdf86253(UITestCase): @@ -22,6 +23,7 @@ class tdf86253(UITestCase): self.xUITest.executeCommand(".uno:Copy") gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:C17"})) with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog: + reset_default_values(self, xDialog) xtext = xDialog.getChild("text") xnumbers = xDialog.getChild("numbers") @@ -47,5 +49,4 @@ class tdf86253(UITestCase): 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: |