From daca12903bb21f43468c3e96fa78bb881b956484 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 22 Dec 2016 00:01:07 +0100 Subject: uitest: convert transpose manual test to automated test http://manual-test.libreoffice.org/manage/case/187/ Change-Id: Ia15514127c91ad9391329e96ad23e72b39f9b5f0 --- uitest/manual_tests/calc.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'uitest/manual_tests') diff --git a/uitest/manual_tests/calc.py b/uitest/manual_tests/calc.py index b0d7b2e2d29b..76a81f0c1591 100644 --- a/uitest/manual_tests/calc.py +++ b/uitest/manual_tests/calc.py @@ -131,4 +131,40 @@ class ManualCalcTests(UITestCase): self.ui_test.close_doc() + def test_transpose(self): + self.ui_test.create_doc_in_start_center("calc") + + xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + enter_text_to_cell(xGridWin, "B3", "abcd") + enter_text_to_cell(xGridWin, "B4", "edfg") + enter_text_to_cell(xGridWin, "C3", "35") + enter_text_to_cell(xGridWin, "C4", "5678") + + xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C10"})) + + self.xUITest.executeCommand(".uno:Cut") + + xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + + self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") + + xPasteSpecialDlg = self.xUITest.getTopFocusWindow() + + xAllChkBox = xPasteSpecialDlg.getChild("paste_all") + xAllChkBox.executeAction("CLICK", tuple()) + + xTransposeChkBox = xPasteSpecialDlg.getChild("transpose") + xTransposeChkBox.executeAction("CLICK", tuple()) + + xOkBtn = xPasteSpecialDlg.getChild("ok") + self.ui_test.close_dialog_through_button(xOkBtn) + + document = self.ui_test.get_component() + self.assertEqual(get_cell_by_position(document, 0, 2, 1).getString(), "abcd") + self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 35) + self.assertEqual(get_cell_by_position(document, 0, 3, 1).getString(), "edfg") + self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 5678) + + self.ui_test.close_doc() + # vim: set shiftwidth=4 softtabstop=4 expandtab: -- cgit