summaryrefslogtreecommitdiff
path: root/uitest/manual_tests
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-12-21 17:16:08 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-12-22 01:17:44 +0100
commit02db166d5f45d659a992911292da452cdb475de0 (patch)
treee54e4fdd6a120a2b7f7372bf2d0146c7ae5ed500 /uitest/manual_tests
parent92654aafae9b5d7187b117da5b4b60f533d8a536 (diff)
uitest: convert next manual calc test to an automatic one
Converts http://manual-test.libreoffice.org/manage/case/190/ Change-Id: I72fa202c55578f1163f0184fbedd8e470cee0ed7
Diffstat (limited to 'uitest/manual_tests')
-rw-r--r--uitest/manual_tests/calc.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/uitest/manual_tests/calc.py b/uitest/manual_tests/calc.py
index db2f2b846deb..5feadb53af0a 100644
--- a/uitest/manual_tests/calc.py
+++ b/uitest/manual_tests/calc.py
@@ -8,8 +8,10 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
+from libreoffice.calc.document import get_cell_by_position
from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.calc import enter_text_to_cell
import time
@@ -56,4 +58,46 @@ class ManualCalcTests(UITestCase):
self.ui_test.close_doc()
+ # http://manual-test.libreoffice.org/manage/case/190/
+ def test_sort_data(self):
+ self.ui_test.create_doc_in_start_center("calc")
+
+ # Insert data
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ enter_text_to_cell(xGridWin, "B1", "3")
+ enter_text_to_cell(xGridWin, "B2", "25")
+ enter_text_to_cell(xGridWin, "B3", "17")
+ enter_text_to_cell(xGridWin, "B4", "9")
+ enter_text_to_cell(xGridWin, "B5", "19")
+ enter_text_to_cell(xGridWin, "B6", "0")
+ enter_text_to_cell(xGridWin, "B7", "107")
+ enter_text_to_cell(xGridWin, "B8", "89")
+ enter_text_to_cell(xGridWin, "B9", "8")
+ enter_text_to_cell(xGridWin, "B10", "33")
+
+ xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B10"}))
+
+ # Execute "Sort" dialog
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xSortDlg = self.xUITest.getTopFocusWindow()
+
+ xOkBtn = xSortDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ document = self.ui_test.get_component()
+
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 8)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 9)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 17)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 5).getValue(), 19)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 6).getValue(), 25)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 7).getValue(), 33)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 8).getValue(), 89)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 9).getValue(), 107)
+
+ time.sleep(2)
+ self.ui_test.close_doc()
+
# vim: set shiftwidth=4 softtabstop=4 expandtab: