[Libreoffice-commits] core.git: sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 26 07:57:47 UTC 2021


 sw/qa/uitest/writer_tests7/forms.py |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit 12921f1d4f8d1c6fc2202627e70d0d7bcee847ac
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Feb 25 21:37:53 2021 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Feb 26 08:56:55 2021 +0100

    tdf#131522: sw: Add unittest
    
    Change-Id: I8920f12c655b7106a3eb2a5a3916793453c3694a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111569
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/uitest/writer_tests7/forms.py b/sw/qa/uitest/writer_tests7/forms.py
index bd6b8efc96d4..d241fc38a876 100644
--- a/sw/qa/uitest/writer_tests7/forms.py
+++ b/sw/qa/uitest/writer_tests7/forms.py
@@ -50,6 +50,7 @@ class Forms(UITestCase):
         self.ui_test.execute_modeless_dialog_through_command(".uno:ControlProperties")
         xAction = self.ui_test.wait_until_child_is_available('listbox-Action')
         xURL = self.ui_test.wait_until_child_is_available('urlcontrol-URL')
+        xEntry = self.ui_test.wait_until_child_is_available('entry')
 
         self.assertEqual("None", get_state_as_dict(xAction)['SelectEntryText'])
         self.assertEqual("false", get_state_as_dict(xURL)['Enabled'])
@@ -69,6 +70,20 @@ class Forms(UITestCase):
         # AssertionError: '12345' != '54321'
         self.assertEqual("12345", get_state_as_dict(xURL)['Text'])
 
+        xEntry.executeAction("FOCUS", tuple())
+        self.assertEqual("Push Button", get_state_as_dict(xEntry)['Text'])
+
+        xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+        xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+        xEntry.executeAction("TYPE", mkPropertyValues({"TEXT": "Push"}))
+
+        # Move the focus to another element so the changes done before will take effect
+        xAction.executeAction("FOCUS", tuple())
+
+        # tdf#131522: Without the fix in place, this test would have failed with
+        # AssertionError: 'Push' != 'Push Button'
+        self.assertEqual("Push", get_state_as_dict(xEntry)['Text'])
+
         self.ui_test.close_doc()
 
     def test_tdf138701(self):


More information about the Libreoffice-commits mailing list