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_state_as_dict
, select_pos
12 from com
.sun
.star
.drawing
.FillStyle
import SOLID
15 class TestClass(UITestCase
):
16 def test_master_page_background(self
):
17 with self
.ui_test
.create_doc_in_start_center("impress") as document
:
18 TemplateDialog
= self
.xUITest
.getTopFocusWindow()
19 close
= TemplateDialog
.getChild("close")
20 self
.ui_test
.close_dialog_through_button(close
)
22 # set margins and fill color
23 with self
.ui_test
.execute_dialog_through_command(".uno:PageSetup") as DrawPageDialog
:
24 xTabs
= DrawPageDialog
.getChild("tabcontrol")
25 select_pos(xTabs
, "0")
26 checkBackgroundFullSize
= DrawPageDialog
.getChild("checkBackgroundFullSize")
27 self
.assertEqual(get_state_as_dict(checkBackgroundFullSize
)["Selected"], "false")
28 spinMargLeft
= DrawPageDialog
.getChild("spinMargLeft")
30 spinMargLeft
.executeAction("UP",tuple())
31 spinMargRight
= DrawPageDialog
.getChild("spinMargRight")
33 spinMargRight
.executeAction("UP",tuple())
34 spinMargTop
= DrawPageDialog
.getChild("spinMargTop")
36 spinMargTop
.executeAction("UP",tuple())
37 spinMargBot
= DrawPageDialog
.getChild("spinMargBot")
39 spinMargBot
.executeAction("UP",tuple())
40 xTabs
= DrawPageDialog
.getChild("tabcontrol")
41 select_pos(xTabs
, "1")
42 btncolor
= DrawPageDialog
.getChild("btncolor")
43 btncolor
.executeAction("CLICK",tuple())
46 document
.DrawPages
.getByIndex(0).Background
.FillStyle
, SOLID
)
48 document
.DrawPages
.getByIndex(0).BorderLeft
, 1016)
50 document
.DrawPages
.getByIndex(0).BorderRight
, 762)
52 document
.DrawPages
.getByIndex(0).BorderTop
, 508)
54 document
.DrawPages
.getByIndex(0).BorderBottom
, 254)
56 document
.MasterPages
.getByIndex(0).BackgroundFullSize
, False)
59 with self
.ui_test
.execute_dialog_through_command(".uno:PageSetup") as DrawPageDialog
:
60 xTabs
= DrawPageDialog
.getChild("tabcontrol")
61 select_pos(xTabs
, "0")
62 checkBackgroundFullSize
= DrawPageDialog
.getChild("checkBackgroundFullSize")
63 self
.assertEqual(get_state_as_dict(checkBackgroundFullSize
)["Selected"], "false")
64 checkBackgroundFullSize
.executeAction("CLICK",tuple())
67 document
.DrawPages
.getByIndex(0).Background
.FillStyle
, SOLID
)
69 document
.DrawPages
.getByIndex(0).BorderLeft
, 1016)
71 document
.DrawPages
.getByIndex(0).BorderRight
, 762)
73 document
.DrawPages
.getByIndex(0).BorderTop
, 508)
75 document
.DrawPages
.getByIndex(0).BorderBottom
, 254)
77 document
.MasterPages
.getByIndex(0).BackgroundFullSize
, True)
80 with self
.ui_test
.execute_dialog_through_command(".uno:PageSetup") as DrawPageDialog
:
81 xTabs
= DrawPageDialog
.getChild("tabcontrol")
82 select_pos(xTabs
, "0")
83 checkBackgroundFullSize
= DrawPageDialog
.getChild("checkBackgroundFullSize")
84 self
.assertEqual(get_state_as_dict(checkBackgroundFullSize
)["Selected"], "true")
85 checkBackgroundFullSize
.executeAction("CLICK",tuple())
88 document
.DrawPages
.getByIndex(0).Background
.FillStyle
, SOLID
)
90 document
.DrawPages
.getByIndex(0).BorderLeft
, 1016)
92 document
.DrawPages
.getByIndex(0).BorderRight
, 762)
94 document
.DrawPages
.getByIndex(0).BorderTop
, 508)
96 document
.DrawPages
.getByIndex(0).BorderBottom
, 254)
98 document
.MasterPages
.getByIndex(0).BackgroundFullSize
, False)
101 # vim: set shiftwidth=4 softtabstop=4 expandtab: