sc/qa/uitest/search_replace/data/tdf39959.ods |binary sc/qa/uitest/search_replace/tdf39959.py | 61 ++++++++++++++++++++++++++ 2 files changed, 61 insertions(+)
New commits: commit 3acc80fe226df82738b5738d018532913bbc432d Author: Zdeněk Crhonek <zcrho...@gmail.com> AuthorDate: Mon Dec 31 15:45:27 2018 +0100 Commit: Zdenek Crhonek <zcrho...@gmail.com> CommitDate: Mon Dec 31 17:34:26 2018 +0100 uitest for bug tdf#39959 Change-Id: Ibe33f5fd3e66f53815429eaeaea5d64fc4984730 Reviewed-on: https://gerrit.libreoffice.org/65774 Tested-by: Jenkins Reviewed-by: Zdenek Crhonek <zcrho...@gmail.com> diff --git a/sc/qa/uitest/search_replace/data/tdf39959.ods b/sc/qa/uitest/search_replace/data/tdf39959.ods new file mode 100644 index 000000000000..971bf877c653 Binary files /dev/null and b/sc/qa/uitest/search_replace/data/tdf39959.ods differ diff --git a/sc/qa/uitest/search_replace/tdf39959.py b/sc/qa/uitest/search_replace/tdf39959.py new file mode 100644 index 000000000000..28b056a92470 --- /dev/null +++ b/sc/qa/uitest/search_replace/tdf39959.py @@ -0,0 +1,61 @@ +# -*- 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 uitest.uihelper.common import select_pos +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import get_state_as_dict, type_text +from uitest.debug import sleep +# import org.libreoffice.unotest +# import pathlib +from uitest.path import get_srcdir_url + +def get_url_for_data_file(file_name): +# return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() + return get_srcdir_url() + "/sc/qa/uitest/search_replace/data/" + file_name + +#Bug 39959 - Find-and-replace doesn't search all tables anymore + +class tdf39959(UITestCase): + def test_tdf39959_find_replace_all_sheets(self): + calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf39959.ods")) + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + # 1. Open a new document + # 2. Enter "asdf" in A1 + # 3. Activate Sheet2 + # 4. Try Find-and-replace (Ctrl+Alt+F) to search for "asdf" + # Whether the checkbox "in allen Tabellen suchen" is activated or not: LibO Calc never seems to find the text + + self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog") + xDialog = self.xUITest.getTopFocusWindow() + searchterm = xDialog.getChild("searchterm") + searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"asdf"})) + replaceterm = xDialog.getChild("replaceterm") + replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"bbb"})) #replace textbox + allsheets = xDialog.getChild("allsheets") + allsheets.executeAction("CLICK", tuple()) + replaceall = xDialog.getChild("replaceall") + replaceall.executeAction("CLICK", tuple()) + # print(xDialog.getChildren()) + xcloseBtn = xDialog.getChild("close") + self.ui_test.close_dialog_through_button(xcloseBtn) + + #verify Sheet2.A1 = "bbb" + self.assertEqual(get_cell_by_position(document, 1, 0, 0).getString(), "bbb ") + self.assertEqual(get_cell_by_position(document, 1, 0, 2).getString(), "abc") + #Undo + self.xUITest.executeCommand(".uno:Undo") + self.assertEqual(get_cell_by_position(document, 1, 0, 0).getString(), "asdf ") + self.ui_test.close_doc() +# vim: set shiftwidth=4 softtabstop=4 expandtab: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits