summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-01-23 15:51:18 +0100
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2020-01-24 12:53:04 +0100
commitf4e6ef766ae8a69e0abb2cfd0eab8140578321b1 (patch)
tree37dc5cef414f275eb25b8d345d2ba3c2a833b7f0
parent271629be26f2e443923c34e2f18d100e616fd772 (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> (cherry picked from commit e13f74ba563e1c82a1de587818f6090077c6f30f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87332
-rw-r--r--sw/qa/uitest/writer_tests/data/tdf128782.odtbin0 -> 8817 bytes
-rw-r--r--sw/qa/uitest/writer_tests7/tdf128782.py45
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
new file mode 100644
index 000000000000..bb4a7d7f67c9
--- /dev/null
+++ b/sw/qa/uitest/writer_tests/data/tdf128782.odt
Binary files 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: