summaryrefslogtreecommitdiff
path: root/uitest/demo_ui
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-12-22 03:58:26 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-12-24 17:12:38 +0000
commit85a1dda8ef9d5970adf881dca2bf9d1a652f7245 (patch)
treeb322ef90f81127f1c96e06dc76459778ed1ba99f /uitest/demo_ui
parent57e785e1cf52e422ac60cb259a2f53b696d3c4cc (diff)
uitest: write a helper method for selecting based on position
Change-Id: Ia7c4450f83a5a7cebd9d518c9ccac1ce07045570 Reviewed-on: https://gerrit.libreoffice.org/32407 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'uitest/demo_ui')
-rw-r--r--uitest/demo_ui/combobox.py5
-rw-r--r--uitest/demo_ui/listbox.py5
-rw-r--r--uitest/demo_ui/spinfield.py6
-rw-r--r--uitest/demo_ui/tabcontrol.py3
-rw-r--r--uitest/demo_ui/tabdialog.py5
-rw-r--r--uitest/demo_ui/treelist.py4
6 files changed, 13 insertions, 15 deletions
diff --git a/uitest/demo_ui/combobox.py b/uitest/demo_ui/combobox.py
index 9b677a4a680b..32e64027e55a 100644
--- a/uitest/demo_ui/combobox.py
+++ b/uitest/demo_ui/combobox.py
@@ -8,6 +8,7 @@
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.framework import UITestCase
+from uitest.uihelper.common import select_pos
class ComboBoxTest(UITestCase):
@@ -19,9 +20,7 @@ class ComboBoxTest(UITestCase):
xAddNameDlg = self.xUITest.getTopFocusWindow()
scopeCB = xAddNameDlg.getChild("scope")
- props = {"POS": "1"}
- actionProps = mkPropertyValues(props)
- scopeCB.executeAction("SELECT", actionProps)
+ select_pos(scopeCB, "1")
xCancelBtn = xAddNameDlg.getChild("cancel")
xCancelBtn.executeAction("CLICK", tuple())
diff --git a/uitest/demo_ui/listbox.py b/uitest/demo_ui/listbox.py
index 5c56c1014a23..15bd8ab133d9 100644
--- a/uitest/demo_ui/listbox.py
+++ b/uitest/demo_ui/listbox.py
@@ -8,6 +8,7 @@
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.framework import UITestCase
+from uitest.uihelper.common import select_pos
class ListBoxTest(UITestCase):
@@ -19,9 +20,7 @@ class ListBoxTest(UITestCase):
xCellsDlg = self.xUITest.getTopFocusWindow()
categoryLB = xCellsDlg.getChild("categorylb")
- props = {"POS": "4"}
- actionProps = mkPropertyValues(props)
- categoryLB.executeAction("SELECT", actionProps)
+ select_pos(categoryLB, "4")
xOkBtn = xCellsDlg.getChild("ok")
xOkBtn.executeAction("CLICK", tuple())
diff --git a/uitest/demo_ui/spinfield.py b/uitest/demo_ui/spinfield.py
index c093cf5d4d7c..a36189afeb16 100644
--- a/uitest/demo_ui/spinfield.py
+++ b/uitest/demo_ui/spinfield.py
@@ -8,7 +8,7 @@
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import get_state_as_dict, type_text, select_pos
class SpinFieldTest(UITestCase):
@@ -20,7 +20,7 @@ class SpinFieldTest(UITestCase):
xCellsDlg = self.xUITest.getTopFocusWindow()
# select the numbers tab page
- xCellsDlg.executeAction("SELECT", mkPropertyValues({"POS": "0"}))
+ select_pos(xCellsDlg, "0")
xDecimalPlaces = xCellsDlg.getChild("leadzerosed")
xDecimalPlaces.executeAction("UP", tuple())
@@ -41,7 +41,7 @@ class SpinFieldTest(UITestCase):
xCellsDlg = self.xUITest.getTopFocusWindow()
# select the numbers tab page
- xCellsDlg.executeAction("SELECT", mkPropertyValues({"POS": "0"}))
+ select_pos(xCellsDlg, "0")
xDecimalPlaces = xCellsDlg.getChild("leadzerosed")
xDecimalPlaces.executeAction("UP", tuple())
diff --git a/uitest/demo_ui/tabcontrol.py b/uitest/demo_ui/tabcontrol.py
index 79a2948cb458..2dbe3ef842bf 100644
--- a/uitest/demo_ui/tabcontrol.py
+++ b/uitest/demo_ui/tabcontrol.py
@@ -8,6 +8,7 @@
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.calc import enter_text_to_cell
+from uitest.uihelper.common import select_pos
from uitest.framework import UITestCase
@@ -27,7 +28,7 @@ class TabControlTest(UITestCase):
xFunctionDlg = self.xUITest.getTopFocusWindow()
xTabs = xFunctionDlg.getChild("tabs")
- xTabs.executeAction("SELECT", mkPropertyValues({"POS":"1"}))
+ select_pos(xTabs, "1")
xCancelBtn = xFunctionDlg.getChild("cancel")
xCancelBtn.executeAction("CLICK", tuple())
diff --git a/uitest/demo_ui/tabdialog.py b/uitest/demo_ui/tabdialog.py
index 217ee8ea1618..f9251178d259 100644
--- a/uitest/demo_ui/tabdialog.py
+++ b/uitest/demo_ui/tabdialog.py
@@ -8,6 +8,7 @@
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.framework import UITestCase
+from uitest.uihelper.common import select_pos
class TabDialogTest(UITestCase):
@@ -18,9 +19,7 @@ class TabDialogTest(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
xCellsDlg = self.xUITest.getTopFocusWindow()
- props = {"POS": "1"}
- propsUNO = mkPropertyValues(props)
- xCellsDlg.executeAction("SELECT", propsUNO)
+ select_pos(xCellsDlg, "1")
xOkBtn = xCellsDlg.getChild("ok")
xOkBtn.executeAction("CLICK", tuple())
diff --git a/uitest/demo_ui/treelist.py b/uitest/demo_ui/treelist.py
index 91c18ea7d299..cbda8e2c1532 100644
--- a/uitest/demo_ui/treelist.py
+++ b/uitest/demo_ui/treelist.py
@@ -8,7 +8,7 @@
from libreoffice.uno.propertyvalue import mkPropertyValues
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_pos
from uitest.framework import UITestCase
@@ -28,7 +28,7 @@ class TreeListTest(UITestCase):
xFunctionDlg = self.xUITest.getTopFocusWindow()
xTabs = xFunctionDlg.getChild("tabs")
- xTabs.executeAction("SELECT", mkPropertyValues({"POS":"1"}))
+ select_pos(xTabs, "1")
xTreelist = xTabs.getChild("struct")