Get the style color and number just once
[LibreOffice.git] / sw / qa / uitest / writer_tests4 / tdf135636.py
blob0fd3aec66453fe85060aafe4f14e75004d158590
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/.
9 from uitest.framework import UITestCase
10 from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
12 class tdf135636(UITestCase):
14 def test_tdf135636(self):
16 with self.ui_test.load_file(get_url_for_data_file("tdf135636.odt")) as document:
18 self.assertEqual(document.CurrentController.PageCount, 2)
20 xPageBreak = self.ui_test.wait_until_child_is_available('PageBreak')
21 with self.ui_test.execute_dialog_through_action(xPageBreak, "EDIT") as xDialog:
24 xBreak = xDialog.getChild("break")
25 self.assertEqual("true", get_state_as_dict(xBreak)["Selected"])
27 xBreak.executeAction("CLICK", tuple())
29 self.assertEqual("false", get_state_as_dict(xBreak)["Selected"])
32 # Without the fix in place, this test would have failed with
33 # AssertionError: 2 != 1
34 self.assertEqual(document.CurrentController.PageCount, 1)
36 self.xUITest.executeCommand(".uno:Undo")
38 self.assertEqual(document.CurrentController.PageCount, 2)
40 # vim: set shiftwidth=4 softtabstop=4 expandtab: