summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorComing___soON <sachinvilasnagane@karunya.edu.in>2020-04-09 22:21:33 +0530
committerXisco Faulí <xiscofauli@libreoffice.org>2020-04-17 14:00:21 +0200
commit84993213de77efb47e65c6cf5e01ba50a8dbf378 (patch)
treef93e207876d19e265d2c71094e2f5427a9b6c7a5
parent01752af18d623676c4ebc7a8a4a47f69dfb79057 (diff)
tdf#131407: move UItest to CppunitTest
sw/qa/uitest/writer_tests5/tdf124722.py - tdf124722_crash_paste_text (tdf124722) Change-Id: I08d89f5bb90b95c26c56ebc16df2c56c9803f845 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92074 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
-rw-r--r--sw/qa/extras/uiwriter/data3/tdf124722.rtf (renamed from sw/qa/uitest/writer_tests/data/tdf124722.rtf)0
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx17
-rw-r--r--sw/qa/uitest/writer_tests5/tdf124722.py36
3 files changed, 17 insertions, 36 deletions
diff --git a/sw/qa/uitest/writer_tests/data/tdf124722.rtf b/sw/qa/extras/uiwriter/data3/tdf124722.rtf
index 93f386d00a99..93f386d00a99 100644
--- a/sw/qa/uitest/writer_tests/data/tdf124722.rtf
+++ b/sw/qa/extras/uiwriter/data3/tdf124722.rtf
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 2dc50a068445..4f03eaa33895 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -95,6 +95,23 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf128739)
CPPUNIT_ASSERT_EQUAL(OUString(""), getParagraph(1)->getString());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf124722)
+{
+ load(DATA_DIRECTORY, "tdf124722.rtf");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ CPPUNIT_ASSERT_EQUAL(22, getPages());
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:Copy", {});
+ CPPUNIT_ASSERT_EQUAL(22, getPages());
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+ CPPUNIT_ASSERT_EQUAL(43, getPages());
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ CPPUNIT_ASSERT_EQUAL(22, getPages());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf125261)
{
load(DATA_DIRECTORY, "tdf125261.odt");
diff --git a/sw/qa/uitest/writer_tests5/tdf124722.py b/sw/qa/uitest/writer_tests5/tdf124722.py
deleted file mode 100644
index 80b9e8b235fe..000000000000
--- a/sw/qa/uitest/writer_tests5/tdf124722.py
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- 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 uitest.uihelper.common import get_state_as_dict
-from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_cell_by_position
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
-
-#Bug 124722 - CRASH: after pasting, if deleting more text than fits on a page
-
-class tdf124722(UITestCase):
- def test_tdf124722_crash_paste_text(self):
- writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf124722.rtf"))
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:Copy")
- self.xUITest.executeCommand(".uno:Paste")
-
- self.assertEqual(document.Text.String[0:9], "The quick")
- self.ui_test.close_doc()
-# vim: set shiftwidth=4 softtabstop=4 expandtab: