UITest_writer_tests8: do not use custom configuration

Added with b6e273aaaf
"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>
This commit is contained in:
Xisco Fauli 2023-12-04 11:52:23 +01:00
parent 20831559b8
commit 14fd379f54
3 changed files with 36 additions and 31 deletions

View file

@ -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:

View file

@ -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:

View file

@ -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>