sw/qa/uitest/writer_tests/data/tdf128782.odt |binary sw/qa/uitest/writer_tests7/tdf128782.py | 45 +++++++++++++++++++++++++++ 2 files changed, 45 insertions(+)
New commits: commit e13f74ba563e1c82a1de587818f6090077c6f30f Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Jan 23 15:51:18 2020 +0100 Commit: Xisco Faulí <xiscofa...@libreoffice.org> CommitDate: Thu Jan 23 18:24:44 2020 +0100 tdf#128782: Add UItest Change-Id: I389d05fa9b1e79af2c01abd920fb4454b96543fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87282 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org> diff --git a/sw/qa/uitest/writer_tests/data/tdf128782.odt b/sw/qa/uitest/writer_tests/data/tdf128782.odt new file mode 100644 index 000000000000..bb4a7d7f67c9 Binary files /dev/null and b/sw/qa/uitest/writer_tests/data/tdf128782.odt differ diff --git a/sw/qa/uitest/writer_tests7/tdf128782.py b/sw/qa/uitest/writer_tests7/tdf128782.py new file mode 100644 index 000000000000..13104c4bed29 --- /dev/null +++ b/sw/qa/uitest/writer_tests7/tdf128782.py @@ -0,0 +1,45 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.path import get_srcdir_url + +def get_url_for_data_file(file_name): + return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + +class tdf128782(UITestCase): + + def test_tdf128782_move_textbox_undo(self): + self.ui_test.load_file(get_url_for_data_file("tdf128782.odt")) + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + document = self.ui_test.get_component() + + oldX1 = document.getDrawPage()[0].Position.X + oldY1 = document.getDrawPage()[0].Position.Y + oldX2 = document.getDrawPage()[1].Position.X + oldY2 = document.getDrawPage()[1].Position.Y + + #select shape 2 and move it down + document.getCurrentController().select(document.getDrawPage()[1]) + xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"})) + + #Only the Y value of shape 2 changes + self.assertEqual(oldX1, document.getDrawPage()[0].Position.X) + self.assertEqual(oldY1, document.getDrawPage()[0].Position.Y) + self.assertEqual(oldX2, document.getDrawPage()[1].Position.X) + self.assertNotEqual(oldY2, document.getDrawPage()[1].Position.Y) + + self.xUITest.executeCommand(".uno:Undo") + + #Both shapes should have the same position as before + self.assertEqual(oldX1, document.getDrawPage()[0].Position.X) + self.assertEqual(oldY1, document.getDrawPage()[0].Position.Y) + self.assertEqual(oldX2, document.getDrawPage()[1].Position.X) + self.assertEqual(oldY2, document.getDrawPage()[1].Position.Y) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits