summaryrefslogtreecommitdiff
path: root/writerperfect
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-29 17:39:17 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-30 13:22:37 +0200
commit82ae825198ada84049c630ab49f280c8c6f2ad6e (patch)
treeac0c83e4ce7e386697f366aa3f0c20df0dcbae45 /writerperfect
parent9e81e845d8299f117e96c30e8b40fcf602e9ca2c (diff)
EPUB export dialog: test VersionToPosition()
Fails when the stub version always returned 0. Change-Id: I2df952d0b7fc1a6171074e6da91584b851ace358 Reviewed-on: https://gerrit.libreoffice.org/42945 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerperfect')
-rw-r--r--writerperfect/qa/uitest/epubexport/epubexport.py28
1 files changed, 22 insertions, 6 deletions
diff --git a/writerperfect/qa/uitest/epubexport/epubexport.py b/writerperfect/qa/uitest/epubexport/epubexport.py
index d5109a4bd395..4dfeed19e617 100644
--- a/writerperfect/qa/uitest/epubexport/epubexport.py
+++ b/writerperfect/qa/uitest/epubexport/epubexport.py
@@ -7,19 +7,18 @@
from com.sun.star.beans import PropertyValue
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict
import uno
-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):
+ 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())
uiComponent = self.ui_test._xContext.ServiceManager.createInstanceWithContext("com.sun.star.comp.Writer.EPUBExportUIComponent", self.ui_test._xContext)
@@ -53,4 +52,21 @@ class EPUBExportTest(UITestCase):
epubVersion = [i.Value for i in filterData if i.Name == "EPUBVersion"][0]
self.assertEqual(30, epubVersion)
+ def testDialogVersionInput(self):
+ def handleDialog(dialog):
+ versionlb = get_state_as_dict(dialog.getChild("versionlb"))
+ # Log the state of the versionlb widget and exit.
+ positions.append(versionlb["SelectEntryPos"])
+ dialog.getChild("ok").executeAction("CLICK", tuple())
+
+ uiComponent = self.ui_test._xContext.ServiceManager.createInstanceWithContext("com.sun.star.comp.Writer.EPUBExportUIComponent", self.ui_test._xContext)
+ positions = []
+ for version in (20, 30):
+ filterData = (PropertyValue(Name="EPUBVersion", Value=version),)
+ propertyValues = (PropertyValue(Name="FilterData", Value=uno.Any("[]com.sun.star.beans.PropertyValue", filterData)),)
+ uiComponent.setPropertyValues(propertyValues)
+ self.ui_test.execute_blocking_action(action=uiComponent.execute, dialog_handler=handleDialog)
+ # Make sure that initializing with 2 different versions results in 2 different widget states.
+ self.assertEqual(2, len(set(positions)))
+
# vim: set shiftwidth=4 softtabstop=4 expandtab: