[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jan 24 13:13:49 UTC 2020
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 af27265fc26b653384a36c51cda296c08f6b9813
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Jan 23 15:51:18 2020 +0100
Commit: Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Fri Jan 24 14:12:50 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í <xiscofauli at libreoffice.org>
(cherry picked from commit e13f74ba563e1c82a1de587818f6090077c6f30f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87303
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:
More information about the Libreoffice-commits
mailing list