Get the style color and number just once
[LibreOffice.git] / sw / qa / uitest / chapterNumbering / tdf145215.py
blob3cb234c8819ac569fe753e00978b68a6e40d59c4
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
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/.
10 from uitest.framework import UITestCase
11 from uitest.uihelper.common import get_url_for_data_file, get_state_as_dict
13 class Tdf145215(UITestCase):
15 def test_tdf145215(self):
16 with self.ui_test.load_file(get_url_for_data_file("tdf145215.docx")) as writer_doc:
17 with self.ui_test.execute_dialog_through_command(".uno:ChapterNumberingDialog") as xDialog:
19 # Select level "4"
20 xLevel = xDialog.getChild("level")
21 xLevel2 = xLevel.getChild("3")
22 xLevel2.executeAction("SELECT", tuple())
23 self.assertEqual("4", get_state_as_dict(xLevel)['SelectEntryText'])
25 # Check value for show upper levels
26 xSubLevels = xDialog.getChild("sublevelsnf")
27 self.assertEqual(get_state_as_dict(xSubLevels)["Text"], "1")
29 # Check field value (there is only one field)
30 textfields = writer_doc.getTextFields()
31 textfields.refresh()
32 textfield = textfields.createEnumeration().nextElement()
33 self.assertTrue(textfield.supportsService("com.sun.star.text.TextField.GetReference"))
34 self.assertEqual(textfield.CurrentPresentation, "1.2.1(i)")
36 # vim: set shiftwidth=4 softtabstop=4 expandtab: