sc/qa/uitest/calc_tests/cellBackgroundColorSelector.py | 17 +- sc/qa/uitest/calc_tests/fillRandomNumber.py | 5 sc/qa/uitest/calc_tests/formatCells.py | 17 -- sc/qa/uitest/calc_tests2/consolidate.py | 13 -- sc/qa/uitest/calc_tests2/standardFilter.py | 97 ++++------------- sc/qa/uitest/calc_tests2/tdf104117.py | 7 - sc/qa/uitest/calc_tests3/tdf77509.py | 7 - sc/qa/uitest/calc_tests3/tdf80693.py | 7 - sc/qa/uitest/calc_tests4/tdf89958.py | 11 - sc/qa/uitest/calc_tests6/tdf107267.py | 13 -- sc/qa/uitest/calc_tests6/tdf118638.py | 5 sc/qa/uitest/calc_tests8/tdf126248.py | 3 sc/qa/uitest/chart/chartDataLabels.py | 13 -- sc/qa/uitest/chart/chartXAxis.py | 21 +-- sc/qa/uitest/chart/chartYAxis.py | 21 +-- sc/qa/uitest/chart/tdf123520.py | 5 sc/qa/uitest/chart/tdf93506_trendline.py | 3 sc/qa/uitest/conditional_format/tdf105351.py | 9 - sc/qa/uitest/key_f4/f4.py | 9 - sc/qa/uitest/pageFormat/tdf123508.py | 5 sc/qa/uitest/range_name/tdf137617.py | 11 - sc/qa/uitest/search_replace/tdf35020.py | 5 sc/qa/uitest/search_replace/tdf39917.py | 9 - sc/qa/uitest/solver/solver.py | 5 sc/qa/uitest/sort/subtotals.py | 29 +---- sc/qa/uitest/sort/tdf49531.py | 5 sc/qa/uitest/sort/tdf53482.py | 7 - sc/qa/uitest/sort/tdf54018.py | 7 - sc/qa/uitest/sort/tdf99208.py | 7 - sc/qa/uitest/validity/tdf138134.py | 9 - sc/qa/uitest/validity/tdf53920.py | 5 sc/qa/uitest/validity/tdf65686.py | 5 sc/qa/uitest/validity/tdf96698.py | 17 -- sc/qa/uitest/validity/validity.py | 13 -- sw/qa/uitest/chapterNumbering/chapterNumbering.py | 21 +-- sw/qa/uitest/classification/classification.py | 17 -- sw/qa/uitest/findReplace/tdf106099.py | 5 sw/qa/uitest/navigator/tdf140257.py | 5 sw/qa/uitest/sidebar/stylesSidebar.py | 3 sw/qa/uitest/sidebar/tdf135590.py | 3 sw/qa/uitest/table/tableProperties.py | 13 -- sw/qa/uitest/writer_tests2/asianPhoneticGuide.py | 13 -- sw/qa/uitest/writer_tests2/formatBulletsNumbering.py | 17 -- sw/qa/uitest/writer_tests2/formatCharacter.py | 9 - sw/qa/uitest/writer_tests2/formatParagraph.py | 41 +------ sw/qa/uitest/writer_tests3/lineNumbering.py | 17 -- sw/qa/uitest/writer_tests3/sort.py | 7 - sw/qa/uitest/writer_tests4/tdf134439.py | 3 sw/qa/uitest/writer_tests6/tdf124586.py | 5 sw/qa/uitest/writer_tests6/tdf125104.py | 5 sw/qa/uitest/writer_tests7/forms.py | 3 uitest/uitest/uihelper/common.py | 3 52 files changed, 204 insertions(+), 408 deletions(-)
New commits: commit 53c4a93e32a5bcdc06a580e9652cde535134b3f6 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Wed Mar 17 18:58:44 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sun Mar 21 11:31:04 2021 +0100 select_by_text helper method for uitests reduce the boilerplate associated with selecting an item in a combobox Change-Id: I035967d7b45c84788d67b9ab5bebf2dbfc13fdf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112817 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/qa/uitest/calc_tests/cellBackgroundColorSelector.py b/sc/qa/uitest/calc_tests/cellBackgroundColorSelector.py index ec78a7530f5c..0e26d3a41a51 100644 --- a/sc/qa/uitest/calc_tests/cellBackgroundColorSelector.py +++ b/sc/qa/uitest/calc_tests/cellBackgroundColorSelector.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -36,7 +37,7 @@ class CalcCellBackgroundColorSelector(UITestCase): color_selector = xColorpage.getChild("colorset") # For chart-palettes colors - xpaletteselector.executeAction("SELECT", mkPropertyValues({"TEXT": "chart-palettes"})) + select_by_text(xpaletteselector, "chart-palettes") # Select Color with id 2 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "2"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "2") @@ -54,7 +55,7 @@ class CalcCellBackgroundColorSelector(UITestCase): self.assertEqual(get_state_as_dict(color_selector)["RGB"], "(126,0,33)") # For libreoffice colors - xpaletteselector.executeAction("SELECT", mkPropertyValues({"TEXT": "libreoffice"})) + select_by_text(xpaletteselector, "libreoffice") # Select Color with id 6 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "6"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "6") @@ -72,7 +73,7 @@ class CalcCellBackgroundColorSelector(UITestCase): self.assertEqual(get_state_as_dict(color_selector)["RGB"], "(255,215,76)") # For html colors - xpaletteselector.executeAction("SELECT", mkPropertyValues({"TEXT": "html"})) + select_by_text(xpaletteselector, "html") # Select Color with id 1 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "1"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "1") @@ -87,7 +88,7 @@ class CalcCellBackgroundColorSelector(UITestCase): self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Navy") # For freecolour-hlc colors - xpaletteselector.executeAction("SELECT", mkPropertyValues({"TEXT": "freecolour-hlc"})) + select_by_text(xpaletteselector, "freecolour-hlc") # Select Color with id 988 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "988"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "988") @@ -102,7 +103,7 @@ class CalcCellBackgroundColorSelector(UITestCase): self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "HLC 190 50 20") # For tonal colors - xpaletteselector.executeAction("SELECT", mkPropertyValues({"TEXT": "tonal"})) + select_by_text(xpaletteselector, "tonal") # Select Color with id 17 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "17"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "17") @@ -117,7 +118,7 @@ class CalcCellBackgroundColorSelector(UITestCase): self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Magenta 82%") # For material colors - xpaletteselector.executeAction("SELECT", mkPropertyValues({"TEXT": "material"})) + select_by_text(xpaletteselector, "material") # Select Color with id 9 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "9"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "9") @@ -127,7 +128,7 @@ class CalcCellBackgroundColorSelector(UITestCase): self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Gray 800") # For standard colors - xpaletteselector.executeAction("SELECT", mkPropertyValues({"TEXT": "standard"})) + select_by_text(xpaletteselector, "standard") # Select Color with id 3 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "3"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "3") @@ -166,7 +167,7 @@ class CalcCellBackgroundColorSelector(UITestCase): color_selector = xColorpage.getChild("colorset") # For chart-palettes colors - xpaletteselector.executeAction("SELECT", mkPropertyValues({"TEXT": "chart-palettes"})) + select_by_text(xpaletteselector, "chart-palettes") # Select Color with id 2 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "2"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "2") diff --git a/sc/qa/uitest/calc_tests/fillRandomNumber.py b/sc/qa/uitest/calc_tests/fillRandomNumber.py index 2f9635184e97..ee97c487a1fe 100644 --- a/sc/qa/uitest/calc_tests/fillRandomNumber.py +++ b/sc/qa/uitest/calc_tests/fillRandomNumber.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_sheet_from_doc from libreoffice.calc.conditional_format import get_conditional_format_from_sheet @@ -34,9 +35,7 @@ class fillRandomNumber(UITestCase): xdecimalplacesspin = xDialog.getChild("decimal-places-spin") xcellrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$2"})) - props = {"TEXT": "Uniform Integer"} - actionProps = mkPropertyValues(props) - xdistributioncombo.executeAction("SELECT", actionProps) + select_by_text(xdistributioncombo, "Uniform Integer") xparameter1spin.executeAction("UP", tuple()) xparameter2spin.executeAction("UP", tuple()) diff --git a/sc/qa/uitest/calc_tests/formatCells.py b/sc/qa/uitest/calc_tests/formatCells.py index 62c1e55c7e9c..2daf171e440e 100644 --- a/sc/qa/uitest/calc_tests/formatCells.py +++ b/sc/qa/uitest/calc_tests/formatCells.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.common import change_measurement_unit from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_sheet_from_doc @@ -38,9 +39,7 @@ class formatCell(UITestCase): xlanguagelb = xDialog.getChild("languagelb") xformatted = xDialog.getChild("formatted") #language - props3 = {"TEXT": "English (USA)"} - actionProps3 = mkPropertyValues(props3) - xlanguagelb.executeAction("SELECT", actionProps3) + select_by_text(xlanguagelb, "English (USA)") #other properties xdecimalsed.executeAction("UP", tuple()) xleadzerosed.executeAction("UP", tuple()) @@ -213,20 +212,14 @@ class formatCell(UITestCase): xcheckHyphActive = xDialog.getChild("checkHyphActive") xcomboTextDirBox = xDialog.getChild("comboTextDirBox") - props = {"TEXT": "Left"} - actionProps = mkPropertyValues(props) - comboboxHorzAlign.executeAction("SELECT", actionProps) + select_by_text(comboboxHorzAlign, "Left") xspinIndentFrom.executeAction("UP", tuple()) indentVal = get_state_as_dict(xspinIndentFrom)["Text"] - props2 = {"TEXT": "Top"} - actionProps2 = mkPropertyValues(props2) - xcomboboxVertAlign.executeAction("SELECT", actionProps2) + select_by_text(xcomboboxVertAlign, "Top") xcheckVertStack.executeAction("CLICK", tuple()) xcheckWrapTextAuto.executeAction("CLICK", tuple()) xcheckHyphActive.executeAction("CLICK", tuple()) - props3 = {"TEXT": "Left-to-right (LTR)"} - actionProps3 = mkPropertyValues(props3) - xcomboTextDirBox.executeAction("SELECT", actionProps3) + select_by_text(xcomboTextDirBox, "Left-to-right (LTR)") xOK = xDialog.getChild("ok") xOK.executeAction("CLICK", tuple()) #Verify- select cell A1 diff --git a/sc/qa/uitest/calc_tests2/consolidate.py b/sc/qa/uitest/calc_tests2/consolidate.py index 4798372ab059..1a854b0cd975 100644 --- a/sc/qa/uitest/calc_tests2/consolidate.py +++ b/sc/qa/uitest/calc_tests2/consolidate.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -27,17 +28,11 @@ class consolidate(UITestCase): xbycol = xDialog.getChild("bycol") xeddestarea = xDialog.getChild("eddestarea") - props = {"TEXT": "Sum"} - actionProps = mkPropertyValues(props) - xfunc.executeAction("SELECT", actionProps) + select_by_text(xfunc, "Sum") - propsA = {"TEXT": "range1"} - actionPropsA = mkPropertyValues(propsA) - xlbdataarea.executeAction("SELECT", actionPropsA) + select_by_text(xlbdataarea, "range1") xadd.executeAction("CLICK", tuple()) - propsB = {"TEXT": "range2"} - actionPropsB = mkPropertyValues(propsB) - xlbdataarea.executeAction("SELECT", actionPropsB) + select_by_text(xlbdataarea, "range2") xadd.executeAction("CLICK", tuple()) propsC = {"TEXT": "range3"} actionPropsC = mkPropertyValues(propsC) diff --git a/sc/qa/uitest/calc_tests2/standardFilter.py b/sc/qa/uitest/calc_tests2/standardFilter.py index e5b5d1f6ba8d..a2e10f8de951 100644 --- a/sc/qa/uitest/calc_tests2/standardFilter.py +++ b/sc/qa/uitest/calc_tests2/standardFilter.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -29,16 +30,10 @@ class standardFilter(UITestCase): xfield2 = xDialog.getChild("field2") xval2 = xDialog.getChild("val2") - props = {"TEXT": "a"} - actionProps = mkPropertyValues(props) - xfield1.executeAction("SELECT", actionProps) + select_by_text(xfield1, "a") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) - propsA = {"TEXT": "OR"} - actionPropsA = mkPropertyValues(propsA) - xconnect2.executeAction("SELECT", actionPropsA) - props2 = {"TEXT": "b"} - actionProps2 = mkPropertyValues(props2) - xfield2.executeAction("SELECT", actionProps2) + select_by_text(xconnect2, "OR") + select_by_text(xfield2, "b") xval2.executeAction("TYPE", mkPropertyValues({"TEXT":"3"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -86,16 +81,10 @@ class standardFilter(UITestCase): xval2 = xDialog.getChild("val2") xcopyresult = xDialog.getChild("copyresult") xedcopyarea = xDialog.getChild("edcopyarea") - props = {"TEXT": "a"} - actionProps = mkPropertyValues(props) - xfield1.executeAction("SELECT", actionProps) + select_by_text(xfield1, "a") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) - propsA = {"TEXT": "OR"} - actionPropsA = mkPropertyValues(propsA) - xconnect2.executeAction("SELECT", actionPropsA) - props2 = {"TEXT": "b"} - actionProps2 = mkPropertyValues(props2) - xfield2.executeAction("SELECT", actionProps2) + select_by_text(xconnect2, "OR") + select_by_text(xfield2, "b") xval2.executeAction("TYPE", mkPropertyValues({"TEXT":"3"})) xcopyresult.executeAction("CLICK", tuple()) xedcopyarea.executeAction("TYPE", mkPropertyValues({"TEXT":"F1"})) @@ -129,16 +118,10 @@ class standardFilter(UITestCase): xval2 = xDialog.getChild("val2") xcopyresult = xDialog.getChild("copyresult") xedcopyarea = xDialog.getChild("edcopyarea") - props = {"TEXT": "a"} - actionProps = mkPropertyValues(props) - xfield1.executeAction("SELECT", actionProps) + select_by_text(xfield1, "a") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) - propsA = {"TEXT": "OR"} - actionPropsA = mkPropertyValues(propsA) - xconnect2.executeAction("SELECT", actionPropsA) - props2 = {"TEXT": "b"} - actionProps2 = mkPropertyValues(props2) - xfield2.executeAction("SELECT", actionProps2) + select_by_text(xconnect2, "OR") + select_by_text(xfield2, "b") xval2.executeAction("TYPE", mkPropertyValues({"TEXT":"3"})) xcopyresult.executeAction("CLICK", tuple()) xedcopyarea.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet2.$F$1"})) @@ -177,9 +160,7 @@ class standardFilter(UITestCase): xval1 = xDialog.getChild("val1") xcase = xDialog.getChild("case") - props = {"TEXT": "first"} - actionProps = mkPropertyValues(props) - xfield1.executeAction("SELECT", actionProps) + select_by_text(xfield1, "first") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"a1"})) xcase.executeAction("CLICK", tuple()) xOKBtn = xDialog.getChild("ok") @@ -231,9 +212,7 @@ class standardFilter(UITestCase): xval1 = xDialog.getChild("val1") xregexp = xDialog.getChild("regexp") - props = {"TEXT": "first"} - actionProps = mkPropertyValues(props) - xfield1.executeAction("SELECT", actionProps) + select_by_text(xfield1, "first") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"a*"})) xregexp.executeAction("CLICK", tuple()) xOKBtn = xDialog.getChild("ok") @@ -287,9 +266,7 @@ class standardFilter(UITestCase): xval1 = xDialog.getChild("val1") xregexp = xDialog.getChild("regexp") - props = {"TEXT": "first"} - actionProps = mkPropertyValues(props) - xfield1.executeAction("SELECT", actionProps) + select_by_text(xfield1, "first") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"a*"})) xregexp.executeAction("CLICK", tuple()) xOKBtn = xDialog.getChild("ok") @@ -355,12 +332,8 @@ class standardFilter(UITestCase): xval1 = xDialog.getChild("val1") xcond1 = xDialog.getChild("cond1") - props = {"TEXT": "A"} - actionProps = mkPropertyValues(props) - xfield1.executeAction("SELECT", actionProps) - props2 = {"TEXT": "Contains"} - actionProps2 = mkPropertyValues(props2) - xcond1.executeAction("SELECT", actionProps2) + select_by_text(xfield1, "A") + select_by_text(xcond1, "Contains") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"cio"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -424,12 +397,8 @@ class standardFilter(UITestCase): xval1 = xDialog.getChild("val1") xcond1 = xDialog.getChild("cond1") - props = {"TEXT": "A"} - actionProps = mkPropertyValues(props) - xfield1.executeAction("SELECT", actionProps) - props2 = {"TEXT": "Does not contain"} - actionProps2 = mkPropertyValues(props2) - xcond1.executeAction("SELECT", actionProps2) + select_by_text(xfield1, "A") + select_by_text(xcond1, "Does not contain") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"cio"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -494,12 +463,8 @@ class standardFilter(UITestCase): xval1 = xDialog.getChild("val1") xcond1 = xDialog.getChild("cond1") - props = {"TEXT": "A"} - actionProps = mkPropertyValues(props) - xfield1.executeAction("SELECT", actionProps) - props2 = {"TEXT": "Begins with"} - actionProps2 = mkPropertyValues(props2) - xcond1.executeAction("SELECT", actionProps2) + select_by_text(xfield1, "A") + select_by_text(xcond1, "Begins with") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"so"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -564,12 +529,8 @@ class standardFilter(UITestCase): xval1 = xDialog.getChild("val1") xcond1 = xDialog.getChild("cond1") - props = {"TEXT": "A"} - actionProps = mkPropertyValues(props) - xfield1.executeAction("SELECT", actionProps) - props2 = {"TEXT": "Does not begin with"} - actionProps2 = mkPropertyValues(props2) - xcond1.executeAction("SELECT", actionProps2) + select_by_text(xfield1, "A") + select_by_text(xcond1, "Does not begin with") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"so"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -634,12 +595,8 @@ class standardFilter(UITestCase): xval1 = xDialog.getChild("val1") xcond1 = xDialog.getChild("cond1") - props = {"TEXT": "A"} - actionProps = mkPropertyValues(props) - xfield1.executeAction("SELECT", actionProps) - props2 = {"TEXT": "Ends with"} - actionProps2 = mkPropertyValues(props2) - xcond1.executeAction("SELECT", actionProps2) + select_by_text(xfield1, "A") + select_by_text(xcond1, "Ends with") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"s"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -704,12 +661,8 @@ class standardFilter(UITestCase): xval1 = xDialog.getChild("val1") xcond1 = xDialog.getChild("cond1") - props = {"TEXT": "A"} - actionProps = mkPropertyValues(props) - xfield1.executeAction("SELECT", actionProps) - props2 = {"TEXT": "Does not end with"} - actionProps2 = mkPropertyValues(props2) - xcond1.executeAction("SELECT", actionProps2) + select_by_text(xfield1, "A") + select_by_text(xcond1, "Does not end with") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"s"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) diff --git a/sc/qa/uitest/calc_tests2/tdf104117.py b/sc/qa/uitest/calc_tests2/tdf104117.py index 84ab28580461..f835d47030bb 100644 --- a/sc/qa/uitest/calc_tests2/tdf104117.py +++ b/sc/qa/uitest/calc_tests2/tdf104117.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_sheet_from_doc from libreoffice.calc.conditional_format import get_conditional_format_from_sheet @@ -34,9 +35,7 @@ class tdf104117(UITestCase): xdecimalplacesspin = xDialog.getChild("decimal-places-spin") xcellrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$2"})) - props = {"TEXT": "Uniform Integer"} - actionProps = mkPropertyValues(props) - xdistributioncombo.executeAction("SELECT", actionProps) + select_by_text(xdistributioncombo, "Uniform Integer") xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) xparameter2spin.executeAction("TYPE", mkPropertyValues({"TEXT":"1000000000000000000000000000000000000000000000"})) @@ -51,4 +50,4 @@ class tdf104117(UITestCase): self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), False) self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), False) self.ui_test.close_doc() -# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests3/tdf77509.py b/sc/qa/uitest/calc_tests3/tdf77509.py index 19ae4e31640b..bd9854b866e9 100644 --- a/sc/qa/uitest/calc_tests3/tdf77509.py +++ b/sc/qa/uitest/calc_tests3/tdf77509.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -30,9 +31,7 @@ class tdf77509(UITestCase): xbycol = xDialog.getChild("bycol") xeddestarea = xDialog.getChild("eddestarea") - props = {"TEXT": "Sum"} - actionProps = mkPropertyValues(props) - xfunc.executeAction("SELECT", actionProps) + select_by_text(xfunc, "Sum") #4. Source data ranges: $Sheet1.$A$1:$B$7 #5. Click 'Add' so that ranges appear in "Consolidation ranges" xeddataarea.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$7"})) @@ -55,4 +54,4 @@ class tdf77509(UITestCase): self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 1) self.ui_test.close_doc() -# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests3/tdf80693.py b/sc/qa/uitest/calc_tests3/tdf80693.py index f416fce81514..afd8fea164d0 100644 --- a/sc/qa/uitest/calc_tests3/tdf80693.py +++ b/sc/qa/uitest/calc_tests3/tdf80693.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_sheet_from_doc from libreoffice.calc.conditional_format import get_conditional_format_from_sheet @@ -34,9 +35,7 @@ class tdf80693(UITestCase): xdecimalplacesspin = xDialog.getChild("decimal-places-spin") xcellrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$2"})) - props = {"TEXT": "Uniform"} - actionProps = mkPropertyValues(props) - xdistributioncombo.executeAction("SELECT", actionProps) + select_by_text(xdistributioncombo, "Uniform") xparameter1spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) xparameter1spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) @@ -55,4 +54,4 @@ class tdf80693(UITestCase): self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), False) self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), False) self.ui_test.close_doc() -# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests4/tdf89958.py b/sc/qa/uitest/calc_tests4/tdf89958.py index 8dc9ba59c2f2..223b673e8fec 100644 --- a/sc/qa/uitest/calc_tests4/tdf89958.py +++ b/sc/qa/uitest/calc_tests4/tdf89958.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -31,12 +32,8 @@ class tdf89958(UITestCase): xval1 = xDialog.getChild("val1") xcond1 = xDialog.getChild("cond1") - props = {"TEXT": "Column A"} - actionProps = mkPropertyValues(props) - xfield1.executeAction("SELECT", actionProps) - props2 = {"TEXT": "Does not end with"} - actionProps2 = mkPropertyValues(props2) - xcond1.executeAction("SELECT", actionProps2) + select_by_text(xfield1, "Column A") + select_by_text(xcond1, "Does not end with") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"CTORS"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -65,4 +62,4 @@ class tdf89958(UITestCase): self.ui_test.close_doc() -# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests6/tdf107267.py b/sc/qa/uitest/calc_tests6/tdf107267.py index 70350a15e127..57d15dff17e6 100644 --- a/sc/qa/uitest/calc_tests6/tdf107267.py +++ b/sc/qa/uitest/calc_tests6/tdf107267.py @@ -11,6 +11,7 @@ from libreoffice.calc.document import get_column from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file #Bug 107267 - During a sub-total calculation or sum, the data set is not computed well. @@ -31,9 +32,7 @@ class Subtotals(UITestCase): select_pos(xTabs, "0") # = 1st group = 3. Group by "Person Number", select "shipping time" and use the Max function. xGroupBy = xDialog.getChild("group_by") - props = {"TEXT": "Person Number"} - actionProps = mkPropertyValues(props) - xGroupBy.executeAction("SELECT", actionProps) + select_by_text(xGroupBy, "Person Number") # 4. Tick 'Calculate subtotals for' -> "shipping time" - already selected # xCheckListMenu = xDialog.getChild("grid1") # xTreeList = xCheckListMenu.getChild("columns") @@ -44,9 +43,7 @@ class Subtotals(UITestCase): #= 2nd group =5. Group by "Person Number", select "shipping time" and use the Min function. select_pos(xTabs, "1") xGroupBy = xDialog.getChild("group_by") - props = {"TEXT": "Person Number"} - actionProps = mkPropertyValues(props) - xGroupBy.executeAction("SELECT", actionProps) + select_by_text(xGroupBy, "Person Number") # 4. Tick 'Calculate subtotals for' -> "shipping time" - already selected # xCheckListMenu = xDialog.getChild("grid1") # xTreeList = xCheckListMenu.getChild("columns") @@ -57,9 +54,7 @@ class Subtotals(UITestCase): #= 3rd group = Group by "Person Number", select "shipping time" and use the Average function. select_pos(xTabs, "2") xGroupBy = xDialog.getChild("group_by") - props = {"TEXT": "Person Number"} - actionProps = mkPropertyValues(props) - xGroupBy.executeAction("SELECT", actionProps) + select_by_text(xGroupBy, "Person Number") # 4. Tick 'Calculate subtotals for' -> "shipping time" - already selected # xCheckListMenu = xDialog.getChild("grid1") # xTreeList = xCheckListMenu.getChild("columns") diff --git a/sc/qa/uitest/calc_tests6/tdf118638.py b/sc/qa/uitest/calc_tests6/tdf118638.py index 284c423fe2b2..5bc25663fcbe 100644 --- a/sc/qa/uitest/calc_tests6/tdf118638.py +++ b/sc/qa/uitest/calc_tests6/tdf118638.py @@ -11,6 +11,7 @@ from libreoffice.calc.document import get_column from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file #Bug 118638 - subtotal option loses doesn't contain existing format for column @@ -30,9 +31,7 @@ class Subtotals(UITestCase): xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "0") xGroupBy = xDialog.getChild("group_by") - props = {"TEXT": "Store Name"} - actionProps = mkPropertyValues(props) - xGroupBy.executeAction("SELECT", actionProps) + select_by_text(xGroupBy, "Store Name") xCheckListMenu = xDialog.getChild("grid1") xTreeList = xCheckListMenu.getChild("columns") xEntry = xTreeList.getChild("1") diff --git a/sc/qa/uitest/calc_tests8/tdf126248.py b/sc/qa/uitest/calc_tests8/tdf126248.py index f633bf9bcf41..146ee8a75131 100644 --- a/sc/qa/uitest/calc_tests8/tdf126248.py +++ b/sc/qa/uitest/calc_tests8/tdf126248.py @@ -10,6 +10,7 @@ from uitest.uihelper.common import get_state_as_dict from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.calc import enter_text_to_cell from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text class tdf126248(UITestCase): @@ -43,7 +44,7 @@ class tdf126248(UITestCase): self.assertEqual("true", get_state_as_dict(asianlanguage)['Selected']) localeSetting = xDialog.getChild("localesetting") - localeSetting.executeAction("SELECT", mkPropertyValues({"TEXT": language})) + select_by_text(localeSetting, language) self.assertEqual(language, get_state_as_dict(localeSetting)['SelectEntryText']) diff --git a/sc/qa/uitest/chart/chartDataLabels.py b/sc/qa/uitest/chart/chartDataLabels.py index d581a98b1982..ebdc700eb402 100644 --- a/sc/qa/uitest/chart/chartDataLabels.py +++ b/sc/qa/uitest/chart/chartDataLabels.py @@ -6,6 +6,7 @@ # from uitest.framework import UITestCase from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.common import change_measurement_unit from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position @@ -59,17 +60,11 @@ class chartDataLabels(UITestCase): category.executeAction("CLICK", tuple()) legend.executeAction("CLICK", tuple()) wrapText.executeAction("CLICK", tuple()) - props = {"TEXT": "Comma"} - actionProps = mkPropertyValues(props) - separator.executeAction("SELECT", actionProps) + select_by_text(separator, "Comma") - props2 = {"TEXT": "Below"} - actionProps2 = mkPropertyValues(props2) - placement.executeAction("SELECT", actionProps2) + select_by_text(placement, "Below") degrees.executeAction("UP", tuple()) - props3 = {"TEXT": "Right-to-left"} - actionProps3 = mkPropertyValues(props3) - textDirection.executeAction("SELECT", actionProps3) + select_by_text(textDirection, "Right-to-left") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) diff --git a/sc/qa/uitest/chart/chartXAxis.py b/sc/qa/uitest/chart/chartXAxis.py index d9e9a72053c1..d169fa5d683e 100644 --- a/sc/qa/uitest/chart/chartXAxis.py +++ b/sc/qa/uitest/chart/chartXAxis.py @@ -6,6 +6,7 @@ # from uitest.framework import UITestCase from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.common import change_measurement_unit from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position @@ -106,19 +107,13 @@ class chartXAxis(UITestCase): outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") placeMarks = xDialog.getChild("LB_PLACE_TICKS") - props = {"TEXT": "Start"} - actionProps = mkPropertyValues(props) - crossAxis.executeAction("SELECT", actionProps) - props2 = {"TEXT": "Outside end"} - actionProps2 = mkPropertyValues(props2) - placeLabels.executeAction("SELECT", actionProps2) + select_by_text(crossAxis, "Start") + select_by_text(placeLabels, "Outside end") innerMajorTick.executeAction("CLICK", tuple()) outerMajorTick.executeAction("CLICK", tuple()) innerMinorTick.executeAction("CLICK", tuple()) outerMinorTick.executeAction("CLICK", tuple()) - props3 = {"TEXT": "At axis"} - actionProps3 = mkPropertyValues(props3) - placeMarks.executeAction("SELECT", actionProps3) + select_by_text(placeMarks, "At axis") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -152,9 +147,7 @@ class chartXAxis(UITestCase): self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true") self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis") #change tab "positioning". - props = {"TEXT": "Value"} - actionProps = mkPropertyValues(props) - crossAxis.executeAction("SELECT", actionProps) + select_by_text(crossAxis, "Value") crossAxisValue.executeAction("UP", tuple()) #1 xOKBtn = xDialog.getChild("ok") @@ -233,9 +226,7 @@ class chartXAxis(UITestCase): overlapCB.executeAction("CLICK", tuple()) breakCB.executeAction("CLICK", tuple()) stackedCB.executeAction("CLICK", tuple()) - props = {"TEXT": "Right-to-left"} - actionProps = mkPropertyValues(props) - textdirLB.executeAction("SELECT", actionProps) + select_by_text(textdirLB, "Right-to-left") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) diff --git a/sc/qa/uitest/chart/chartYAxis.py b/sc/qa/uitest/chart/chartYAxis.py index 4e5412ab3652..22c3b79329d5 100644 --- a/sc/qa/uitest/chart/chartYAxis.py +++ b/sc/qa/uitest/chart/chartYAxis.py @@ -6,6 +6,7 @@ # from uitest.framework import UITestCase from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.common import change_measurement_unit from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position @@ -107,19 +108,13 @@ class chartYAxis(UITestCase): outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") placeMarks = xDialog.getChild("LB_PLACE_TICKS") - props = {"TEXT": "Start"} - actionProps = mkPropertyValues(props) - crossAxis.executeAction("SELECT", actionProps) - props2 = {"TEXT": "Outside end"} - actionProps2 = mkPropertyValues(props2) - placeLabels.executeAction("SELECT", actionProps2) + select_by_text(crossAxis, "Start") + select_by_text(placeLabels, "Outside end") innerMajorTick.executeAction("CLICK", tuple()) outerMajorTick.executeAction("CLICK", tuple()) innerMinorTick.executeAction("CLICK", tuple()) outerMinorTick.executeAction("CLICK", tuple()) - props3 = {"TEXT": "At axis"} - actionProps3 = mkPropertyValues(props3) - placeMarks.executeAction("SELECT", actionProps3) + select_by_text(placeMarks, "At axis") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -153,9 +148,7 @@ class chartYAxis(UITestCase): self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true") self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis") #change tab "positioning". - props = {"TEXT": "Value"} - actionProps = mkPropertyValues(props) - crossAxis.executeAction("SELECT", actionProps) + select_by_text(crossAxis, "Value") crossAxisValue.executeAction("CLEAR", tuple()) crossAxisValue.executeAction("TYPE", mkPropertyValues({"TEXT":"19.01.2018"})) #19.01.2018 @@ -235,9 +228,7 @@ class chartYAxis(UITestCase): overlapCB.executeAction("CLICK", tuple()) breakCB.executeAction("CLICK", tuple()) stackedCB.executeAction("CLICK", tuple()) - props = {"TEXT": "Right-to-left"} - actionProps = mkPropertyValues(props) - textdirLB.executeAction("SELECT", actionProps) + select_by_text(textdirLB, "Right-to-left") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) diff --git a/sc/qa/uitest/chart/tdf123520.py b/sc/qa/uitest/chart/tdf123520.py index f402f2d4d859..150467bb5990 100644 --- a/sc/qa/uitest/chart/tdf123520.py +++ b/sc/qa/uitest/chart/tdf123520.py @@ -6,6 +6,7 @@ # from uitest.framework import UITestCase from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -44,9 +45,7 @@ class tdf123520(UITestCase): #crossAxisValue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"TAB"})) #TAB doesn't works- add "a" at the end of textbox #workaround - edit another ui item, it should trigger leave of textbox - props2 = {"TEXT": "Outside start"} - actionProps2 = mkPropertyValues(props2) - placeLabels.executeAction("SELECT", actionProps2) + select_by_text(placeLabels, "Outside start") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) diff --git a/sc/qa/uitest/chart/tdf93506_trendline.py b/sc/qa/uitest/chart/tdf93506_trendline.py index 5b80202d2c98..8efd880ccbb5 100644 --- a/sc/qa/uitest/chart/tdf93506_trendline.py +++ b/sc/qa/uitest/chart/tdf93506_trendline.py @@ -6,6 +6,7 @@ # from uitest.framework import UITestCase from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.common import change_measurement_unit from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position @@ -401,7 +402,7 @@ class tdf93506(UITestCase): yVarName = xDialog.getChild("entry_Yname") movingAverage.executeAction("CLICK", tuple()) #set polynomial - movingAverageType.executeAction("SELECT", mkPropertyValues({"TEXT": "Averaged Abscissa"})) + select_by_text(movingAverageType, "Averaged Abscissa") period.executeAction("UP", tuple()) #Click on tab "Line". diff --git a/sc/qa/uitest/conditional_format/tdf105351.py b/sc/qa/uitest/conditional_format/tdf105351.py index 2f9d55ff5c86..53e68a343a86 100644 --- a/sc/qa/uitest/conditional_format/tdf105351.py +++ b/sc/qa/uitest/conditional_format/tdf105351.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -31,14 +32,10 @@ class tdf105351(UITestCase): #4. In the conditional formatting window, select the dropdown on the left that says "Automatic" #and change it to "Value". In the text field below it enter 0. #5. Select the dropdown on the right that says "Automatic" and change it to "Value". In the text field below it enter 10 - props = {"TEXT": "Value"} - actionProps = mkPropertyValues(props) - xcolscalemin.executeAction("SELECT", actionProps) + select_by_text(xcolscalemin, "Value") xedcolscalemin.executeAction("TYPE", mkPropertyValues({"TEXT":"0"})) - props2 = {"TEXT": "Value"} - actionProps2 = mkPropertyValues(props2) - xcolscalemax.executeAction("SELECT", actionProps2) + select_by_text(xcolscalemax, "Value") xedcolscalemax.executeAction("TYPE", mkPropertyValues({"TEXT":"10"})) xOKBtn = xDialog.getChild("ok") diff --git a/sc/qa/uitest/key_f4/f4.py b/sc/qa/uitest/key_f4/f4.py index dbdbdbd5df95..ede0b2fdef9c 100644 --- a/sc/qa/uitest/key_f4/f4.py +++ b/sc/qa/uitest/key_f4/f4.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase import os from uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.common import select_by_text from uitest.debug import sleep from libreoffice.uno.propertyvalue import mkPropertyValues from libreoffice.calc.document import get_cell_by_position @@ -94,9 +95,7 @@ class keyF4(UITestCase): formulasyntax = xDialogOpt.getChild("formulasyntax") #Excel R1C1 - props = {"TEXT": "Excel R1C1"} - actionProps = mkPropertyValues(props) - formulasyntax.executeAction("SELECT", actionProps) + select_by_text(formulasyntax, "Excel R1C1") xOKBtn = xDialogOpt.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -128,9 +127,7 @@ class keyF4(UITestCase): formulasyntax = xDialogOpt.getChild("formulasyntax") #Excel R1C1 - props = {"TEXT": "Calc A1"} - actionProps = mkPropertyValues(props) - formulasyntax.executeAction("SELECT", actionProps) + select_by_text(formulasyntax, "Calc A1") xOKBtn = xDialogOpt.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) diff --git a/sc/qa/uitest/pageFormat/tdf123508.py b/sc/qa/uitest/pageFormat/tdf123508.py index e3ec5327649a..61d53fd4187b 100644 --- a/sc/qa/uitest/pageFormat/tdf123508.py +++ b/sc/qa/uitest/pageFormat/tdf123508.py @@ -6,6 +6,7 @@ # from uitest.framework import UITestCase from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -28,9 +29,7 @@ class tdf123508(UITestCase): spinEDSCALEPAGEWIDTH = xDialog.getChild("spinED_SCALEPAGEWIDTH") spinEDSCALEPAGEHEIGHT = xDialog.getChild("spinED_SCALEPAGEHEIGHT") #select "Fit print range(s) to width/height" from the scale mode drop-down list - props = {"TEXT": "Fit print range(s) to width/height"} - actionProps = mkPropertyValues(props) - scalingMode.executeAction("SELECT", actionProps) + select_by_text(scalingMode, "Fit print range(s) to width/height") #define a value for the page, e.g.: width 2; height 2 spinEDSCALEPAGEWIDTH.executeAction("UP", tuple()) spinEDSCALEPAGEHEIGHT.executeAction("UP", tuple()) diff --git a/sc/qa/uitest/range_name/tdf137617.py b/sc/qa/uitest/range_name/tdf137617.py index f0184e4ad6d9..54c458823fe6 100644 --- a/sc/qa/uitest/range_name/tdf137617.py +++ b/sc/qa/uitest/range_name/tdf137617.py @@ -8,6 +8,7 @@ from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell class tdf137617(UITestCase): @@ -57,10 +58,7 @@ class tdf137617(UITestCase): xCalcFormulaEntry.executeAction("SELECT", tuple()) xFormulaSyntax = xDialogOpt.getChild('formulasyntax') - - props = {"TEXT": "Excel R1C1"} - actionProps = mkPropertyValues(props) - xFormulaSyntax.executeAction("SELECT", actionProps) + select_by_text(xFormulaSyntax, "Excel R1C1") xOKBtn = xDialogOpt.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -104,10 +102,7 @@ class tdf137617(UITestCase): xCalcFormulaEntry.executeAction("SELECT", tuple()) xFormulaSyntax = xDialogOpt.getChild('formulasyntax') - - props = {"TEXT": "Calc A1"} - actionProps = mkPropertyValues(props) - xFormulaSyntax.executeAction("SELECT", actionProps) + select_by_text(xFormulaSyntax, "Calc A1") xOKBtn = xDialogOpt.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) diff --git a/sc/qa/uitest/search_replace/tdf35020.py b/sc/qa/uitest/search_replace/tdf35020.py index 910c64deacb7..994bcd21a89d 100644 --- a/sc/qa/uitest/search_replace/tdf35020.py +++ b/sc/qa/uitest/search_replace/tdf35020.py @@ -6,6 +6,7 @@ # from uitest.framework import UITestCase from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -31,9 +32,7 @@ class tdf35020(UITestCase): allsheets = xDialog.getChild("allsheets") allsheets.executeAction("CLICK", tuple()) calcsearchin = xDialog.getChild("calcsearchin") - props = {"TEXT": "Formulas"} - actionProps = mkPropertyValues(props) - calcsearchin.executeAction("SELECT", actionProps) + select_by_text(calcsearchin, "Formulas") replaceall = xDialog.getChild("replaceall") replaceall.executeAction("CLICK", tuple()) xcloseBtn = xDialog.getChild("close") diff --git a/sc/qa/uitest/search_replace/tdf39917.py b/sc/qa/uitest/search_replace/tdf39917.py index 1af5b9c39fab..456e4a4acf12 100644 --- a/sc/qa/uitest/search_replace/tdf39917.py +++ b/sc/qa/uitest/search_replace/tdf39917.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -33,9 +34,7 @@ class tdf39917(UITestCase): formulasyntax = xDialogOpt.getChild("formulasyntax") #Excel R1C1 - props = {"TEXT": "Excel R1C1"} - actionProps = mkPropertyValues(props) - formulasyntax.executeAction("SELECT", actionProps) + select_by_text(formulasyntax, "Excel R1C1") xOKBtn = xDialogOpt.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -100,9 +99,7 @@ class tdf39917(UITestCase): formulasyntax = xDialogOpt.getChild("formulasyntax") #Excel R1C1 - props = {"TEXT": "Calc A1"} - actionProps = mkPropertyValues(props) - formulasyntax.executeAction("SELECT", actionProps) + select_by_text(formulasyntax, "Calc A1") xOKBtn = xDialogOpt.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) diff --git a/sc/qa/uitest/solver/solver.py b/sc/qa/uitest/solver/solver.py index 80b1f5b3698d..617b2147a7cc 100644 --- a/sc/qa/uitest/solver/solver.py +++ b/sc/qa/uitest/solver/solver.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -36,9 +37,7 @@ class solver(UITestCase): xref1edit.executeAction("TYPE", mkPropertyValues({"TEXT":"C2"})) xval1edit.executeAction("TYPE", mkPropertyValues({"TEXT":"C4"})) xref2edit.executeAction("TYPE", mkPropertyValues({"TEXT":"C4"})) - props = {"TEXT": "=>"} - actionProps = mkPropertyValues(props) - xop2list.executeAction("SELECT", actionProps) + select_by_text(xop2list, "=>") xval2edit.executeAction("TYPE", mkPropertyValues({"TEXT":"0"})) xOKBtn = xDialog.getChild("ok") diff --git a/sc/qa/uitest/sort/subtotals.py b/sc/qa/uitest/sort/subtotals.py index 3a48cd21335a..b17dbb73cbf4 100644 --- a/sc/qa/uitest/sort/subtotals.py +++ b/sc/qa/uitest/sort/subtotals.py @@ -11,6 +11,7 @@ from libreoffice.calc.document import get_column from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file class Subtotals(UITestCase): @@ -62,9 +63,7 @@ class Subtotals(UITestCase): xDialog = self.xUITest.getTopFocusWindow() # Select group by: Category xGroupBy = xDialog.getChild("group_by") - props = {"TEXT": "Category"} - actionProps = mkPropertyValues(props) - xGroupBy.executeAction("SELECT", actionProps) + select_by_text(xGroupBy, "Category") # Select calculate subtotals for the months - selected by default # Select tab options xTabs = xDialog.getChild("tabcontrol") @@ -90,9 +89,7 @@ class Subtotals(UITestCase): self.ui_test.execute_dialog_through_command(".uno:DataSubTotals") xDialog = self.xUITest.getTopFocusWindow() xGroupBy = xDialog.getChild("group_by") - props = {"TEXT": "- none -"} - actionProps = mkPropertyValues(props) - xGroupBy.executeAction("SELECT", actionProps) + select_by_text(xGroupBy, "- none -") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) # 2 invoke sort menu and... crash @@ -116,9 +113,7 @@ class Subtotals(UITestCase): xDialog = self.xUITest.getTopFocusWindow() # 3. Group by->Trans date xGroupBy = xDialog.getChild("group_by") - props = {"TEXT": "Trans Date"} - actionProps = mkPropertyValues(props) - xGroupBy.executeAction("SELECT", actionProps) + select_by_text(xGroupBy, "Trans Date") # 4. Tick 'Calculate subtotals for' -> Amount (grid1) xCheckListMenu = xDialog.getChild("grid1") xTreeList = xCheckListMenu.getChild("columns") @@ -132,9 +127,7 @@ class Subtotals(UITestCase): xDialog = self.xUITest.getTopFocusWindow() # 7. Group by->-none- xGroupBy = xDialog.getChild("group_by") - props = {"TEXT": "- none -"} - actionProps = mkPropertyValues(props) - xGroupBy.executeAction("SELECT", actionProps) + select_by_text(xGroupBy, "- none -") # 8. Untick 'Calculate subtotals for' -> Amount xCheckListMenu = xDialog.getChild("grid1") xTreeList = xCheckListMenu.getChild("columns") @@ -148,14 +141,10 @@ class Subtotals(UITestCase): xDialog = self.xUITest.getTopFocusWindow() # 11. Sort key 1->Post Date. sortkey1 = xDialog.getChild("sortlb") - props = {"TEXT": "Post Date"} - actionProps = mkPropertyValues(props) - sortkey1.executeAction("SELECT", actionProps) + select_by_text(sortkey1, "Post Date") # 12. Sort key 2->-undefined- sortkey2 = xDialog.getChild("sortuserlb") - props = {"TEXT": "- undefined -"} - actionProps = mkPropertyValues(props) - sortkey2.executeAction("SELECT", actionProps) + select_by_text(sortkey2, "- undefined -") # 13. Click OK xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -175,9 +164,7 @@ class Subtotals(UITestCase): xDialog = self.xUITest.getTopFocusWindow() # 4. Group by: "- none -" xGroupBy = xDialog.getChild("group_by") - props = {"TEXT": "- none -"} - actionProps = mkPropertyValues(props) - xGroupBy.executeAction("SELECT", actionProps) + select_by_text(xGroupBy, "- none -") # 5. Press "OK" and watch LibreOffice crash. xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) diff --git a/sc/qa/uitest/sort/tdf49531.py b/sc/qa/uitest/sort/tdf49531.py index de50d5880592..1d66f6a36c5a 100644 --- a/sc/qa/uitest/sort/tdf49531.py +++ b/sc/qa/uitest/sort/tdf49531.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -40,9 +41,7 @@ class tdf49531(UITestCase): select_pos(xTabs, "0") xSortKey1 = xDialog.getChild("sortlb") xAsc = xDialog.getChild("up") - props = {"TEXT": "Column B"} - actionProps = mkPropertyValues(props) - xSortKey1.executeAction("SELECT", actionProps) + select_by_text(xSortKey1, "Column B") xAsc.executeAction("CLICK", tuple()) xOk = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOk) diff --git a/sc/qa/uitest/sort/tdf53482.py b/sc/qa/uitest/sort/tdf53482.py index 95e2533849f0..1e6fa01b404a 100644 --- a/sc/qa/uitest/sort/tdf53482.py +++ b/sc/qa/uitest/sort/tdf53482.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -37,9 +38,7 @@ class tdf53482(UITestCase): xDown = xDialog.getChild("down") xDown.executeAction("CLICK", tuple()) xSortKey1 = xDialog.getChild("sortlb") - props = {"TEXT": "Occupation"} - actionProps = mkPropertyValues(props) - xSortKey1.executeAction("SELECT", actionProps) + select_by_text(xSortKey1, "Occupation") #5. Click Ok xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) @@ -89,4 +88,4 @@ class tdf53482(UITestCase): self.ui_test.close_doc() -# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/sort/tdf54018.py b/sc/qa/uitest/sort/tdf54018.py index ea9fc2994e2e..db5085e9266c 100644 --- a/sc/qa/uitest/sort/tdf54018.py +++ b/sc/qa/uitest/sort/tdf54018.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -29,9 +30,7 @@ class tdf54018(UITestCase): select_pos(xTabs, "0") xSortKey1 = xDialog.getChild("sortlb") xdown = xDialog.getChild("down") - props = {"TEXT": "Column B"} - actionProps = mkPropertyValues(props) - xSortKey1.executeAction("SELECT", actionProps) + select_by_text(xSortKey1, "Column B") xdown.executeAction("CLICK", tuple()) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -47,4 +46,4 @@ class tdf54018(UITestCase): self.ui_test.close_doc() -# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/sort/tdf99208.py b/sc/qa/uitest/sort/tdf99208.py index f590b9f2063e..1b9680a19cb7 100644 --- a/sc/qa/uitest/sort/tdf99208.py +++ b/sc/qa/uitest/sort/tdf99208.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -42,9 +43,7 @@ class tdf99208(UITestCase): select_pos(xTabs, "0") xSortKey1 = xDialog.getChild("sortlb") xAsc = xDialog.getChild("up") - props = {"TEXT": "FODMAP"} - actionProps = mkPropertyValues(props) - xSortKey1.executeAction("SELECT", actionProps) + select_by_text(xSortKey1, "FODMAP") xAsc.executeAction("CLICK", tuple()) xOk = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOk) @@ -62,4 +61,4 @@ class tdf99208(UITestCase): self.ui_test.close_doc() -# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/validity/tdf138134.py b/sc/qa/uitest/validity/tdf138134.py index 6d660019d15e..1bbdc443d60e 100644 --- a/sc/qa/uitest/validity/tdf138134.py +++ b/sc/qa/uitest/validity/tdf138134.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -35,13 +36,9 @@ class DetectiveCircle(UITestCase): xmin = xDialog.getChild("min") xmax = xDialog.getChild("max") - props = {"TEXT": "Whole Numbers"} - actionProps = mkPropertyValues(props) - xallow.executeAction("SELECT", actionProps) + select_by_text(xallow, "Whole Numbers") xallowempty.executeAction("CLICK", tuple()) - propsA = {"TEXT": "equal"} - actionPropsA = mkPropertyValues(propsA) - xdata.executeAction("SELECT", actionPropsA) + select_by_text(xdata, "equal") xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"5"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) diff --git a/sc/qa/uitest/validity/tdf53920.py b/sc/qa/uitest/validity/tdf53920.py index 221922d4b2d7..e1a4fc87efaa 100644 --- a/sc/qa/uitest/validity/tdf53920.py +++ b/sc/qa/uitest/validity/tdf53920.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -35,9 +36,7 @@ class tdf53920(UITestCase): xallow = xDialog.getChild("allow") xmin = xDialog.getChild("min") - props = {"TEXT": "Cell range"} - actionProps = mkPropertyValues(props) - xallow.executeAction("SELECT", actionProps) + select_by_text(xallow, "Cell range") xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$C$1:$C$3"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) diff --git a/sc/qa/uitest/validity/tdf65686.py b/sc/qa/uitest/validity/tdf65686.py index e2bc037c3837..557701b1dd7f 100644 --- a/sc/qa/uitest/validity/tdf65686.py +++ b/sc/qa/uitest/validity/tdf65686.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -30,9 +31,7 @@ class tdf65686(UITestCase): xallowempty = xDialog.getChild("allowempty") minlist = xDialog.getChild("minlist") - props = {"TEXT": "List"} - actionProps = mkPropertyValues(props) - xallow.executeAction("SELECT", actionProps) + select_by_text(xallow, "List") minlist.executeAction("TYPE", mkPropertyValues({"TEXT":"Aap"})) minlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) minlist.executeAction("TYPE", mkPropertyValues({"TEXT":"Noot"})) diff --git a/sc/qa/uitest/validity/tdf96698.py b/sc/qa/uitest/validity/tdf96698.py index c219e044478d..a3bd19c2f3ef 100644 --- a/sc/qa/uitest/validity/tdf96698.py +++ b/sc/qa/uitest/validity/tdf96698.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -29,9 +30,7 @@ class tdf96698(UITestCase): xallowempty = xDialog.getChild("allowempty") xmin = xDialog.getChild("min") - props = {"TEXT": "Custom"} - actionProps = mkPropertyValues(props) - xallow.executeAction("SELECT", actionProps) + select_by_text(xallow, "Custom") xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"ISERROR(FIND(\",\",B2))"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -57,9 +56,7 @@ class tdf96698(UITestCase): xallowempty = xDialog.getChild("allowempty") xmin = xDialog.getChild("min") - props = {"TEXT": "Custom"} - actionProps = mkPropertyValues(props) - xallow.executeAction("SELECT", actionProps) + select_by_text(xallow, "Custom") xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"NOT(ISERROR(B3))"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -85,9 +82,7 @@ class tdf96698(UITestCase): xallowempty = xDialog.getChild("allowempty") xmin = xDialog.getChild("min") - props = {"TEXT": "Custom"} - actionProps = mkPropertyValues(props) - xallow.executeAction("SELECT", actionProps) + select_by_text(xallow, "Custom") xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"ISERROR(FIND(\",\",A7))"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) @@ -113,9 +108,7 @@ class tdf96698(UITestCase): xallowempty = xDialog.getChild("allowempty") xmin = xDialog.getChild("min") - props = {"TEXT": "Custom"} - actionProps = mkPropertyValues(props) - xallow.executeAction("SELECT", actionProps) + select_by_text(xallow, "Custom") xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"NOT(ISERROR(A8))"})) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) diff --git a/sc/qa/uitest/validity/validity.py b/sc/qa/uitest/validity/validity.py index 93cd2461e7a7..dc36e96f87df 100644 --- a/sc/qa/uitest/validity/validity.py +++ b/sc/qa/uitest/validity/validity.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -29,13 +30,9 @@ class validity(UITestCase): xmin = xDialog.getChild("min") xmax = xDialog.getChild("max") - props = {"TEXT": "Whole Numbers"} - actionProps = mkPropertyValues(props) - xallow.executeAction("SELECT", actionProps) + select_by_text(xallow, "Whole Numbers") xallowempty.executeAction("CLICK", tuple()) - propsA = {"TEXT": "valid range"} - actionPropsA = mkPropertyValues(propsA) - xdata.executeAction("SELECT", actionPropsA) + select_by_text(xdata, "valid range") xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) xmax.executeAction("TYPE", mkPropertyValues({"TEXT":"2"})) xOKBtn = xDialog.getChild("ok") @@ -114,9 +111,7 @@ class validity(UITestCase): xerroralerttitle = xDialog.getChild("erroralert_title") xerrorMsg = xDialog.getChild("errorMsg") - props = {"TEXT": "Warning"} - actionProps = mkPropertyValues(props) - xactionCB.executeAction("SELECT", actionProps) + select_by_text(xactionCB, "Warning") xerroralerttitle.executeAction("TYPE", mkPropertyValues({"TEXT":"Warn"})) xerrorMsg.executeAction("TYPE", mkPropertyValues({"TEXT":"Warn2"})) xOKBtn = xDialog.getChild("ok") diff --git a/sw/qa/uitest/chapterNumbering/chapterNumbering.py b/sw/qa/uitest/chapterNumbering/chapterNumbering.py index 67e82a40014f..9d3f0b5b4129 100644 --- a/sw/qa/uitest/chapterNumbering/chapterNumbering.py +++ b/sw/qa/uitest/chapterNumbering/chapterNumbering.py @@ -10,6 +10,7 @@ from uitest.debug import sleep from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict, type_text from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.common import change_measurement_unit #Outline Numbering is now Chapter Numbering @@ -38,27 +39,17 @@ class WriterChapterNumbering(UITestCase): xatmf = xDialog.getChild("atmf") xindentatmf = xDialog.getChild("indentatmf") select_pos(xtab, "0") #first tab - props = {"TEXT": "Heading"} - actionProps = mkPropertyValues(props) - xstyle.executeAction("SELECT", actionProps) - props2 = {"TEXT": "1, 2, 3, ..."} - actionProps2 = mkPropertyValues(props2) - xnumbering.executeAction("SELECT", actionProps2) - props3 = {"TEXT": "Bullets"} - actionProps3 = mkPropertyValues(props3) - xcharstyle.executeAction("SELECT", actionProps3) + select_by_text(xstyle, "Heading") + select_by_text(xnumbering, "1, 2, 3, ...") + select_by_text(xcharstyle, "Bullets") xprefix.executeAction("TYPE", mkPropertyValues({"TEXT":"A"})) xsuffix.executeAction("TYPE", mkPropertyValues({"TEXT":"B"})) xstartat.executeAction("UP", tuple()) select_pos(xtab, "1") #second tab Position xalignedatmf.executeAction("UP", tuple()) - props4 = {"TEXT": "Centered"} - actionProps4 = mkPropertyValues(props4) - xnum2alignlb.executeAction("SELECT", actionProps4) - props5 = {"TEXT": "Tab stop"} - actionProps5 = mkPropertyValues(props5) - xnumfollowedbylb.executeAction("SELECT", actionProps5) + select_by_text(xnum2alignlb, "Centered") + select_by_text(xnumfollowedbylb, "Tab stop") xatmf.executeAction("UP", tuple()) xindentatmf.executeAction("UP", tuple()) diff --git a/sw/qa/uitest/classification/classification.py b/sw/qa/uitest/classification/classification.py index 181c00417397..61ed02cbc52a 100644 --- a/sw/qa/uitest/classification/classification.py +++ b/sw/qa/uitest/classification/classification.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -52,9 +53,7 @@ class classification(UITestCase): intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry") intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton") - props = {"TEXT": "Confidential"} - actionProps = mkPropertyValues(props) - classificationCB.executeAction("SELECT", actionProps) + select_by_text(classificationCB, "Confidential") #verify International is set too self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Confidential") #verify textBox Content @@ -96,9 +95,7 @@ class classification(UITestCase): intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry") intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton") - props = {"TEXT": "Confidential"} - actionProps = mkPropertyValues(props) - classificationCB.executeAction("SELECT", actionProps) + select_by_text(classificationCB, "Confidential") #verify International is set too self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Confidential") #verify textBox Content TODO textbox not supported @@ -128,9 +125,7 @@ class classification(UITestCase): intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry") intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton") - props = {"TEXT": "Confidential"} - actionProps = mkPropertyValues(props) - classificationCB.executeAction("SELECT", actionProps) + select_by_text(classificationCB, "Confidential") #verify International is set too self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Confidential") #verify textBox Content TODO - texbox not supported yet @@ -163,9 +158,7 @@ class classification(UITestCase): #type text AA intellectualPropertyPartEntry.executeAction("TYPE", mkPropertyValues({"TEXT":"AA"})) intellectualPropertyPartAddButton.executeAction("CLICK", tuple()) - props = {"TEXT": "Internal Only"} - actionProps = mkPropertyValues(props) - classificationCB.executeAction("SELECT", actionProps) + select_by_text(classificationCB, "Internal Only") #verify International is set too self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Internal Only") #verify textBox Content TODO - texbox not supported yet diff --git a/sw/qa/uitest/findReplace/tdf106099.py b/sw/qa/uitest/findReplace/tdf106099.py index 085bba6e694a..8fb8592d6db2 100644 --- a/sw/qa/uitest/findReplace/tdf106099.py +++ b/sw/qa/uitest/findReplace/tdf106099.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -30,9 +31,7 @@ class tdf106099(UITestCase): xTabs = dialog.getChild("tabcontrol") select_pos(xTabs, "1") #tab font effects underlinelb = dialog.getChild("underlinelb") - props = {"TEXT": "Single"} - actionProps = mkPropertyValues(props) - underlinelb.executeAction("SELECT", actionProps) + select_by_text(underlinelb, "Single") xOkBtn = dialog.getChild("ok") self.ui_test.close_dialog_through_button(xOkBtn) diff --git a/sw/qa/uitest/navigator/tdf140257.py b/sw/qa/uitest/navigator/tdf140257.py index 78b6082cea8e..9c923bedee4d 100644 --- a/sw/qa/uitest/navigator/tdf140257.py +++ b/sw/qa/uitest/navigator/tdf140257.py @@ -8,6 +8,7 @@ from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict, type_text from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text class Tdf140257(UITestCase): @@ -20,9 +21,7 @@ class Tdf140257(UITestCase): xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL") - props = {"TEXT": sText} - actionProps = mkPropertyValues(props) - xOutline.executeAction("SELECT", actionProps) + select_by_text(xOutline, sText) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) diff --git a/sw/qa/uitest/sidebar/stylesSidebar.py b/sw/qa/uitest/sidebar/stylesSidebar.py index 8096a06c0d20..8364334ad77e 100644 --- a/sw/qa/uitest/sidebar/stylesSidebar.py +++ b/sw/qa/uitest/sidebar/stylesSidebar.py @@ -6,6 +6,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file +from uitest.uihelper.common import select_by_text from libreoffice.uno.propertyvalue import mkPropertyValues class StylesSidebar(UITestCase): @@ -53,7 +54,7 @@ class StylesSidebar(UITestCase): xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "StyleListPanel"})) xFilter = xWriterEdit.getChild('filter') - xFilter.executeAction("SELECT", mkPropertyValues({"TEXT": "Custom Styles"})) + select_by_text(xFilter, "Custom Styles") expectedResults = ["customParagraphStyle", "customCharacterStyle", "customFrameStyle", "customPageStyle", "customNumberingStyle"] diff --git a/sw/qa/uitest/sidebar/tdf135590.py b/sw/qa/uitest/sidebar/tdf135590.py index 99d52d8c95e3..6a061b7a1f96 100644 --- a/sw/qa/uitest/sidebar/tdf135590.py +++ b/sw/qa/uitest/sidebar/tdf135590.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, select_pos from uitest.uihelper.common import change_measurement_unit +from uitest.uihelper.common import select_by_text from libreoffice.uno.propertyvalue import mkPropertyValues class tdf135590(UITestCase): @@ -27,7 +28,7 @@ class tdf135590(UITestCase): xHeight = xDialog.getChild('height') xFormat = xDialog.getChild("format") - xFormat.executeAction("SELECT", mkPropertyValues({"TEXT": "C6 Envelope"})) + select_by_text(xFormat, "C6 Envelope") self.assertEqual("16.2", get_state_as_dict(xWidth)['Value']) self.assertEqual("11.4", get_state_as_dict(xHeight)['Value']) diff --git a/sw/qa/uitest/table/tableProperties.py b/sw/qa/uitest/table/tableProperties.py index d74260892f01..59778405bb3d 100644 --- a/sw/qa/uitest/table/tableProperties.py +++ b/sw/qa/uitest/table/tableProperties.py @@ -6,6 +6,7 @@ # from uitest.framework import UITestCase from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -56,9 +57,7 @@ class tableProperties(UITestCase): belowmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) belowmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) belowmf.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) - props = {"TEXT": "Left-to-right (LTR)"} - actionProps = mkPropertyValues(props) - textdirection.executeAction("SELECT", actionProps) + select_by_text(textdirection, "Left-to-right (LTR)") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #verify @@ -103,13 +102,9 @@ class tableProperties(UITestCase): headline = xDialog.getChild("headline") headline.executeAction("CLICK", tuple()) textdirection = xDialog.getChild("textorientation") - props = {"TEXT": "Vertical (bottom to top)"} - actionProps = mkPropertyValues(props) - textdirection.executeAction("SELECT", actionProps) + select_by_text(textdirection, "Vertical (bottom to top)") vertorient = xDialog.getChild("vertorient") - props2 = {"TEXT": "Bottom"} - actionProps2 = mkPropertyValues(props2) - vertorient.executeAction("SELECT", actionProps2) + select_by_text(vertorient, "Bottom") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #verify diff --git a/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py b/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py index 1af2bfe94933..137444857258 100644 --- a/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py +++ b/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.common import select_by_text import time from uitest.debug import sleep from uitest.uihelper.common import select_pos @@ -29,15 +30,9 @@ class asianPhoneticGuide(UITestCase): xLeft1ED.executeAction("TYPE", mkPropertyValues({"TEXT":"a"})) xRight1ED.executeAction("TYPE", mkPropertyValues({"TEXT":"w"})) - props = {"TEXT": "Right"} - actionProps = mkPropertyValues(props) - xadjustlb.executeAction("SELECT", actionProps) - props2 = {"TEXT": "Right"} - actionProps2 = mkPropertyValues(props2) - xpositionlb.executeAction("SELECT", actionProps2) - props3 = {"TEXT": "Quotation"} - actionProps3 = mkPropertyValues(props3) - xstylelb.executeAction("SELECT", actionProps3) + select_by_text(xadjustlb, "Right") + select_by_text(xpositionlb, "Right") + select_by_text(xstylelb, "Quotation") xApplyBtn = xDialog.getChild("ok") xApplyBtn.executeAction("CLICK", tuple()) diff --git a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py index 9373101a3fd8..ab053a115b4e 100644 --- a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py +++ b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py @@ -12,6 +12,7 @@ import time from uitest.debug import sleep from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.common import change_measurement_unit class formatBulletsNumbering(UITestCase): @@ -34,9 +35,7 @@ class formatBulletsNumbering(UITestCase): xokbtn = xDialog.getChild("ok") xalignedatmf.executeAction("UP", tuple()) - props = {"TEXT": "Centered"} - actionProps = mkPropertyValues(props) - xnum2alignlb.executeAction("SELECT", actionProps) + select_by_text(xnum2alignlb, "Centered") xatmf.executeAction("UP", tuple()) xindentatmf.executeAction("UP", tuple()) @@ -71,9 +70,7 @@ class formatBulletsNumbering(UITestCase): xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "4") xnumfollowedbylb = xDialog.getChild("numfollowedbylb") - props = {"TEXT": "Space"} - actionProps = mkPropertyValues(props) - xnumfollowedbylb.executeAction("SELECT", actionProps) + select_by_text(xnumfollowedbylb, "Space") xokbtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xokbtn) @@ -106,13 +103,9 @@ class formatBulletsNumbering(UITestCase): xsuffix = xDialog.getChild("suffix") xallsame = xDialog.getChild("allsame") - props = {"TEXT": "A, B, C, ..."} - actionProps = mkPropertyValues(props) - xnumfmtlb.executeAction("SELECT", actionProps) + select_by_text(xnumfmtlb, "A, B, C, ...") xstartat.executeAction("UP", tuple()) - props2 = {"TEXT": "Bullets"} - actionProps2 = mkPropertyValues(props2) - xcharstyle.executeAction("SELECT", actionProps2) + select_by_text(xcharstyle, "Bullets") xprefix.executeAction("TYPE", mkPropertyValues({"TEXT":"o"})) xsuffix.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) xsuffix.executeAction("TYPE", mkPropertyValues({"TEXT":"a"})) diff --git a/sw/qa/uitest/writer_tests2/formatCharacter.py b/sw/qa/uitest/writer_tests2/formatCharacter.py index e1da1d2cb73b..afb7b555ba54 100644 --- a/sw/qa/uitest/writer_tests2/formatCharacter.py +++ b/sw/qa/uitest/writer_tests2/formatCharacter.py @@ -12,6 +12,7 @@ import time from uitest.debug import sleep from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text class formatCharacter(UITestCase): @@ -142,13 +143,9 @@ class formatCharacter(UITestCase): xName.executeAction("TYPE", mkPropertyValues({"TEXT":"hyperlink"})) xVisited = xDialog.getChild("visitedlb") - props = {"TEXT": "Bullets"} - actionProps = mkPropertyValues(props) - xVisited.executeAction("SELECT", actionProps) + select_by_text(xVisited, "Bullets") xUnVisited = xDialog.getChild("unvisitedlb") - props = {"TEXT": "Bullets"} - actionProps = mkPropertyValues(props) - xUnVisited.executeAction("SELECT", actionProps) + select_by_text(xUnVisited, "Bullets") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) diff --git a/sw/qa/uitest/writer_tests2/formatParagraph.py b/sw/qa/uitest/writer_tests2/formatParagraph.py index b5f8df306226..edd37982d2bf 100644 --- a/sw/qa/uitest/writer_tests2/formatParagraph.py +++ b/sw/qa/uitest/writer_tests2/formatParagraph.py @@ -12,6 +12,7 @@ import time from uitest.debug import sleep from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.common import change_measurement_unit class formatParagraph(UITestCase): @@ -43,9 +44,7 @@ class formatParagraph(UITestCase): xAbovePar.executeAction("UP", tuple()) xBelowPar.executeAction("UP", tuple()) xChkspace.executeAction("CLICK", tuple()) - props = {"TEXT": "Double"} - actionProps = mkPropertyValues(props) - xLineSpacing.executeAction("SELECT", actionProps) + select_by_text(xLineSpacing, "Double") xActivate.executeAction("CLICK", tuple()) xOK = xDialog.getChild("ok") @@ -97,17 +96,11 @@ class formatParagraph(UITestCase): xLastLine = xDialog.getChild("comboLB_LASTLINE") xExpandChk = xDialog.getChild("checkCB_EXPAND") - props = {"TEXT": "Left-to-right (LTR)"} - actionProps = mkPropertyValues(props) - xTextDirection.executeAction("SELECT", actionProps) - props2 = {"TEXT": "Top"} - actionProps2 = mkPropertyValues(props2) - xAlignment.executeAction("SELECT", actionProps2) + select_by_text(xTextDirection, "Left-to-right (LTR)") + select_by_text(xAlignment, "Top") xSnapToText.executeAction("CLICK", tuple()) xJustified.executeAction("CLICK", tuple()) - props3 = {"TEXT": "Justified"} - actionProps3 = mkPropertyValues(props3) - xLastLine.executeAction("SELECT", actionProps3) + select_by_text(xLastLine, "Justified") xExpandChk.executeAction("CLICK", tuple()) xOK = xDialog.getChild("ok") @@ -166,12 +159,8 @@ class formatParagraph(UITestCase): xBegin.executeAction("UP", tuple()) xMax.executeAction("UP", tuple()) xIns.executeAction("CLICK", tuple()) - props = {"TEXT": "Column"} - actionProps = mkPropertyValues(props) - xType.executeAction("SELECT", actionProps) - props2 = {"TEXT": "After"} - actionProps2 = mkPropertyValues(props2) - xPosition.executeAction("SELECT", actionProps2) + select_by_text(xType, "Column") + select_by_text(xPosition, "After") xspinOrphan.executeAction("UP", tuple()) xspinWidow.executeAction("UP", tuple()) xcheckWidow.executeAction("CLICK", tuple()) @@ -274,12 +263,8 @@ class formatParagraph(UITestCase): xPara = xDialog.getChild("checkCB_RESTART_PARACOUNT") xParaSpin = xDialog.getChild("spinNF_RESTART_PARA") - props = {"TEXT": "Level 1"} - actionProps = mkPropertyValues(props) - xOutline.executeAction("SELECT", actionProps) - props2 = {"TEXT": "Bullet •"} - actionProps2 = mkPropertyValues(props2) - xNumbering.executeAction("SELECT", actionProps2) + select_by_text(xOutline, "Level 1") + select_by_text(xNumbering, "Bullet •") xPara.executeAction("CLICK", tuple()) xParaSpin.executeAction("UP", tuple()) @@ -467,9 +452,7 @@ class formatParagraph(UITestCase): xLines.executeAction("UP", tuple()) xSpaceToText.executeAction("UP", tuple()) xText.executeAction("TYPE", mkPropertyValues({"TEXT":"A"})) - props = {"TEXT": "Definition"} - actionProps = mkPropertyValues(props) - xCharStyle.executeAction("SELECT", actionProps) + select_by_text(xCharStyle, "Definition") xOK = xDialog.getChild("ok") xOK.executeAction("CLICK", tuple()) @@ -624,9 +607,7 @@ class formatParagraph(UITestCase): xEnd = xDialog.getChild("MTR_TRGR_END_VALUE") xGradient.executeAction("CLICK", tuple()) - props = {"TEXT": "Axial"} - actionProps = mkPropertyValues(props) - xType.executeAction("SELECT", actionProps) + select_by_text(xType, "Axial") xAngle.executeAction("UP", tuple()) xBorder.executeAction("UP", tuple()) xStart.executeAction("UP", tuple()) diff --git a/sw/qa/uitest/writer_tests3/lineNumbering.py b/sw/qa/uitest/writer_tests3/lineNumbering.py index ad1db1ce0921..ce2292cde29b 100644 --- a/sw/qa/uitest/writer_tests3/lineNumbering.py +++ b/sw/qa/uitest/writer_tests3/lineNumbering.py @@ -9,6 +9,7 @@ from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict, type_text from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.common import change_measurement_unit class WriterLineNumbering(UITestCase): @@ -35,15 +36,9 @@ class WriterLineNumbering(UITestCase): xrestarteverynewpage = xDialog.getChild("restarteverynewpage") xshownumbering.executeAction("CLICK", tuple()) - props = {"TEXT": "Bullets"} - actionProps = mkPropertyValues(props) - xstyledropdown.executeAction("SELECT", actionProps) - props2 = {"TEXT": "A, B, C, ..."} - actionProps2 = mkPropertyValues(props2) - xformatdropdown.executeAction("SELECT", actionProps2) - props3 = {"TEXT": "Right"} - actionProps3 = mkPropertyValues(props3) - xpositiondropdown.executeAction("SELECT", actionProps3) + select_by_text(xstyledropdown, "Bullets") + select_by_text(xformatdropdown, "A, B, C, ...") + select_by_text(xpositiondropdown, "Right") xspacingspin.executeAction("UP", tuple()) xintervalspin.executeAction("UP", tuple()) xtextentry.executeAction("TYPE", mkPropertyValues({"TEXT":";"})) @@ -98,9 +93,7 @@ class WriterLineNumbering(UITestCase): xshownumbering.executeAction("CLICK", tuple()) itemFormat = ["1, 2, 3, ...", "A, B, C, ...", "a, b, c, ...", "I, II, III, ...", "i, ii, iii, ...", "A, .., AA, .., AAA, ..."] for i in range(6): - props2 = {"TEXT": itemFormat[i]} - actionProps2 = mkPropertyValues(props2) - xformatdropdown.executeAction("SELECT", actionProps2) + select_by_text(xformatdropdown, itemFormat[i]) self.assertEqual(get_state_as_dict(xformatdropdown)["SelectEntryText"], itemFormat[i]) xCancelBtn = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCancelBtn) diff --git a/sw/qa/uitest/writer_tests3/sort.py b/sw/qa/uitest/writer_tests3/sort.py index 6ae06c5ecef2..26c988dd68ff 100644 --- a/sw/qa/uitest/writer_tests3/sort.py +++ b/sw/qa/uitest/writer_tests3/sort.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict, type_text +from uitest.uihelper.common import select_by_text import time from uitest.debug import sleep #Tools -Sort dialog + tdf81292 @@ -58,9 +59,7 @@ class WriterSort(UITestCase): xcharacter = xDialog.getChild("character") xseparator = xDialog.getChild("separator") xDown.executeAction("CLICK", tuple()) - props = {"TEXT": "Numerical"} - actionProps = mkPropertyValues(props) - xtypelb1.executeAction("SELECT", actionProps) + select_by_text(xtypelb1, "Numerical") xcharacter.executeAction("CLICK", tuple()) xseparator.executeAction("TYPE", mkPropertyValues({"TEXT":";"})) xOK = xDialog.getChild("ok") @@ -69,4 +68,4 @@ class WriterSort(UITestCase): self.assertEqual(document.Text.String[0:5], "2;8;3") self.ui_test.close_doc() -# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/uitest/writer_tests4/tdf134439.py b/sw/qa/uitest/writer_tests4/tdf134439.py index c10b28b448b7..07f4db79c934 100644 --- a/sw/qa/uitest/writer_tests4/tdf134439.py +++ b/sw/qa/uitest/writer_tests4/tdf134439.py @@ -6,6 +6,7 @@ # from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file +from uitest.uihelper.common import select_by_text from libreoffice.uno.propertyvalue import mkPropertyValues class tdf134439(UITestCase): @@ -32,7 +33,7 @@ class tdf134439(UITestCase): xPageStyle = xDialog.getChild("comboPageStyle") self.assertEqual("Chap 2", get_state_as_dict(xPageStyle)["SelectEntryText"]) - xPageStyle.executeAction("SELECT", mkPropertyValues({"TEXT": "Chap 3"})) + select_by_text(xPageStyle, "Chap 3") self.assertEqual("Chap 3", get_state_as_dict(xPageStyle)["SelectEntryText"]) diff --git a/sw/qa/uitest/writer_tests6/tdf124586.py b/sw/qa/uitest/writer_tests6/tdf124586.py index 8bb4f67e8888..04ac04956dfb 100644 --- a/sw/qa/uitest/writer_tests6/tdf124586.py +++ b/sw/qa/uitest/writer_tests6/tdf124586.py @@ -6,6 +6,7 @@ # from uitest.framework import UITestCase from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_by_text from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -23,9 +24,7 @@ class tdf124586(UITestCase): self.ui_test.execute_dialog_through_command(".uno:ChapterNumberingDialog") xDialog = self.xUITest.getTopFocusWindow() xstyle = xDialog.getChild("style") - props = {"TEXT": "MyHeading"} - actionProps = mkPropertyValues(props) - xstyle.executeAction("SELECT", actionProps) + select_by_text(xstyle, "MyHeading") xOK = xDialog.getChild("ok") xOK.executeAction("CLICK", tuple()) diff --git a/sw/qa/uitest/writer_tests6/tdf125104.py b/sw/qa/uitest/writer_tests6/tdf125104.py index b711b01caefe..0fa36587b20e 100644 --- a/sw/qa/uitest/writer_tests6/tdf125104.py +++ b/sw/qa/uitest/writer_tests6/tdf125104.py @@ -6,6 +6,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import select_pos, get_state_as_dict +from uitest.uihelper.common import select_by_text from libreoffice.uno.propertyvalue import mkPropertyValues class tdf125104(UITestCase): @@ -19,9 +20,7 @@ class tdf125104(UITestCase): def set_combo_layout_format(self, dialog, format): comboLayoutFormat = dialog.getChild("comboLayoutFormat") - props = {"TEXT": format} - actionProps = mkPropertyValues(props) - comboLayoutFormat.executeAction("SELECT", actionProps) + select_by_text(comboLayoutFormat, format) okBtn = dialog.getChild("ok") self.ui_test.close_dialog_through_button(okBtn) diff --git a/sw/qa/uitest/writer_tests7/forms.py b/sw/qa/uitest/writer_tests7/forms.py index d241fc38a876..179e8288cc2d 100644 --- a/sw/qa/uitest/writer_tests7/forms.py +++ b/sw/qa/uitest/writer_tests7/forms.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file from uitest.uihelper.common import change_measurement_unit +from uitest.uihelper.common import select_by_text from libreoffice.uno.propertyvalue import mkPropertyValues class Forms(UITestCase): @@ -55,7 +56,7 @@ class Forms(UITestCase): self.assertEqual("None", get_state_as_dict(xAction)['SelectEntryText']) self.assertEqual("false", get_state_as_dict(xURL)['Enabled']) - xAction.executeAction("SELECT", mkPropertyValues({"TEXT": "Open document/web page"})) + select_by_text(xAction, "Open document/web page") self.assertEqual("Open document/web page", get_state_as_dict(xAction)['SelectEntryText']) self.assertEqual("true", get_state_as_dict(xURL)['Enabled']) diff --git a/uitest/uitest/uihelper/common.py b/uitest/uitest/uihelper/common.py index cb9a761cb7f9..0ce04dbe780a 100644 --- a/uitest/uitest/uihelper/common.py +++ b/uitest/uitest/uihelper/common.py @@ -18,6 +18,9 @@ def type_text(ui_object, text): def select_pos(ui_object, pos): ui_object.executeAction("SELECT", mkPropertyValues({"POS": pos})) +def select_by_text(ui_object, text): + ui_object.executeAction("SELECT", mkPropertyValues({"TEXT": text})) + def select_text(ui_object, from_pos, to): ui_object.executeAction("SELECT", mkPropertyValues({"FROM": from_pos, "TO": to})) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits