summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-06-16 16:30:56 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-06-16 17:24:53 +0200
commitbfe6500f2560f13a2114a52167bcee4f997da037 (patch)
treeda432ab9e59a8a4cb2cdbafd6b3c9502137cdb52
parent20c17b0ffb89102d086f80303887a8594f0c3c8c (diff)
sfx2: add uitest for pdf signing
Fails with 058caeef45f9abf12e4e243aafbbb1c2ebcbc057 (tdf#130354 sfx2: make PDF signing UI work again, 2020-06-02) reverted. Change-Id: I4f4ffaeed4b93c033bc2fdaa76ff817d172c8853 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96469 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
-rw-r--r--sfx2/Module_sfx2.mk4
-rw-r--r--sfx2/UITest_sfx2_doc.mk20
-rw-r--r--sfx2/qa/uitest/doc/data/pdf-sign.pdfbin0 -> 2235 bytes
-rw-r--r--sfx2/qa/uitest/doc/objserv.py32
4 files changed, 56 insertions, 0 deletions
diff --git a/sfx2/Module_sfx2.mk b/sfx2/Module_sfx2.mk
index 8ebe54cef9c7..d084ac929c0f 100644
--- a/sfx2/Module_sfx2.mk
+++ b/sfx2/Module_sfx2.mk
@@ -55,4 +55,8 @@ $(eval $(call gb_Module_add_screenshot_targets,sfx2,\
CppunitTest_sfx2_dialogs_test \
))
+$(eval $(call gb_Module_add_uicheck_targets,sfx2,\
+ UITest_sfx2_doc \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/sfx2/UITest_sfx2_doc.mk b/sfx2/UITest_sfx2_doc.mk
new file mode 100644
index 000000000000..b5e3ef8cebde
--- /dev/null
+++ b/sfx2/UITest_sfx2_doc.mk
@@ -0,0 +1,20 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# 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,sfx2_doc))
+
+$(eval $(call gb_UITest_add_modules,sfx2_doc,$(SRCDIR)/sfx2/qa/uitest,\
+ doc/ \
+))
+
+$(eval $(call gb_UITest_set_defs,sfx2_doc, \
+ TDOC="$(SRCDIR)/sfx2/qa/uitest/doc/data" \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sfx2/qa/uitest/doc/data/pdf-sign.pdf b/sfx2/qa/uitest/doc/data/pdf-sign.pdf
new file mode 100644
index 000000000000..8dedb6998b23
--- /dev/null
+++ b/sfx2/qa/uitest/doc/data/pdf-sign.pdf
Binary files differ
diff --git a/sfx2/qa/uitest/doc/objserv.py b/sfx2/qa/uitest/doc/objserv.py
new file mode 100644
index 000000000000..af00590736ea
--- /dev/null
+++ b/sfx2/qa/uitest/doc/objserv.py
@@ -0,0 +1,32 @@
+#
+# 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
+import org.libreoffice.unotest
+import pathlib
+
+def get_url_for_data_file(file_name):
+ return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+
+# Test for sfx2/source/doc/objserv.cxx.
+class Test(UITestCase):
+
+ def testPdfSigning(self):
+ # Start Impress.
+ impress_doc = self.ui_test.load_file(get_url_for_data_file("pdf-sign.pdf"))
+ doc = self.xUITest.getTopFocusWindow()
+
+ # Now use File -> Digital signatures -> Digital signatures.
+ self.ui_test.execute_dialog_through_command(".uno:Signature")
+ xDialog = self.xUITest.getTopFocusWindow()
+ # Without the accompanying fix in place, this test would have failed with:
+ # uno.com.sun.star.uno.RuntimeException: Could not find child with id: close vcl/source/uitest/uiobject.cxx:452
+ self.ui_test.close_dialog_through_button(xDialog.getChild("close"))
+
+ self.ui_test.close_doc()
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: