summaryrefslogtreecommitdiffstats
path: root/sc/qa/uitest/conditional_format/tdf104026.py
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/uitest/conditional_format/tdf104026.py')
-rw-r--r--sc/qa/uitest/conditional_format/tdf104026.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/sc/qa/uitest/conditional_format/tdf104026.py b/sc/qa/uitest/conditional_format/tdf104026.py
new file mode 100644
index 000000000..2d8c5fc66
--- /dev/null
+++ b/sc/qa/uitest/conditional_format/tdf104026.py
@@ -0,0 +1,45 @@
+# -*- 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.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+
+class Tdf104026(UITestCase):
+
+ def execute_conditional_format_manager_dialog(self, nCount):
+
+ with self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog") as xCondFormatMgr:
+
+ aExpectedResults = ['A2\tCell value != $Sheet1.$B2', 'A3\tCell value != $Sheet1.$B3',
+ 'A4\tCell value != $Sheet1.$B4', 'A5\tCell value != $Sheet1.$B5',
+ 'A6\tCell value != $Sheet1.$B6', 'A7\tCell value != $Sheet1.$B7']
+
+ xList = xCondFormatMgr.getChild("CONTAINER")
+ self.assertEqual(nCount, len(xList.getChildren()))
+
+ for i in range(nCount):
+ self.assertEqual(aExpectedResults[i], get_state_as_dict(xList.getChild(str(i)))['Text'])
+
+
+ def test_tdf104026(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf104026.ods")):
+
+ self.execute_conditional_format_manager_dialog(6)
+
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
+
+ self.xUITest.executeCommand(".uno:DeleteRows")
+
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'A2\tCell value != $Sheet1.$B2' != 'A2\tCell value != $Sheet1.$B#REF!'
+ self.execute_conditional_format_manager_dialog(5)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: