Debian Codegraph @

sw/qa/uitest/writer_tests5/tdf163325.py

raw symbols SCIP
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
2 #
3 # This file is part of the LibreOffice project.
4 #
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 #
9
10 from uitest.framework import UITestCase
11 from uitest.uihelper.common import get_url_for_data_file, get_state_as_dict
12
13 class tdf163325(UITestCase):
14
15 def test_tdf163325_toc_preview_crash(self):
16 xFilePath = get_url_for_data_file("tdf163325.odt")
17 with self.ui_test.load_file(xFilePath):
18 # Open ToC dialog and check index preview
19 with self.ui_test.execute_dialog_through_command(".uno:InsertMultiIndex") as xTocDialog:
20 xShowExample = xTocDialog.getChild("showexample")
21 xShowExample.executeAction("CLICK", tuple())
22 self.assertEqual(get_state_as_dict(xShowExample)["Selected"], "true")
23
24 # Save, reload and update all indexes in the document
25 self.xUITest.executeCommand('.uno:Save')
26 self.xUITest.executeCommand('.uno:Reload')
27 # Without the fix in place, this test would have crashed here
28 self.xUITest.executeCommand(".uno:UpdateAllIndexes")
29
30 with self.ui_test.load_file(xFilePath) as document:
31 # Check that the index is present
32 xDocumentIndexes = document.DocumentIndexes
33 self.assertEqual(len(xDocumentIndexes), 1)
34
35 # vim: set shiftwidth=4 softtabstop=4 expandtab: