diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-12-04 11:52:23 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-12-04 15:03:03 +0100 |
commit | 14fd379f54c0a325d33e1c33c699de4d0f3ffe7f (patch) | |
tree | 621de5f5a566d6325d0b0bcccf96c89bd467ba44 /sw | |
parent | 20831559b8ca8c0b171db2a74889c90a1414b7ab (diff) |
UITest_writer_tests8: do not use custom configuration
Added with b6e273aaaf597b60f78c1dd3db8676eea958a9f5
"tdf#156243 Fix off-by-one bug for autocorrect"
Change-Id: Ib9ce030cbc83514db174c39f5688d7382698d874
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160297
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/UITest_writer_tests8.mk | 2 | ||||
-rw-r--r-- | sw/qa/uitest/writer_tests8/tdf156243.py | 53 | ||||
-rw-r--r-- | sw/qa/uitest/writer_tests8_data/registrymodifications.xcu | 12 |
3 files changed, 36 insertions, 31 deletions
diff --git a/sw/UITest_writer_tests8.mk b/sw/UITest_writer_tests8.mk index a33fdedbe255..c951163c2128 100644 --- a/sw/UITest_writer_tests8.mk +++ b/sw/UITest_writer_tests8.mk @@ -15,6 +15,4 @@ $(eval $(call gb_UITest_set_defs,writer_tests8, \ TDOC="$(SRCDIR)/sw/qa/uitest/data" \ )) -$(eval $(call gb_UITest_use_configuration,writer_tests8,$(SRCDIR)/sw/qa/uitest/writer_tests8_data/registrymodifications.xcu)) - # vim: set noet sw=4 ts=4: diff --git a/sw/qa/uitest/writer_tests8/tdf156243.py b/sw/qa/uitest/writer_tests8/tdf156243.py index fc4eecffdb7c..461c9b508b86 100644 --- a/sw/qa/uitest/writer_tests8/tdf156243.py +++ b/sw/qa/uitest/writer_tests8/tdf156243.py @@ -15,25 +15,44 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class tdf156243(UITestCase): - def test_tdf156243_Autocorrect_dialog(self): + def change_autocorrect_option(self, enabled): + with self.ui_test.execute_dialog_through_command(".uno:AutoCorrectDlg") as xDialog: + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "2") + xList = xDialog.getChild('list') + xCheckbox = xList.getChild("3") + self.assertEqual("Automatic *bold*, /italic/, -strikeout- and _underline_", get_state_as_dict(xCheckbox)["Text"]) + + xCheckbox.executeAction("CLICK", tuple()) + self.assertEqual(enabled, get_state_as_dict(xCheckbox)["IsChecked"]) + + def test_tdf156243_Autocorrect_dialog(self): with self.ui_test.create_doc_in_start_center("writer") as document: xWriterDoc = self.xUITest.getTopFocusWindow() xWriterEdit = xWriterDoc.getChild("writer_edit") - type_text(xWriterEdit, "*ab*") - with self.ui_test.execute_dialog_through_command(".uno:AutoFormatRedlineApply", close_button="close") as xAutoFmt: - xAcceptAll = xAutoFmt.getChild("acceptall") - xAcceptAll.executeAction("CLICK", tuple()) - xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"SHIFT+LEFT"})) - with self.ui_test.execute_dialog_through_command(".uno:FontDialog", close_button="cancel") as xDialog: - xTabs = xDialog.getChild("tabcontrol") - select_pos(xTabs, "0") - xweststylelbcjk = xDialog.getChild("cbWestStyle") - self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold") - self.xUITest.executeCommand(".uno:GoLeft") - with self.ui_test.execute_dialog_through_command(".uno:FontDialog", close_button="cancel") as xDialog: - xTabs = xDialog.getChild("tabcontrol") - select_pos(xTabs, "0") - xweststylelbcjk = xDialog.getChild("cbWestStyle") - self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold") + try: + self.change_autocorrect_option("true") + + type_text(xWriterEdit, "*ab*") + + with self.ui_test.execute_dialog_through_command(".uno:AutoFormatRedlineApply", close_button="close") as xAutoFmt: + xAcceptAll = xAutoFmt.getChild("acceptall") + xAcceptAll.executeAction("CLICK", tuple()) + xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"SHIFT+LEFT"})) + with self.ui_test.execute_dialog_through_command(".uno:FontDialog", close_button="cancel") as xDialog: + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "0") + xweststylelbcjk = xDialog.getChild("cbWestStyle") + self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold") + self.xUITest.executeCommand(".uno:GoLeft") + with self.ui_test.execute_dialog_through_command(".uno:FontDialog", close_button="cancel") as xDialog: + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "0") + xweststylelbcjk = xDialog.getChild("cbWestStyle") + self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold") + + finally: + # reset to default + self.change_autocorrect_option("false") # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/uitest/writer_tests8_data/registrymodifications.xcu b/sw/qa/uitest/writer_tests8_data/registrymodifications.xcu deleted file mode 100644 index 1d5be49fdcd6..000000000000 --- a/sw/qa/uitest/writer_tests8_data/registrymodifications.xcu +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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/. - * ---> -<oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -<item oor:path="/org.openoffice.Office.Writer/AutoFunction/Format/Option"><prop oor:name="ChangeUnderlineWeight" oor:op="fuse"><value>true</value></prop></item> -</oor:items> |