sc/qa/uitest/search_replace/tdf143759.py |    6 ++++--
 sc/qa/uitest/search_replace/tdf44398.py  |   14 +++++++++++---
 sc/qa/uitest/search_replace/tdf44861.py  |    8 ++++++--
 sc/qa/uitest/search_replace/tdf57523.py  |    7 +++++--
 4 files changed, 26 insertions(+), 9 deletions(-)

New commits:
commit 2e928ff9e66adc556fe998116be46710270aad48
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Fri Apr 1 14:35:52 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Apr 1 15:52:01 2022 +0200

    uitest: sc: Deselect regexp checkbox after using it
    
    Otherwise, this is saved and it might affect other tests
    
    Change-Id: I866472d79ee98cb301c1fc61aa97720849d5d116
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132426
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/qa/uitest/search_replace/tdf143759.py 
b/sc/qa/uitest/search_replace/tdf143759.py
index 31ab75fe8f46..e43442b8ec9f 100644
--- a/sc/qa/uitest/search_replace/tdf143759.py
+++ b/sc/qa/uitest/search_replace/tdf143759.py
@@ -31,8 +31,7 @@ class tdf143759(UITestCase):
                 xSearchterm.executeAction("TYPE", 
mkPropertyValues({"TEXT":"^$"}))
 
                 xRegexp = xDialog.getChild("regexp")
-                if get_state_as_dict(xRegexp)['Selected'] == 'false':
-                    xRegexp.executeAction("CLICK", tuple())
+                xRegexp.executeAction("CLICK", tuple())
                 self.assertEqual("true", 
get_state_as_dict(xRegexp)['Selected'])
 
                 xSelection = xDialog.getChild("selection")
@@ -47,5 +46,8 @@ class tdf143759(UITestCase):
                     # AssertionError: 13 != 0
                     self.assertEqual(13, 
len(dialog.getChild("results").getChildren()))
 
+                # Deselect regex button, otherwise it might affect other tests
+                xRegexp.executeAction("CLICK", tuple())
+                self.assertEqual("false", 
get_state_as_dict(xRegexp)['Selected'])
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/search_replace/tdf44398.py 
b/sc/qa/uitest/search_replace/tdf44398.py
index 1d0cc34083cc..8cc404bc35ce 100644
--- a/sc/qa/uitest/search_replace/tdf44398.py
+++ b/sc/qa/uitest/search_replace/tdf44398.py
@@ -38,10 +38,15 @@ class tdf44398(UITestCase):
                 replaceterm = xDialog.getChild("replaceterm")
                 replaceterm.executeAction("TYPE", 
mkPropertyValues({"TEXT":"$1"})) #replace textbox
                 regexp = xDialog.getChild("regexp")
-                regexp.executeAction("CLICK", tuple())   #regular expressions
+                regexp.executeAction("CLICK", tuple())
+                self.assertEqual("true", get_state_as_dict(regexp)['Selected'])
                 replaceall = xDialog.getChild("replaceall")
                 replaceall.executeAction("CLICK", tuple())
 
+                # Deselect regex button, otherwise it might affect other tests
+                regexp.executeAction("CLICK", tuple())
+                self.assertEqual("false", 
get_state_as_dict(regexp)['Selected'])
+
             #verify 3. A1 => 123456
             self.assertEqual(get_cell_by_position(document, 0, 0, 
0).getString(), "123456")
 
@@ -69,14 +74,17 @@ class tdf44398(UITestCase):
                 replaceterm = xDialog.getChild("replaceterm")
                 replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":" 
$1"})) #replace textbox
                 regexp = xDialog.getChild("regexp")
-                if (get_state_as_dict(regexp)["Selected"]) == "false":
-                    regexp.executeAction("CLICK", tuple())   #regular 
expressions
+                regexp.executeAction("CLICK", tuple())
+                self.assertEqual("true", get_state_as_dict(regexp)['Selected'])
                 matchcase = xDialog.getChild("matchcase")
                 matchcase.executeAction("CLICK", tuple())   #case
 
                 replaceall = xDialog.getChild("replaceall")
                 replaceall.executeAction("CLICK", tuple())
 
+                # Deselect regex button, otherwise it might affect other tests
+                regexp.executeAction("CLICK", tuple())
+                self.assertEqual("false", 
get_state_as_dict(regexp)['Selected'])
 
             #verify A1 => ' Var Number A'
             self.assertEqual(get_cell_by_position(document, 0, 0, 
0).getString(), " Var Number A")
diff --git a/sc/qa/uitest/search_replace/tdf44861.py 
b/sc/qa/uitest/search_replace/tdf44861.py
index 1d50b9abdbc5..9b04a3b9f0fa 100644
--- a/sc/qa/uitest/search_replace/tdf44861.py
+++ b/sc/qa/uitest/search_replace/tdf44861.py
@@ -34,11 +34,15 @@ class tdf44861(UITestCase):
                 replaceterm = xDialog.getChild("replaceterm")
                 replaceterm.executeAction("TYPE", 
mkPropertyValues({"TEXT":"$1.$2"})) #replace textbox
                 regexp = xDialog.getChild("regexp")
-                if (get_state_as_dict(regexp)["Selected"]) == "false":
-                    regexp.executeAction("CLICK", tuple())   #regular 
expressions
+                regexp.executeAction("CLICK", tuple())
+                self.assertEqual("true", get_state_as_dict(regexp)['Selected'])
                 replaceall = xDialog.getChild("replaceall")
                 replaceall.executeAction("CLICK", tuple())
 
+                # Deselect regex button, otherwise it might affect other tests
+                regexp.executeAction("CLICK", tuple())
+                self.assertEqual("false", 
get_state_as_dict(regexp)['Selected'])
+
             #Expected: instead of 1345-1430 appears 13.45-14.30
             self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
0).getString(), "13.45-14.30")
             self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
1).getString(), "13.45-14.30")
diff --git a/sc/qa/uitest/search_replace/tdf57523.py 
b/sc/qa/uitest/search_replace/tdf57523.py
index 62dc5c6d6aa7..92e0cb601f74 100644
--- a/sc/qa/uitest/search_replace/tdf57523.py
+++ b/sc/qa/uitest/search_replace/tdf57523.py
@@ -34,13 +34,16 @@ class tdf57523(UITestCase):
                 replaceterm.executeAction("TYPE", 
mkPropertyValues({"TEXT":"BBB"}))
                 regexp = xDialog.getChild("regexp")
 
-                if get_state_as_dict(regexp)['Selected'] == 'false':
-                    regexp.executeAction("CLICK", tuple())
+                regexp.executeAction("CLICK", tuple())
                 self.assertEqual("true", get_state_as_dict(regexp)['Selected'])
 
                 replaceall = xDialog.getChild("replaceall")
                 replaceall.executeAction("CLICK", tuple())
 
+                # Deselect regex button, otherwise it might affect other tests
+                regexp.executeAction("CLICK", tuple())
+                self.assertEqual("false", 
get_state_as_dict(regexp)['Selected'])
+
 
             # Without the fix in place, this test would have failed with
             # AssertionError: '' != 'BBB'

Reply via email to