From e89debccbbe7029ebf97b934cf0dee3c15c53b22 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Thu, 4 Feb 2021 11:40:26 +0100 Subject: [PATCH] sc: uitest: Add test for cf93998eb5abc193d95ae5433bf4dfd11a9d62d8 Change-Id: I063b4999ad9d04ec658da923e088e16c5edd507e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110405 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- sc/qa/uitest/calc_tests9/pivotTable.py | 92 +++++++++++++++++++++++++ sc/qa/uitest/data/basicPivotTable.ods | Bin 0 -> 9472 bytes 2 files changed, 92 insertions(+) create mode 100644 sc/qa/uitest/calc_tests9/pivotTable.py create mode 100644 sc/qa/uitest/data/basicPivotTable.ods diff --git a/sc/qa/uitest/calc_tests9/pivotTable.py b/sc/qa/uitest/calc_tests9/pivotTable.py new file mode 100644 index 000000000000..d85894bf9af6 --- /dev/null +++ b/sc/qa/uitest/calc_tests9/pivotTable.py @@ -0,0 +1,92 @@ +# -*- 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_state_as_dict, get_url_for_data_file + +class pivotTable(UITestCase): + + def test_cancelButton(self): + + # This is basically a test for cf93998eb5abc193d95ae5433bf4dfd11a9d62d8 + # Without the fix in place, this test would have crashed + + self.ui_test.load_file(get_url_for_data_file("basicPivotTable.ods")) + + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + gridwin.executeAction("SELECT", mkPropertyValues({"TABLE": "1"})) + + self.xUITest.executeCommand(".uno:GoUp") + + + self.ui_test.execute_dialog_through_command(".uno:DataDataPilotRun") + + xDialog = self.xUITest.getTopFocusWindow() + + xFields = xDialog.getChild("listbox-fields") + self.assertEqual(2, len(xFields.getChildren())) + self.assertEqual("qtX", get_state_as_dict(xFields.getChild('0'))['Text']) + self.assertEqual("qtY", get_state_as_dict(xFields.getChild('1'))['Text']) + + xColumns = xDialog.getChild("listbox-column") + self.assertEqual(1, len(xColumns.getChildren())) + self.assertEqual("Data", get_state_as_dict(xColumns.getChild('0'))['Text']) + + xPage = xDialog.getChild("listbox-page") + self.assertEqual(1, len(xPage.getChildren())) + xPageChild = xPage.getChild('0') + self.assertEqual("qtX", get_state_as_dict(xPageChild)['Text']) + + def handle_dataField_dialog(dialog): + optionBtn = dialog.getChild("options") + + def handle_options_dialog_first_time(dialog2): + xEmptyLine = dialog2.getChild("emptyline") + + xEmptyLine.executeAction("CLICK", tuple()) + self.assertEqual('true', get_state_as_dict(xEmptyLine)['Selected']) + + xOKBtn = dialog2.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + def handle_options_dialog_second_time(dialog2): + xEmptyLine = dialog2.getChild("emptyline") + + xEmptyLine.executeAction("CLICK", tuple()) + self.assertEqual('false', get_state_as_dict(xEmptyLine)['Selected']) + + xCancelBtn = dialog2.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + + def handle_options_dialog_third_time(dialog2): + xEmptyLine = dialog2.getChild("emptyline") + + self.assertEqual('true', get_state_as_dict(xEmptyLine)['Selected']) + + xOKBtn = dialog2.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + self.ui_test.execute_blocking_action(optionBtn.executeAction, args=('CLICK', ()), + dialog_handler=handle_options_dialog_first_time) + + self.ui_test.execute_blocking_action(optionBtn.executeAction, args=('CLICK', ()), + dialog_handler=handle_options_dialog_second_time) + + self.ui_test.execute_blocking_action(optionBtn.executeAction, args=('CLICK', ()), + dialog_handler=handle_options_dialog_third_time) + + xOkBtn = dialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOkBtn) + + self.ui_test.execute_blocking_action(xPageChild.executeAction, args=('DOUBLECLICK', ()), + dialog_handler=handle_dataField_dialog) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/data/basicPivotTable.ods b/sc/qa/uitest/data/basicPivotTable.ods new file mode 100644 index 0000000000000000000000000000000000000000..27487fd05a11f0fa28b53e56b5c077c7cf5a7635 GIT binary patch literal 9472 zcmdUVby!sGw>BXqC{iMgbR&pJx6~jV64C<f)v4IjMU z^&a&-`kwRq^Q^h{%(G|qy4SPU-m}(T>$&9ti1%>e;85YWK{?zY>n z;4DBEK!~FiP|wQB9Auye0a=1sp0Y2yZ>;GcPjt6wYxc5>4Aaf|FEWHAz$+l2@dXVyE`{!6FUoiupY?VmKE~% zki`mY>?bcP@!&q;{o6wxNJ)w*-hS5KZa1iix9{Pxv_LpG_)~cqsY$|`Tv-e{_8C~2F#Q8!S33sMI; z0Tso7YH~)Jav*gXeRVYh4Goai8(keeGhJ1Xz7Et-$;$8z)Ktg#R*X!*V6cH1)YRO@ z!q(p2Ob=pV=4h_xZe<9CLT#PhTwPs(5D!zR2h`QW)i>NNAkHZ$#nal*)6Uc%3Jh`q zdpTPNyIK2tIz__lqkP@tee4tbol=9HQ$yW6J-uK){vjbD?*k)3VX)AkfXK+m*tn0L z;pzUdslKuKKJmr=No4`a6%pyBq3PApd5y^-?+aqQQj$^%(_+d~0_!rv>IxE4Q&ZD2 zb2D>`a&vN1OF!k7H&&J8Hxws-D$A>=Ypk!YkIrw3$!|(8Z%wJ_&aCMwXdEo7ZK-K! zu5aloX&Wu;n5u0bt{<3d&X4Y?O6{vjZ>}vH{**ORpWW2h)ZYB5zqN9!;YihWAY;0_5Vx)U!V`zS3dTDKDd2@Ds|I2Xm%2fZ_ z?9k%;{QAPg=IZ>HubaCYOW$^P7B>&pxA)e*pM2Xp+CDu$-d;S~-MH9YKHb~6I{kKZ ze0*?nesF$yak77Pet3O-eRmt&+`N=WK!bxr7?u(fR(6=){){GvBmBf?@A2?^iMN5N z`l#@GECG_w7)aB_w_d#}Kv~4oYNzu@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