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 uitest
.uihelper
.common
import change_measurement_unit
14 class tdf152295(UITestCase
):
15 def test_tdf152295(self
):
16 with self
.ui_test
.create_doc_in_start_center("impress") as document
:
17 TemplateDialog
= self
.xUITest
.getTopFocusWindow()
18 close
= TemplateDialog
.getChild("close")
19 self
.ui_test
.close_dialog_through_button(close
)
21 with
change_measurement_unit(self
, "Centimeter"):
22 with self
.ui_test
.execute_dialog_through_command(".uno:PageSetup") as DrawPageDialog
:
23 xTabs
= DrawPageDialog
.getChild("tabcontrol")
24 select_pos(xTabs
, "1")
25 btnbitmap
= DrawPageDialog
.getChild("btnbitmap")
26 btnbitmap
.executeAction("CLICK",tuple())
27 width
= DrawPageDialog
.getChild("width")
29 width
.executeAction("UP",tuple())
30 height
= DrawPageDialog
.getChild("height")
32 height
.executeAction("UP",tuple())
34 with self
.ui_test
.execute_dialog_through_command(".uno:PageSetup") as DrawPageDialog
:
35 xTabs
= DrawPageDialog
.getChild("tabcontrol")
36 select_pos(xTabs
, "1")
37 btnbitmap
= DrawPageDialog
.getChild("btnbitmap")
38 btnbitmap
.executeAction("CLICK",tuple())
40 with self
.ui_test
.execute_dialog_through_command(".uno:PageSetup") as DrawPageDialog
:
41 xTabs
= DrawPageDialog
.getChild("tabcontrol")
42 select_pos(xTabs
, "1")
43 btnbitmap
= DrawPageDialog
.getChild("btnbitmap")
44 btnbitmap
.executeAction("CLICK",tuple())
45 width
= DrawPageDialog
.getChild("width")
46 height
= DrawPageDialog
.getChild("height")
48 # Without the fix in place, this test would have failed with
49 # AssertionError: '6.00 cm' != '13.55 cm'
50 # AssertionError: '6.00 cm' != '13.55 cm'
51 self
.assertEqual("6.00 cm", get_state_as_dict(width
)['Text'])
52 self
.assertEqual("6.00 cm", get_state_as_dict(height
)['Text'])
54 # vim: set shiftwidth=4 softtabstop=4 expandtab: