sw/qa/uitest/writer_tests5/tdf142847.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
New commits: commit 23a6b9bd988fabeceb58c5367bbb0b11bac1cb9a Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Nov 22 12:37:11 2021 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Nov 22 13:57:56 2021 +0100 uitest: sw: make test more precise and no need to use the for i in range(90) loop Change-Id: I9b039d49dc74f61289ad11979da1f244ec59903f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125655 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/uitest/writer_tests5/tdf142847.py b/sw/qa/uitest/writer_tests5/tdf142847.py index bddc64e0e13c..09484dd9021b 100644 --- a/sw/qa/uitest/writer_tests5/tdf142847.py +++ b/sw/qa/uitest/writer_tests5/tdf142847.py @@ -20,20 +20,28 @@ class tdf142847(UITestCase): # get the shape shape = document.DrawPage.getByIndex(0) + # get the textbox + frame = shape.getText() + + oldFramePos = frame.getPropertyValue("HoriOrientPosition") + oldShapePos = shape.getPropertyValue("LeftMargin") + oldDiff = oldFramePos - oldShapePos + # select the shape. self.xUITest.executeCommand(".uno:JumpToNextFrame") self.ui_test.wait_until_child_is_available('metricfield') # set the wrap spacing of the shape with self.ui_test.execute_dialog_through_command(".uno:TextWrap") as wrap_dialog: - for i in range(90): - wrap_dialog.getChild('left').executeAction("UP", tuple()) + wrap_dialog.getChild('left').executeAction("UP", tuple()) - # get the textbox - frame = shape.getText() + newDiff = frame.getPropertyValue("HoriOrientPosition") - shape.getPropertyValue("LeftMargin") # without the fix, this will fail. # the textbox has fallen apart. - self.assertGreater(frame.getPropertyValue("HoriOrientPosition"), shape.getPropertyValue("LeftMargin")) + self.assertEqual(oldDiff, newDiff) + + self.assertGreater(frame.getPropertyValue("HoriOrientPosition"), oldFramePos) + self.assertGreater(shape.getPropertyValue("LeftMargin"), oldShapePos) # vim: set shiftwidth=4 softtabstop=4 expandtab: