diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-25 11:50:51 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-25 14:22:30 +0100 |
commit | 3421440bfbfff7c59caea881be64b684e601e04f (patch) | |
tree | a29e8e1e7d919d6d504357e61bc72d3db07a9093 | |
parent | 861ca1f5030f2f6b7fbdc3bb3ded3d11130673ed (diff) |
tdf#98690: sc: Add UItest
Change-Id: I19695798fa693b05d48d69514a037368241f696a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111525
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sc/qa/uitest/chart/tdf98690.py | 45 | ||||
-rw-r--r-- | sc/qa/uitest/data/tdf98690.xlsx | bin | 0 -> 17975 bytes |
2 files changed, 45 insertions, 0 deletions
diff --git a/sc/qa/uitest/chart/tdf98690.py b/sc/qa/uitest/chart/tdf98690.py new file mode 100644 index 000000000000..d70b66ee4214 --- /dev/null +++ b/sc/qa/uitest/chart/tdf98690.py @@ -0,0 +1,45 @@ +# -*- 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.common import get_url_for_data_file + +class tdf98690(UITestCase): + + def test_tdf98690(self): + calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf98690.xlsx")) + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Chart 2"})) + + self.xUITest.executeCommand(".uno:Copy") + + self.ui_test.close_doc() + + self.ui_test.load_empty_file("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + self.xUITest.executeCommand(".uno:Paste") + + xData = document.Sheets[0].Charts[0].getEmbeddedObject().Data + + aExpectedRowDescriptions = tuple(str(i) for i in range(1, 14)) + aExpectedColumnDescriptions = ('Column D Column D', 'cc_girder2', 'Column S Column S', + 'Column S Column S', 'Column D Column D', 'clexrfdon', 'Column S Column S', + 'Column S Column S', 'Column D', 'clexrfdoff', 'Column S Column S', 'Column S Column S') + + # Without the fix in place, this test would have failed here, + # since the pasted chart wouldn't have had any data + self.assertEqual(aExpectedRowDescriptions, xData.RowDescriptions) + self.assertEqual(aExpectedColumnDescriptions, xData.ColumnDescriptions) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/data/tdf98690.xlsx b/sc/qa/uitest/data/tdf98690.xlsx Binary files differnew file mode 100644 index 000000000000..4269afa9eadd --- /dev/null +++ b/sc/qa/uitest/data/tdf98690.xlsx |