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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Wed Feb 24 22:24:01 UTC 2021


 sw/qa/uitest/data/tdf138271.odt     |binary
 sw/qa/uitest/writer_tests7/forms.py |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)

New commits:
commit af64bc49d872d8a040d66387303def98eae5cd51
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Feb 24 20:23:27 2021 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Feb 24 23:23:20 2021 +0100

    tdf#138271: sw: Add UItest
    
    Change-Id: I9bfa7e83fcafe9b809daf93e5a41bc74c9d5e3f8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111501
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/uitest/data/tdf138271.odt b/sw/qa/uitest/data/tdf138271.odt
new file mode 100644
index 000000000000..ea09b5577b57
Binary files /dev/null and b/sw/qa/uitest/data/tdf138271.odt differ
diff --git a/sw/qa/uitest/writer_tests7/forms.py b/sw/qa/uitest/writer_tests7/forms.py
index 8c77560e0b61..bd6b8efc96d4 100644
--- a/sw/qa/uitest/writer_tests7/forms.py
+++ b/sw/qa/uitest/writer_tests7/forms.py
@@ -139,4 +139,39 @@ class Forms(UITestCase):
 
         self.ui_test.close_doc()
 
+    def test_tdf138271(self):
+
+        self.ui_test.load_file(get_url_for_data_file("tdf138271.odt"))
+
+        self.xUITest.executeCommand(".uno:JumpToNextFrame")
+
+        aOldValue = ["-1000000.00", "1000000.00"]
+        aNewValue = ["-100.00", "100.00"]
+
+        for i, name in enumerate(['formattedcontrol-Value min.', 'formattedcontrol-Value max.']):
+
+            self.ui_test.execute_modeless_dialog_through_command(".uno:ControlProperties")
+            xChild = self.ui_test.wait_until_child_is_available(name)
+
+            self.assertEqual(aOldValue[i], get_state_as_dict(xChild)['Text'])
+
+            xChild.executeAction("FOCUS", tuple())
+            xChild.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+            xChild.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+            xChild.executeAction("TYPE", mkPropertyValues({"TEXT": aNewValue[i]}))
+
+            #Close the dialog and open it again
+            self.xUITest.executeCommand(".uno:ControlProperties")
+
+            self.ui_test.execute_modeless_dialog_through_command(".uno:ControlProperties")
+            xChild = self.ui_test.wait_until_child_is_available(name)
+
+            # Without the fix in place, this test would have failed here because
+            # the values wouldn't have changed
+            self.assertEqual(aNewValue[i], get_state_as_dict(xChild)['Text'])
+
+            self.xUITest.executeCommand(".uno:ControlProperties")
+
+        self.ui_test.close_doc()
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list