1#
2# This Source Code Form is subject to the terms of the Mozilla Public
3# License, v. 2.0. If a copy of the MPL was not distributed with this
4# file, You can obtain one at http://mozilla.org/MPL/2.0/.
5#
6
7from uitest.framework import UITestCase
8from uitest.uihelper.common import select_pos
9from com.sun.star.drawing.HatchStyle import SINGLE
10from uitest.uihelper.common import get_state_as_dict
11
12class tdf137729(UITestCase):
13
14    def test_tdf137729(self):
15
16        self.ui_test.create_doc_in_start_center("impress")
17
18        xTemplateDlg = self.xUITest.getTopFocusWindow()
19        xCancelBtn = xTemplateDlg.getChild("close")
20        self.ui_test.close_dialog_through_button(xCancelBtn)
21
22        self.ui_test.execute_dialog_through_command(".uno:PageSetup")
23
24        xPageSetupDlg = self.xUITest.getTopFocusWindow()
25        tabcontrol = xPageSetupDlg.getChild("tabcontrol")
26        select_pos(tabcontrol, "1")
27
28        xBtn = xPageSetupDlg.getChild('btnhatch')
29        xBtn.executeAction("CLICK", tuple())
30
31        xDistance = xPageSetupDlg.getChild('distancemtr')
32        xDistance.executeAction("UP", tuple())
33
34        xOkBtn = xPageSetupDlg.getChild("ok")
35        xOkBtn.executeAction("CLICK", tuple())
36
37        document = self.ui_test.get_component()
38        self.assertEqual(
39          document.DrawPages.getByIndex(0).Background.FillHatch.Style, SINGLE )
40        self.assertEqual(
41          document.DrawPages.getByIndex(0).Background.FillHatch.Color, 0)
42        self.assertEqual(
43          document.DrawPages.getByIndex(0).Background.FillHatch.Distance, 152)
44        self.assertEqual(
45          document.DrawPages.getByIndex(0).Background.FillHatch.Angle, 0)
46
47        # Without the patch in place, this test would have failed with
48        # AssertionError: '' != 'hatch'
49        self.assertEqual(
50          document.DrawPages.getByIndex(0).Background.FillHatchName, 'hatch')
51
52        self.ui_test.close_doc()
53
54# vim: set shiftwidth=4 softtabstop=4 expandtab:
55