Kaydet (Commit) 9d98df77 authored tarafından Miklos Vajna's avatar Miklos Vajna

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/42600Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 462454b7
......@@ -47,4 +47,8 @@ $(eval $(call gb_Module_add_slowcheck_targets,writerperfect,\
Library_wpftqahelper \
))
$(eval $(call gb_Module_add_uicheck_targets,writerperfect,\
UITest_writerperfect_epubexport \
))
# vim: set noet sw=4 ts=4:
# -*- 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,writerperfect_epubexport))
$(eval $(call gb_UITest_add_modules,writerperfect_epubexport,$(SRCDIR)/writerperfect/qa/uitest,\
epubexport/ \
))
# vim: set noet sw=4 ts=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 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:
......@@ -74,6 +74,8 @@ void EPUBExportUIComponent::setTitle(const OUString &/*rTitle*/)
sal_Int16 EPUBExportUIComponent::execute()
{
SolarMutexGuard aGuard;
ScopedVclPtrInstance<EPUBExportDialog> pDialog(Application::GetDefDialogParent(), maFilterData);
if (pDialog->Execute() == RET_OK)
return ui::dialogs::ExecutableDialogResults::OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment