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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 19 21:34:50 UTC 2021


 sw/qa/uitest/writer_tests2/documentProperties.py |   28 +++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

New commits:
commit ee65cd26b546e5904bcec90125ee0f13a2ad34d4
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Feb 19 16:12:38 2021 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Feb 19 22:34:05 2021 +0100

    uitest: sw: test insert/remove of custom properties
    
    Change-Id: I6de4c73a79e3a3ae5f9fcd4e6efcf25dc846e880
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111228
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/uitest/writer_tests2/documentProperties.py b/sw/qa/uitest/writer_tests2/documentProperties.py
index 40366d2303b5..72e0c48dc636 100644
--- a/sw/qa/uitest/writer_tests2/documentProperties.py
+++ b/sw/qa/uitest/writer_tests2/documentProperties.py
@@ -10,13 +10,24 @@
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import get_state_as_dict
-import time
-from uitest.debug import sleep
 from uitest.uihelper.common import select_pos
 
-
 class documentProperties(UITestCase):
 
+   def assert_custom_properties(self, dialog, bIsFirstItemVisible):
+        for i in range(6):
+            aExpected = 'false'
+            if bIsFirstItemVisible and i == 0:
+                aExpected = 'true'
+            xNameBox = dialog.getChild("namebox" + str(i + 1))
+            xTypeBox = dialog.getChild("typebox" + str(i + 1))
+            xValueEdit = dialog.getChild("valueedit" + str(i + 1))
+            xRemoveBtn = dialog.getChild("remove" + str(i + 1))
+            self.assertEqual(aExpected, get_state_as_dict(xNameBox)['ReallyVisible'])
+            self.assertEqual(aExpected, get_state_as_dict(xTypeBox)['ReallyVisible'])
+            self.assertEqual(aExpected, get_state_as_dict(xValueEdit)['ReallyVisible'])
+            self.assertEqual(aExpected, get_state_as_dict(xRemoveBtn)['ReallyVisible'])
+
    def test_open_documentProperties_writer(self):
         self.ui_test.create_doc_in_start_center("writer")
         self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties")
@@ -76,10 +87,19 @@ class documentProperties(UITestCase):
                 dialog_handler=handle_protect_dlg)
 
         select_pos(xTabs, "2")     #tab Custom properties
-#add custom properties  ------>>>>>>>>>>>  not supported
+
+        self.assert_custom_properties(xDialog, False)
+
         xAddBtn = xDialog.getChild("add")
         xAddBtn.executeAction("CLICK", tuple())
 
+        self.assert_custom_properties(xDialog, True)
+
+        xRemoveBtn = xDialog.getChild("remove1")
+        xRemoveBtn.executeAction("CLICK", tuple())
+
+        self.assert_custom_properties(xDialog, False)
+
         select_pos(xTabs, "5")     #tab Statistics
         xUpdateBtn = xDialog.getChild("update")
         xUpdateBtn.executeAction("CLICK", tuple())


More information about the Libreoffice-commits mailing list