summaryrefslogtreecommitdiff
path: root/writerperfect/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-11-30 08:50:04 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-11-30 15:36:26 +0100
commitee74bd73856c355f1491e9ff7c3bbbf74a7858bb (patch)
tree82909c55844f23fd812c5a8477a2c0b78d88e65a /writerperfect/qa
parent98770243f7f5387aae06e83ed4de0d68e02abb02 (diff)
EPUB export: add UI to set custom metadata
The motivation here is that when it comes to date or author, the typical metata for the Writer document won't match the metadata of the book the file represents, so allowing a custom override as part of EPUB export makes sense. Change-Id: I19aaed83ae0e69bc0dfa3084e1c9dc9cc534328f Reviewed-on: https://gerrit.libreoffice.org/45553 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerperfect/qa')
-rw-r--r--writerperfect/qa/uitest/epubexport/epubexport.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/writerperfect/qa/uitest/epubexport/epubexport.py b/writerperfect/qa/uitest/epubexport/epubexport.py
index 8db15c5bf891..196556b2fb8d 100644
--- a/writerperfect/qa/uitest/epubexport/epubexport.py
+++ b/writerperfect/qa/uitest/epubexport/epubexport.py
@@ -83,4 +83,30 @@ class EPUBExportTest(UITestCase):
coverImage = [i.Value for i in filterData if i.Name == "RVNGCoverImage"][0]
self.assertEqual("cover.png", coverImage)
+ def testMeta(self):
+ def handleDialog(dialog):
+ dialog.getChild("identifier").executeAction("TYPE", mkPropertyValues({"TEXT": "baddcafe-e394-4cd6-9b83-7172794612e5"}))
+ dialog.getChild("title").executeAction("TYPE", mkPropertyValues({"TEXT": "unknown title from ui"}))
+ dialog.getChild("author").executeAction("TYPE", mkPropertyValues({"TEXT": "unknown author from ui"}))
+ dialog.getChild("language").executeAction("TYPE", mkPropertyValues({"TEXT": "sk"}))
+ dialog.getChild("date").executeAction("TYPE", mkPropertyValues({"TEXT": "2013-11-20T17:16:07Z"}))
+ dialog.getChild("ok").executeAction("CLICK", tuple())
+
+ 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]
+ # These keys were missing, EPUBExportDialog::OKClickHdl() did not set them.
+ identifier = [i.Value for i in filterData if i.Name == "RVNGIdentifier"][0]
+ self.assertEqual("baddcafe-e394-4cd6-9b83-7172794612e5", identifier)
+ title = [i.Value for i in filterData if i.Name == "RVNGTitle"][0]
+ self.assertEqual("unknown title from ui", title)
+ initialCreator = [i.Value for i in filterData if i.Name == "RVNGInitialCreator"][0]
+ self.assertEqual("unknown author from ui", initialCreator)
+ language = [i.Value for i in filterData if i.Name == "RVNGLanguage"][0]
+ self.assertEqual("sk", language)
+ date = [i.Value for i in filterData if i.Name == "RVNGDate"][0]
+ self.assertEqual("2013-11-20T17:16:07Z", date)
+
# vim: set shiftwidth=4 softtabstop=4 expandtab: