diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-01-23 15:51:18 +0100 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2020-01-23 18:24:44 +0100 |
commit | e13f74ba563e1c82a1de587818f6090077c6f30f (patch) | |
tree | 4c418c171d6e21f6b5dbe3cd499a0bb38b5221b1 /sw | |
parent | 2da7a82f6b7a78e1e4b34b0b3c7a27d2b3c47a35 (diff) |
tdf#128782: Add UItest
Change-Id: I389d05fa9b1e79af2c01abd920fb4454b96543fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87282
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/uitest/writer_tests/data/tdf128782.odt | bin | 0 -> 8817 bytes | |||
-rw-r--r-- | sw/qa/uitest/writer_tests7/tdf128782.py | 45 |
2 files changed, 45 insertions, 0 deletions
diff --git a/sw/qa/uitest/writer_tests/data/tdf128782.odt b/sw/qa/uitest/writer_tests/data/tdf128782.odt Binary files differnew file mode 100644 index 000000000000..bb4a7d7f67c9 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf128782.odt 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: |