sc/qa/uitest/textCase/textCase.py | 14 -------------- sc/qa/unit/uicalc/uicalc.cxx | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 14 deletions(-)
New commits: commit 7930ad202edb8e7af2946fc428268b000edae23e Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed Nov 10 16:32:32 2021 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Nov 10 20:39:03 2021 +0100 tdf#119155: sc: move UItest to CppUnittest Change-Id: Id6d162d4348caf512e78eb957034e79f0c2dbc6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125002 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/uitest/textCase/textCase.py b/sc/qa/uitest/textCase/textCase.py index fd208e67f607..7dbb6d2a41d5 100644 --- a/sc/qa/uitest/textCase/textCase.py +++ b/sc/qa/uitest/textCase/textCase.py @@ -123,20 +123,6 @@ class textCase(UITestCase): self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "") self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free suite") - def test_tdf119155_Capitalize_Every_Word(self): - #Bug 119155 - Freeze after command format->text->Capitalize Every Word - with self.ui_test.load_file(get_url_for_data_file("tdf119155.xlsx")) as calc_doc: - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - #1. Open attached file - #2. Select cells from C2 to C14 - gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C2:C14"})) - #3. Go to menu: Format->Text->Capitalize Every Word - self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase") - #Actual Results:Freezes LibreOffice - self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getString(), "Collagene Expert Targeted Wrinkle Corrector Unboxed 10 Ml") - self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 13).getString(), "Vitamina Suractivee Hand Cream 400 Ml") - def test_tdf119162_Cycle_Case(self): #Bug 119162 - Format > Text > Cycle Case on attached example file hangs Calc reproducibly with self.ui_test.load_file(get_url_for_data_file("tdf119162.xls")) as calc_doc: diff --git a/sc/qa/uitest/data/tdf119155.xlsx b/sc/qa/unit/uicalc/data/tdf119155.xlsx similarity index 100% rename from sc/qa/uitest/data/tdf119155.xlsx rename to sc/qa/unit/uicalc/data/tdf119155.xlsx diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index fbcfb2f59511..ef3b8dd24959 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -166,6 +166,24 @@ ScModelObj* ScUiCalcTest::saveAndReload(css::uno::Reference<css::lang::XComponen return pModelObj; } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf119155) +{ + ScModelObj* pModelObj = createDoc("tdf119155.xlsx"); + ScDocument* pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + goToCell("C2:C14"); + + // Without the fix in place, this test would have hung here + dispatchCommand(mxComponent, ".uno:ChangeCaseToTitleCase", {}); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(OUString("Collagene Expert Targeted Wrinkle Corrector Unboxed 10 Ml"), + pDoc->GetString(ScAddress(2, 1, 0))); + CPPUNIT_ASSERT_EQUAL(OUString("Vitamina Suractivee Hand Cream 400 Ml"), + pDoc->GetString(ScAddress(2, 13, 0))); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf138432) { ScModelObj* pModelObj = createDoc("tdf138432.ods");