[Libreoffice-commits] core.git: bin/list-uitest.py sd/Module_sd.mk sd/qa sd/UITest_impress_tests.mk

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Aug 3 06:03:06 UTC 2018


 bin/list-uitest.py                               |    4 
 sd/Module_sd.mk                                  |    3 
 sd/UITest_impress_tests.mk                       |   16 +++
 sd/qa/uitest/impress_tests/documentProperties.py |   99 +++++++++++++++++++++++
 4 files changed, 120 insertions(+), 2 deletions(-)

New commits:
commit dc05737d46cd6f4a7f430c7ac8b4e512de12b159
Author:     Zdeněk Crhonek <zcrhonek at gmail.com>
AuthorDate: Wed Aug 1 23:36:02 2018 +0200
Commit:     Zdenek Crhonek <zcrhonek at gmail.com>
CommitDate: Fri Aug 3 08:02:41 2018 +0200

    uitest Impress Document properties
    
    Change-Id: Ida877ab6e65d4bcbd42d37fd2567db63f84ed8ad
    Reviewed-on: https://gerrit.libreoffice.org/58456
    Tested-by: Jenkins
    Reviewed-by: Zdenek Crhonek <zcrhonek at gmail.com>

diff --git a/bin/list-uitest.py b/bin/list-uitest.py
index 8924a1f5daec..c7bee46ea73c 100755
--- a/bin/list-uitest.py
+++ b/bin/list-uitest.py
@@ -47,9 +47,9 @@ def linkFormat(name):
 def main():
     uitest_ext = '.py'
     uitest_dirs = {
-            'Writer' : ['../uitest/writer_tests/', '../writerperfect/qa/uitest/', '../sw/qa/uitest/writer_tests/'],
+            'Writer' : ['../uitest/writer_tests/', '../writerperfect/qa/uitest/', '../sw/qa/uitest/'],
             'Calc' : ['../uitest/calc_tests', '../sc/qa/uitest/'],
-            'Impress' : ['../uitest/impress_tests/'],
+            'Impress' : ['../uitest/impress_tests/', '../sd/qa/uitest/'],
             'Math': ['../uitest/math_tests/'],
             'Draw': [''],
             'Manual_tests': ['../uitest/manual_tests/']}
diff --git a/sd/Module_sd.mk b/sd/Module_sd.mk
index 59f792a78037..495aee8d89fa 100644
--- a/sd/Module_sd.mk
+++ b/sd/Module_sd.mk
@@ -59,4 +59,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sd,\
     JunitTest_sd_unoapi \
 ))
 
+$(eval $(call gb_Module_add_uicheck_targets,sd,\
+	UITest_impress_tests \
+))
 # vim: set noet sw=4 ts=4:
diff --git a/sd/UITest_impress_tests.mk b/sd/UITest_impress_tests.mk
new file mode 100644
index 000000000000..94610578dc1b
--- /dev/null
+++ b/sd/UITest_impress_tests.mk
@@ -0,0 +1,16 @@
+# 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/.
+#
+
+$(eval $(call 	gb_UITest_UITest,impress_tests))
+
+$(eval $(call gb_UITest_add_modules,impress_tests,$(SRCDIR)/sd/qa/uitest,\
+	impress_tests/ \
+))
+
+$(eval $(call gb_UITest_set_defs,impress_tests, \
+    TDOC="$(SRCDIR)/sd/qa/uitest/impress_tests/data" \
+))
diff --git a/sd/qa/uitest/impress_tests/documentProperties.py b/sd/qa/uitest/impress_tests/documentProperties.py
new file mode 100644
index 000000000000..e74ba0fd26c6
--- /dev/null
+++ b/sd/qa/uitest/impress_tests/documentProperties.py
@@ -0,0 +1,99 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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/.
+
+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 ImpressDocumentProperties(UITestCase):
+
+   def test_open_document_properties_impress(self):
+        self.ui_test.create_doc_in_start_center("impress")
+        xTemplateDlg = self.xUITest.getTopFocusWindow()
+        xCancelBtn = xTemplateDlg.getChild("cancel")
+        self.ui_test.close_dialog_through_button(xCancelBtn)
+
+        self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties")
+        xDialog = self.xUITest.getTopFocusWindow()
+        xResetBtn = xDialog.getChild("reset")
+        xResetBtn.executeAction("CLICK", tuple())
+        xTabs = xDialog.getChild("tabcontrol")
+
+        select_pos(xTabs, "0")     #first tab
+        xUserDataCheckbox = xDialog.getChild("userdatacb")  # apply user data
+        xUserDataCheckbox.executeAction("CLICK", tuple())
+        xThumbSaveCheckbox = xDialog.getChild("thumbnailsavecb")  # save preview image with document
+        xThumbSaveCheckbox.executeAction("CLICK", tuple())
+
+        #digital signature
+        xDigSignBtn = xDialog.getChild("signature")
+        def handle_sign_dlg(dialog):
+            xNoBtn = dialog.getChild("no")
+            self.ui_test.close_dialog_through_button(xNoBtn)
+        self.ui_test.execute_blocking_action(xDigSignBtn.executeAction, args=('CLICK', ()),
+                dialog_handler=handle_sign_dlg)
+
+        select_pos(xTabs, "1")     #tab Description
+
+        xTitleText = xDialog.getChild("title")
+        xTitleText.executeAction("TYPE", mkPropertyValues({"TEXT":"Title text"}))
+        xSubjectText = xDialog.getChild("subject")
+        xSubjectText.executeAction("TYPE", mkPropertyValues({"TEXT":"Subject text"}))
+        xKeywordsText = xDialog.getChild("keywords")
+        xKeywordsText.executeAction("TYPE", mkPropertyValues({"TEXT":"Keywords text"}))
+        xCommentsText = xDialog.getChild("comments")
+        xCommentsText.executeAction("TYPE", mkPropertyValues({"TEXT":"Comments text"}))
+
+        #Font tab
+        select_pos(xTabs, "5")     #tab Fonts
+        xFontEmbedCheckbox = xDialog.getChild("embedFonts")
+        xFontEmbedCheckbox.executeAction("CLICK", tuple())
+
+        #Security tab
+        select_pos(xTabs, "4")     #tab Security
+        xReadOnlyCheckbox = xDialog.getChild("readonly")
+        xReadOnlyCheckbox.executeAction("CLICK", tuple())
+
+        select_pos(xTabs, "2")     #tab Custom properties
+        #add custom properties  ------>>>>>>>>>>>  not supported
+        xAddBtn = xDialog.getChild("add")
+        xAddBtn.executeAction("CLICK", tuple())
+
+        xOkBtn = xDialog.getChild("ok")
+        xOkBtn.executeAction("CLICK", tuple())
+
+        #now open the dialog again and read the properties
+        self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties")
+        xDialog = self.xUITest.getTopFocusWindow()
+        xTitleText = xDialog.getChild("title")
+        xSubjectText = xDialog.getChild("subject")
+        xKeywordsText = xDialog.getChild("keywords")
+        xCommentsText = xDialog.getChild("comments")
+        xReadOnlyCheckbox = xDialog.getChild("readonly")
+        xRecordChangesCheckbox = xDialog.getChild("recordchanges")
+        xFontEmbedCheckbox = xDialog.getChild("embedFonts")
+        xUserDataCheckbox = xDialog.getChild("userdatacb")
+        xThumbSaveCheckbox = xDialog.getChild("thumbnailsavecb")
+        self.assertEqual(get_state_as_dict(xTitleText)["Text"], "Title text")
+        self.assertEqual(get_state_as_dict(xSubjectText)["Text"], "Subject text")
+        self.assertEqual(get_state_as_dict(xKeywordsText)["Text"], "Keywords text")
+        self.assertEqual(get_state_as_dict(xReadOnlyCheckbox)["Selected"], "true")
+        self.assertEqual(get_state_as_dict(xReadOnlyCheckbox)["Selected"], "true")
+        self.assertEqual(get_state_as_dict(xFontEmbedCheckbox)["Selected"], "true")
+        self.assertEqual(get_state_as_dict(xUserDataCheckbox)["Selected"], "false")
+        self.assertEqual(get_state_as_dict(xThumbSaveCheckbox)["Selected"], "false")
+        self.assertEqual(get_state_as_dict(xCommentsText)["Text"], "Comments text")
+        xResetBtn = xDialog.getChild("reset")
+        xResetBtn.executeAction("CLICK", tuple())
+        xCancBtn = xDialog.getChild("cancel")
+        xCancBtn.executeAction("CLICK", tuple())
+
+        self.ui_test.close_doc()
+# vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list