summaryrefslogtreecommitdiff
path: root/uitest/manual_tests
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-12-22 01:13:07 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-12-22 01:17:44 +0100
commitc06be281e7bd97d8db5549cdc886c9761ac9c015 (patch)
treea5b1bef42c8c9b0eaf6940f07c587249280ae7ea /uitest/manual_tests
parentad5416b663ef647c289eb290195c1350242038fa (diff)
uitest: convert random number manual test to automated testing
http://manual-test.libreoffice.org/manage/case/143/ Change-Id: Iff337668834cc729398a79719701627689b56dfd
Diffstat (limited to 'uitest/manual_tests')
-rw-r--r--uitest/manual_tests/calc.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/uitest/manual_tests/calc.py b/uitest/manual_tests/calc.py
index bcc8f3c17370..2f7f5f41cab2 100644
--- a/uitest/manual_tests/calc.py
+++ b/uitest/manual_tests/calc.py
@@ -192,4 +192,43 @@ class ManualCalcTests(UITestCase):
self.ui_test.close_doc()
+ # http://manual-test.libreoffice.org/manage/case/143/
+ def test_random_numbers(self):
+ self.ui_test.create_doc_in_start_center("calc")
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+
+ xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A10"}))
+
+ self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog")
+ xRandomNumberDlg = self.xUITest.getTopFocusWindow()
+ xDistributionLstBox = xRandomNumberDlg.getChild("distribution-combo")
+ xDistributionLstBox.executeAction("SELECT", mkPropertyValues({"POS": "1"}))
+
+ xMin = xRandomNumberDlg.getChild("parameter1-spin")
+ xMin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"}))
+ xMin.executeAction("TYPE", mkPropertyValues({"TEXT": "-2"}))
+ xMax = xRandomNumberDlg.getChild("parameter2-spin")
+ xMax.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"}))
+ xMax.executeAction("TYPE", mkPropertyValues({"TEXT": "10"}))
+
+ xApplyBtn = xRandomNumberDlg.getChild("apply")
+ xApplyBtn.executeAction("CLICK", tuple())
+
+ doc = self.ui_test.get_component()
+
+ def check_random_values():
+ for i in range(1, 9):
+ val = get_cell_by_position(doc, 0, 0, i).getValue()
+ self.assertTrue(val <= 10 and val >= -2)
+
+ check_random_values()
+
+ xOkBtn = xRandomNumberDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ # we might want to check that clicking 'ok' actually changes the values
+ check_random_values()
+
+ self.ui_test.close_doc()
+
# vim: set shiftwidth=4 softtabstop=4 expandtab: