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
12 from uitest
.uihelper
.common
import get_url_for_data_file
16 class TestSwGrfShell(UITestCase
):
17 def testFormatGraphicDlg(self
):
18 # Given a document with an image with a relative size:
19 with self
.ui_test
.load_file(get_url_for_data_file("image-rel-size.fodt")):
20 self
.xUITest
.executeCommand(".uno:JumpToNextFrame")
21 # 120 ms in the SwView ctor
23 # When opening the properties dialog for the image:
24 with self
.ui_test
.execute_dialog_through_command(".uno:GraphicDialog") as dialog
:
25 # Then make sure the width is 80% as in the file:
26 widthField
= dialog
.getChild('width')
27 # Without the accompanying fix in place, this test would have failed with:
28 # AssertionError: '237%' != '80%'
29 # i.e. the percent width of the image was wrong.
30 self
.assertEqual(get_state_as_dict(widthField
)["Text"], "80%")
32 # vim: set shiftwidth=4 softtabstop=4 expandtab: