diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-11-22 12:37:11 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-11-22 13:57:56 +0100 |
commit | 23a6b9bd988fabeceb58c5367bbb0b11bac1cb9a (patch) | |
tree | d9545bf0748f46fced9a0f5ce23750f2f384127c /sw | |
parent | 6b2d8e2d88a67d446827ed0ab968f0a06e297d18 (diff) |
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/uitest/writer_tests5/tdf142847.py | 18 |
1 files changed, 13 insertions, 5 deletions
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: |