summaryrefslogtreecommitdiff
path: root/writerperfect/qa/uitest
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-21 18:16:46 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-21 22:22:39 +0200
commit9d98df77ec7b62e8847f5bad8c98983493018a4f (patch)
treeec3875effe6ba341293c7cce5506bf9f1d1b6444 /writerperfect/qa/uitest
parent462454b7e0aea2d067352e33f320198a850e0127 (diff)
writerperfect: add initial UITest_writerperfect_epubexport
Fails when EPUBExportDialog::VersionSelectHdl() does not take the version from the VCL widget. Change-Id: I8f77643ffbd7766ecec7bc2e148259765ab635b8 Reviewed-on: https://gerrit.libreoffice.org/42600 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'writerperfect/qa/uitest')
-rw-r--r--writerperfect/qa/uitest/epubexport/epubexport.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/writerperfect/qa/uitest/epubexport/epubexport.py b/writerperfect/qa/uitest/epubexport/epubexport.py
new file mode 100644
index 000000000000..67437b48f827
--- /dev/null
+++ b/writerperfect/qa/uitest/epubexport/epubexport.py
@@ -0,0 +1,30 @@
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.framework import UITestCase
+
+
+def handleDialog(dialog):
+ # Select the second entry to request EPUB2, not EPUB3.
+ dialog.getChild("versionlb").executeAction("SELECT", mkPropertyValues({"POS": "1"}))
+ dialog.getChild("ok").executeAction("CLICK", tuple())
+
+
+# Test for EPUBExportDialog and EPUBExportUIComponent.
+class EPUBExportTest(UITestCase):
+
+ def testUIComponent(self):
+
+ uiComponent = self.ui_test._xContext.ServiceManager.createInstanceWithContext("com.sun.star.comp.Writer.EPUBExportUIComponent", self.ui_test._xContext)
+ self.ui_test.execute_blocking_action(action=uiComponent.execute, dialog_handler=handleDialog)
+ propertyValues = uiComponent.getPropertyValues()
+ filterData = [i.Value for i in propertyValues if i.Name == "FilterData"][0]
+ epubVersion = [i.Value for i in filterData if i.Name == "EPUBVersion"][0]
+ # This was 30, EPUBExportDialog::VersionSelectHdl() did not set the version.
+ self.assertEqual(20, epubVersion)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: