Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / qa / uitest / writer_tests5 / tdf142847.py
blob54cbf8291dbc7d35425b36c39b17c52a7c978f81
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/.
9 from uitest.framework import UITestCase
10 from uitest.uihelper.common import get_url_for_data_file
12 class tdf142847(UITestCase):
13 def test_tdf142847(self):
14 # load the sample file
15 with self.ui_test.load_file(get_url_for_data_file("tdf142847.fodt")):
16 document = self.ui_test.get_component()
18 # get the shape
19 shape = document.DrawPage.getByIndex(0)
21 # get the textbox
22 frame = shape.getText()
24 oldFramePos = frame.getPropertyValue("HoriOrientPosition")
25 oldShapePos = shape.getPropertyValue("LeftMargin")
26 oldDiff = oldFramePos - oldShapePos
28 # select the shape.
29 self.xUITest.executeCommand(".uno:JumpToNextFrame")
30 self.ui_test.wait_until_child_is_available('metricfield')
32 # set the wrap spacing of the shape
33 with self.ui_test.execute_dialog_through_command(".uno:TextWrap") as wrap_dialog:
34 wrap_dialog.getChild('left').executeAction("UP", tuple())
36 newDiff = frame.getPropertyValue("HoriOrientPosition") - shape.getPropertyValue("LeftMargin")
38 # without the fix, this will fail.
39 # the textbox has fallen apart.
40 self.assertEqual(oldDiff, newDiff)
42 self.assertGreater(frame.getPropertyValue("HoriOrientPosition"), oldFramePos)
43 self.assertGreater(shape.getPropertyValue("LeftMargin"), oldShapePos)
45 # vim: set shiftwidth=4 softtabstop=4 expandtab: