sc/qa/uitest/calc_tests3/tdf68290.py | 35 ----------------------------------- sc/qa/unit/uicalc/uicalc.cxx | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 35 deletions(-)
New commits: commit 808b2f556667fb2269e8936af91df2a9adf61764 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Jan 25 16:23:01 2021 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Jan 25 18:45:09 2021 +0100 tdf#68290: sc: Move UItest to CppUnitTest Change-Id: I150a7d514ce9c39fe2ac21aa2bc1f0af79cb0a39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109915 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/uitest/calc_tests3/tdf68290.py b/sc/qa/uitest/calc_tests3/tdf68290.py deleted file mode 100644 index 168098569c52..000000000000 --- a/sc/qa/uitest/calc_tests3/tdf68290.py +++ /dev/null @@ -1,35 +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, get_url_for_data_file -from libreoffice.calc.document import get_sheet_from_doc -from libreoffice.calc.conditional_format import get_conditional_format_from_sheet -from libreoffice.calc.document import get_cell_by_position -from libreoffice.uno.propertyvalue import mkPropertyValues - -#Enhancement: EDITING: cursor moves with Enter key - -class tdf68290(UITestCase): - - def test_tdf68290_cursor_moves_with_Enter_key(self): - calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf68290.ods")) - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - document = self.ui_test.get_component() - gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) - gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) - gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) - gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) - gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) - gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) - gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) - gridWinState = get_state_as_dict(gridwin) - self.assertEqual(gridWinState["CurrentRow"], "2") - self.assertEqual(gridWinState["CurrentColumn"], "12") - self.ui_test.close_doc() - -# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/data/tdf68290.ods b/sc/qa/unit/uicalc/data/tdf68290.ods similarity index 100% rename from sc/qa/uitest/data/tdf68290.ods rename to sc/qa/unit/uicalc/data/tdf68290.ods diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 0c067c5d7e99..5dbb55d1ba04 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -101,6 +101,25 @@ ScModelObj* ScUiCalcTest::createDoc(const char* pName) return pModelObj; } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf68290) +{ + ScModelObj* pModelObj = createDoc("tdf68290.ods"); + ScDocument* pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + const std::vector<SCROW> aExpectedRows{ 2, 5, 8, 9, 10, 12, 14 }; + + for (const auto& rRow : aExpectedRows) + { + lcl_AssertCurrentCursorPosition(11, rRow); + + pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN); + Scheduler::ProcessEventsToIdle(); + } + + lcl_AssertCurrentCursorPosition(12, 2); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf122232) { ScModelObj* pModelObj = createDoc("tdf122232.ods"); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits