diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-05-18 16:56:33 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-05-18 21:16:11 +0200 |
commit | 67b5e875c65c5ed72a170a03d33992edd3802c75 (patch) | |
tree | 8923f403638ff9abd04641b1cef8a066ae99a25d /sw/qa/uitest/writer_tests6 | |
parent | 39369c6e67dffe04acc4abb678c1a94526237fd8 (diff) |
tdf#118883: sw: Add UItest
Change-Id: I38e7c1a0accf569a70d1d3bc5e04042538afadff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115756
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/uitest/writer_tests6')
-rw-r--r-- | sw/qa/uitest/writer_tests6/tdf118883.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/sw/qa/uitest/writer_tests6/tdf118883.py b/sw/qa/uitest/writer_tests6/tdf118883.py new file mode 100644 index 000000000000..300412344fb0 --- /dev/null +++ b/sw/qa/uitest/writer_tests6/tdf118883.py @@ -0,0 +1,40 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# 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 + +class Tdf118883(UITestCase): + + def test_tdf118883(self): + self.ui_test.create_doc_in_start_center("writer") + + # Insert shape with Ctrl key + xArgs = mkPropertyValues({"KeyModifier": 8192}) + self.xUITest.executeCommandWithParameters(".uno:BasicShapes.rectangle", xArgs) + + writer_document = self.ui_test.get_component() + self.assertEqual(1, writer_document.DrawPage.getCount()) + + self.xUITest.executeCommand(".uno:Copy") + + self.ui_test.execute_dialog_through_command(".uno:CloseDoc") + xDialog = self.xUITest.getTopFocusWindow() + xDiscardBtn = xDialog.getChild("discard") + self.ui_test.close_dialog_through_button(xDiscardBtn) + + calc_doc = self.ui_test.create_doc_in_start_center("calc") + + self.xUITest.executeCommand(".uno:Paste") + + calc_document = self.ui_test.get_component() + + # Without the fix in place, this test would have failed wiht + # AssertionError: 1 != 0 + self.assertEqual(1, calc_document.DrawPages[0].getCount()) + + self.ui_test.close_doc() +# vim: set shiftwidth=4 softtabstop=4 expandtab: |