Debian Codegraph @

sd/qa/uitest/impress_tests/tdf137729.py

raw
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 select_pos
12 from com.sun.star.drawing.HatchStyle import SINGLE
13
14 class tdf137729(UITestCase):
15
16 def test_tdf137729(self):
17
18 with self.ui_test.create_doc_in_start_center("impress") as document:
19
20 xTemplateDlg = self.xUITest.getTopFocusWindow()
21 xCancelBtn = xTemplateDlg.getChild("close")
22 self.ui_test.close_dialog_through_button(xCancelBtn)
23
24 with self.ui_test.execute_dialog_through_command(".uno:PageSetup") as xPageSetupDlg:
25
26 tabcontrol = xPageSetupDlg.getChild("tabcontrol")
27 select_pos(tabcontrol, "1")
28
29 xBtn = xPageSetupDlg.getChild('btnhatch')
30 xBtn.executeAction("CLICK", tuple())
31
32 xDistance = xPageSetupDlg.getChild('distancemtr')
33 xDistance.executeAction("UP", tuple())
34
35
36 self.assertEqual(
37 document.DrawPages[0].Background.FillHatch.Style, SINGLE )
38 self.assertEqual(
39 document.DrawPages[0].Background.FillHatch.Color, 0)
40 self.assertEqual(
41 document.DrawPages[0].Background.FillHatch.Distance, 152)
42 self.assertEqual(
43 document.DrawPages[0].Background.FillHatch.Angle, 0)
44
45 # Without the patch in place, this test would have failed with
46 # AssertionError: '' != 'hatch'
47 self.assertEqual(
48 document.DrawPages[0].Background.FillHatchName, 'hatch')
49
50
51 # vim: set shiftwidth=4 softtabstop=4 expandtab: