Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / qa / uitest / writer_tests7 / tdf137803.py
blob3954caca1bc221099d8d5e0676f343d404c82cba
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
13 class tdf137803(UITestCase):
14 def test_tdf137803(self):
15 # load the sample file
16 with self.ui_test.load_file(get_url_for_data_file("tdf137803.odt")) as document:
18 # select the shape
19 self.xUITest.executeCommand(".uno:JumpToNextFrame")
20 self.ui_test.wait_until_child_is_available('metricfield')
22 # open textattrs dialog
23 with self.ui_test.execute_dialog_through_command(".uno:TextAttributes") as TextDialog:
25 # check autosize on
26 TSB_AUTOGROW_SIZE = TextDialog.getChild('TSB_AUTOGROW_SIZE')
27 TSB_AUTOGROW_SIZE.executeAction("CLICK",tuple())
29 # get the shape
30 drawPage = document.getDrawPages().getByIndex(0)
31 shape = drawPage.getByIndex(0)
33 # and the textbox
34 frame = shape.getText()
36 # get the positions
37 shapeYPos = shape.getPropertyValue("VertOrientPosition")
38 frameYPos = frame.getPropertyValue("VertOrientPosition")
39 shpsize = shape.getSize().Height
41 xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
42 xToolkit.processEventsToIdle()
44 # without the fix, at this point the textbox falls apart so this won't be passed
45 self.assertLess(frameYPos, shapeYPos + shpsize)
47 # close the doc
49 # vim: set shiftwidth=4 softtabstop=4 expandtab: