summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-12-15 11:50:47 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-12-15 13:26:36 +0100
commit5fc6d68e9e125b00dc16600543e516bd15fb3a64 (patch)
tree9c08df351b173ec0a295c5f3f26da93a29d06f11 /sc
parent30e474a7e5bba6cebb7b082abd7ae8dc8d8bf8b0 (diff)
uitest: simplify code
Change-Id: Id3355be0e763217a4915b53d22220c30536415e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126852 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/uitest/autofilter/colorfilter.py6
-rw-r--r--sc/qa/uitest/calc_tests/CellDropDownItems.py3
-rw-r--r--sc/qa/uitest/conditional_format/tdf105466.py3
-rw-r--r--sc/qa/uitest/csv_dialog/tdf92503.py4
-rw-r--r--sc/qa/uitest/manual_tests/calc.py8
-rw-r--r--sc/qa/uitest/textToColumns/tdf143008.py4
6 files changed, 14 insertions, 14 deletions
diff --git a/sc/qa/uitest/autofilter/colorfilter.py b/sc/qa/uitest/autofilter/colorfilter.py
index 176c627f3339..58f39227ee3d 100644
--- a/sc/qa/uitest/autofilter/colorfilter.py
+++ b/sc/qa/uitest/autofilter/colorfilter.py
@@ -8,7 +8,7 @@
#
from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, select_pos
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, select_pos, select_by_text
from libreoffice.uno.propertyvalue import mkPropertyValues
from libreoffice.calc.document import is_row_hidden
@@ -117,9 +117,7 @@ class ColorFilterTest(UITestCase):
self.assertEqual("Another", get_state_as_dict(xField1)['DisplayText'])
- props = {"TEXT": "Background color"}
- actionProps = mkPropertyValues(props)
- xCond1.executeAction("SELECT", actionProps)
+ select_by_text(xCond1, "Background color")
self.assertEqual("Background color", get_state_as_dict(xCond1)['DisplayText'])
xColor1 = xDialog.getChild("color1")
diff --git a/sc/qa/uitest/calc_tests/CellDropDownItems.py b/sc/qa/uitest/calc_tests/CellDropDownItems.py
index 3f16e0376470..86fceeca2f9a 100644
--- a/sc/qa/uitest/calc_tests/CellDropDownItems.py
+++ b/sc/qa/uitest/calc_tests/CellDropDownItems.py
@@ -9,6 +9,7 @@
from uitest.framework import UITestCase
from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import select_pos
class CellDropDownItems(UITestCase):
@@ -27,7 +28,7 @@ class CellDropDownItems(UITestCase):
#Select List option
xallow = xDialog.getChild("allow")
- xallow.executeAction("SELECT", mkPropertyValues({"POS": "6"}))
+ select_pos(xallow, "6")
#Add items to the List
xminlist = xDialog.getChild("minlist")
diff --git a/sc/qa/uitest/conditional_format/tdf105466.py b/sc/qa/uitest/conditional_format/tdf105466.py
index 27e7c1f40359..ead8a19313bb 100644
--- a/sc/qa/uitest/conditional_format/tdf105466.py
+++ b/sc/qa/uitest/conditional_format/tdf105466.py
@@ -9,6 +9,7 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import select_pos
import unittest
@@ -24,6 +25,6 @@ class tdf105466(UITestCase):
for i in range(0,4):
with self.subTest(i = i):
xTypeLstBox = xCondFormatDlg.getChild("type")
- xTypeLstBox.executeAction("SELECT", mkPropertyValues({"POS": str(i)}))
+ select_pos(xTypeLstBox, str(i))
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/csv_dialog/tdf92503.py b/sc/qa/uitest/csv_dialog/tdf92503.py
index 679c76586130..9774b03c35e3 100644
--- a/sc/qa/uitest/csv_dialog/tdf92503.py
+++ b/sc/qa/uitest/csv_dialog/tdf92503.py
@@ -7,7 +7,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, select_by_text
from libreoffice.uno.propertyvalue import mkPropertyValues
from libreoffice.calc.document import get_cell_by_position
from libreoffice.calc.csv_dialog import load_csv_file
@@ -28,7 +28,7 @@ class Tdf92503(UITestCase):
self.assertEqual('true', get_state_as_dict(xColumnType)['Enabled'])
- xColumnType.executeAction("SELECT", mkPropertyValues({"TEXT": "Date (DMY)"}))
+ select_by_text(xColumnType, "Date (DMY)")
self.assertEqual('Date (DMY)', get_state_as_dict(xColumnType)['SelectEntryText'])
diff --git a/sc/qa/uitest/manual_tests/calc.py b/sc/qa/uitest/manual_tests/calc.py
index 4d26437c6f1c..374bd6f93820 100644
--- a/sc/qa/uitest/manual_tests/calc.py
+++ b/sc/qa/uitest/manual_tests/calc.py
@@ -10,7 +10,7 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
from libreoffice.calc.document import get_cell_by_position
-from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text, select_pos
from uitest.uihelper.calc import enter_text_to_cell
class ManualCalcTests(UITestCase):
@@ -94,10 +94,10 @@ class ManualCalcTests(UITestCase):
with self.ui_test.execute_dialog_through_command(".uno:Validation") as xValidationDlg:
xAllowList = xValidationDlg.getChild("allow")
- xAllowList.executeAction("SELECT", mkPropertyValues({"POS": "1"}))
+ select_pos(xAllowList, "1")
xData = xValidationDlg.getChild("data")
- xData.executeAction("SELECT", mkPropertyValues({"POS": "5"}))
+ select_pos(xData, "5")
xVal = xValidationDlg.getChild("max")
xVal.executeAction("TYPE", mkPropertyValues({"TEXT":"0"}))
@@ -171,7 +171,7 @@ class ManualCalcTests(UITestCase):
with self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog") as xRandomNumberDlg:
xDistributionLstBox = xRandomNumberDlg.getChild("distribution-combo")
- xDistributionLstBox.executeAction("SELECT", mkPropertyValues({"POS": "1"}))
+ select_pos(xDistributionLstBox, "1")
xMin = xRandomNumberDlg.getChild("parameter1-spin")
xMin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"}))
diff --git a/sc/qa/uitest/textToColumns/tdf143008.py b/sc/qa/uitest/textToColumns/tdf143008.py
index e6e80396ab99..087a7b5a8fd5 100644
--- a/sc/qa/uitest/textToColumns/tdf143008.py
+++ b/sc/qa/uitest/textToColumns/tdf143008.py
@@ -8,7 +8,7 @@
#
from uitest.framework import UITestCase
from uitest.uihelper.calc import enter_text_to_cell
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, select_by_text
from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
@@ -30,7 +30,7 @@ class tdf143008(UITestCase):
self.assertEqual('true', get_state_as_dict(xColumnType)['Enabled'])
- xColumnType.executeAction("SELECT", mkPropertyValues({"TEXT": "Date (DMY)"}))
+ select_by_text(xColumnType, "Date (DMY)")
self.assertEqual('Date (DMY)', get_state_as_dict(xColumnType)['SelectEntryText'])