sw/qa/uitest/writer_tests3/autoredactDialog.py |    4 ++--
 sw/qa/uitest/writer_tests6/tdf128431.py        |    2 +-
 sw/qa/uitest/writer_tests6/tdf131041.py        |    2 +-
 uitest/uitest/uihelper/common.py               |    1 +
 4 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 87b74da15d2de7c6a8569ede8f2fc6abec7dbcb4
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Nov 9 16:19:57 2021 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Nov 9 19:10:10 2021 +0100

    uitest: pos must be of type str
    
    Change-Id: Iea469066b11abefd889143d11f86c4cdcb5e03ab
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124923
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/uitest/writer_tests3/autoredactDialog.py 
b/sw/qa/uitest/writer_tests3/autoredactDialog.py
index 328b228b60bc..9f298bd31937 100644
--- a/sw/qa/uitest/writer_tests3/autoredactDialog.py
+++ b/sw/qa/uitest/writer_tests3/autoredactDialog.py
@@ -60,7 +60,7 @@ class AutoRedactDialog(UITestCase):
                         xNewContentTxt=dialog.getChild("content")
                         xTypeList = dialog.getChild("type") #0: Text, 1: 
Regex, 2: Predefined
 
-                        select_pos(xTypeList, 0) #Text
+                        select_pos(xTypeList, "0") #Text
                         
self.assertEqual(int(get_state_as_dict(xTypeList)["SelectEntryPos"]), 0)
 
                         type_text(xNewNameTxt, 
targets_list[self.add_target_counter][0])
@@ -108,7 +108,7 @@ class AutoRedactDialog(UITestCase):
                     xNewContentTxt=dialog.getChild("content")
                     xTypeList = dialog.getChild("type") #0: Text, 1: Regex, 2: 
Predefined
 
-                    select_pos(xTypeList, 0) #Text
+                    select_pos(xTypeList, "0") #Text
                     
self.assertEqual(int(get_state_as_dict(xTypeList)["SelectEntryPos"]), 0)
 
                     type_text(xNewNameTxt, "TestTarget")
diff --git a/sw/qa/uitest/writer_tests6/tdf128431.py 
b/sw/qa/uitest/writer_tests6/tdf128431.py
index af8003ea0e5d..60a4e4dfb381 100644
--- a/sw/qa/uitest/writer_tests6/tdf128431.py
+++ b/sw/qa/uitest/writer_tests6/tdf128431.py
@@ -18,7 +18,7 @@ class tdf128431(UITestCase):
 
             with 
self.ui_test.execute_dialog_through_command(".uno:PageDialog") as xDialog:
                 tabcontrol = xDialog.getChild("tabcontrol")
-                select_pos(tabcontrol, 6) #borders
+                select_pos(tabcontrol, "6") #borders
 
                 sync = xDialog.getChild("sync")
                 bottomft = xDialog.getChild("bottommf")
diff --git a/sw/qa/uitest/writer_tests6/tdf131041.py 
b/sw/qa/uitest/writer_tests6/tdf131041.py
index 56a13b81efad..474e525ede42 100644
--- a/sw/qa/uitest/writer_tests6/tdf131041.py
+++ b/sw/qa/uitest/writer_tests6/tdf131041.py
@@ -14,7 +14,7 @@ class tdf131041(UITestCase):
 
             with 
self.ui_test.execute_dialog_through_command(".uno:PageDialog") as xDialog:
                 tabcontrol = xDialog.getChild("tabcontrol")
-                select_pos(tabcontrol, 4) #header
+                select_pos(tabcontrol, "4") #header
 
                 xHeaderOn = xDialog.getChild("checkHeaderOn")
                 xMoreBtn = xDialog.getChild("buttonMore")
diff --git a/uitest/uitest/uihelper/common.py b/uitest/uitest/uihelper/common.py
index f6146c5e7729..2c0cd67a2152 100644
--- a/uitest/uitest/uihelper/common.py
+++ b/uitest/uitest/uihelper/common.py
@@ -16,6 +16,7 @@ def type_text(ui_object, text):
     ui_object.executeAction("TYPE", mkPropertyValues({"TEXT": text}))
 
 def select_pos(ui_object, pos):
+    assert isinstance(pos, str), "select_pos: POS must be of type str"
     ui_object.executeAction("SELECT", mkPropertyValues({"POS": pos}))
 
 def select_by_text(ui_object, text):

Reply via email to