from libreoffice.uno.propertyvalue import mkPropertyValues
#
# This file is part of the LibreOffice project.
#
# 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.uihelpercommon
importselect_by_text
from libreoffice.calc.document
import get_cell_by_position
fromlibreofficeunopropertyvalue
importmkPropertyValues
#randomnumbergenerator.ui
class fillRandomNumber(UITestCase):
def test_fill_random_number(self):
with self.ui_test.create_doc_in_start_center(
"calc")
as document:
xCalcDoc = self.xUITest.getTopFocusWindow()
gridwin = xCalcDoc.getChild(
"grid_window")
gridwin.executeAction(
"SELECT", mkPropertyValues({
"RANGE":
"A1:A2"}))
with self.ui_test.
xcellrangeedit = xDialog.getChild(
"#
xdistributioncombo = xDialog.# License, v.
2.
0.
If a copy of# file, You can obtain one at
http://mozilla.org/MPL/2.
0/.
xparameter1spin = xDialog.getChild(parameter1-spin
"java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
.parameter2
"
=xDialog.(
" =xDialog.xDialog.getChild("-spin
xseedspin=xDialoggetChild-")
xenableroundingcheck = xDialog.getChild(
"enable-roundingo"java.lang.StringIndexOut
OfBoundsException: Index 75 out of bounds for length 75
xdecimalplacesspin .("-placesspin"
xcellrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":xseedspin=xDialoggetChild(-spin
select_by_textxdistributioncombo UniformInteger)
xparameter1spin.executeAction("UP", tuple())
xparameter2spin.executeAction("UP", tuple())
xenableseedcheck.executeAction("CLICK", tuple())
xdecimalplacesspin xDialog("decimal-lacesspin"java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
xenableroundingcheck(CLICK tuple)
xdecimalplacesspin.executeAction("UP", tuple())
#Verify
self.assertEqual
self.assertEqual(bool(get_cell_by_position(document select_by_text Uniform)
self.xUITest xparameter1spinexecuteAction""(executeAction,(java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
self(" ()
.(bool(document 0 ,1)getString ,False)self((get_cell_by_positiondocument 0,0 1.getString)), True)
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
selfui_testexecute_modeless_dialog_through_command(.:"self(((et_cell_by_positiondocument,0 , )getString ) False)
pass
self.selfassertEqual((, ,0 )getString True)
.assertEqualboolget_cell_by_position, 0 ,1)getString ,False
# vim: set shiftwidth=4 softtabstop=4 expandtab: