diff options
author | Zdeněk Crhonek <zcrhonek@gmail.com> | 2018-03-14 17:12:50 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-03-18 16:08:26 +0100 |
commit | b448f3cb86803ac23413cfbc643750d8e66d92b4 (patch) | |
tree | 3eb28b65dbc178b6a83f6cd4a81733734e5d3224 | |
parent | caeb7930c1d2d6508a0a170932a3688f2057363c (diff) |
uitest for bug tdf#113284
Change-Id: If4e9875344da2525b5f7bdb658ad0096d923ead7
Reviewed-on: https://gerrit.libreoffice.org/51285
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | sw/qa/uitest/writer_tests/data/tdf113284.odt | bin | 0 -> 144880 bytes | |||
-rw-r--r-- | sw/qa/uitest/writer_tests/tdf113284.py | 45 |
2 files changed, 45 insertions, 0 deletions
diff --git a/sw/qa/uitest/writer_tests/data/tdf113284.odt b/sw/qa/uitest/writer_tests/data/tdf113284.odt Binary files differnew file mode 100644 index 000000000000..b062fc2e8d9c --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf113284.odt diff --git a/sw/qa/uitest/writer_tests/tdf113284.py b/sw/qa/uitest/writer_tests/tdf113284.py new file mode 100644 index 000000000000..1ab5462f997a --- /dev/null +++ b/sw/qa/uitest/writer_tests/tdf113284.py @@ -0,0 +1,45 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 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 uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import get_state_as_dict +import time +from uitest.path import get_srcdir_url +from uitest.debug import sleep + +def get_url_for_data_file(file_name): + return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + +class tdf113284(UITestCase): + + def test_tdf113284(self): + writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf113284.odt")) + document = self.ui_test.get_component() + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + + sleep(2) #we need this sleep,because without this is pagecount counted without index. Load index takes time probably. + xPageCount = document.CurrentController.PageCount + self.ui_test.execute_dialog_through_command(".uno:GotoPage") + xDialog = self.xUITest.getTopFocusWindow() + xPageText = xDialog.getChild("page") + xPageText.executeAction("TYPE", mkPropertyValues({"TEXT":str(xPageCount)})) # goto last page + xOkBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOkBtn) + + self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], str(xPageCount)) + self.ui_test.execute_dialog_through_command(".uno:EditCurIndex") #open index dialog + xDiagIndex = self.xUITest.getTopFocusWindow() + xCancBtn = xDiagIndex.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancBtn) # close dialog + + #page count is not constant + #self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "66") #page 66 start of the Index + #pagecount unchanged + self.assertEqual(document.CurrentController.PageCount, xPageCount) + + self.ui_test.close_doc() +# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file |