summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-04-01 16:15:56 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-04-01 20:34:14 +0200
commit8ed2457a089ae78b54f82c1fae07d54777dda3ca (patch)
tree10defad72ed770232a32faf10a64b9577f9a8595 /sw
parent43216ed5ddb6d8dc38d505cb63ca9b894be5f2c0 (diff)
uitest: sw: Deselect regexp checkbox after using it
Otherwise, this is saved and it might affects other tests Change-Id: I326fd16ee87f49154acf952fe4d36616581a1cee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132432 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/uitest/findReplace/findReplace.py8
-rw-r--r--sw/qa/uitest/findReplace/findSimilarity.py5
-rw-r--r--sw/qa/uitest/findReplace/tdf137737.py8
-rw-r--r--sw/qa/uitest/findReplace/tdf144089.py8
-rw-r--r--sw/qa/uitest/macro_tests/tdf64690.py7
5 files changed, 23 insertions, 13 deletions
diff --git a/sw/qa/uitest/findReplace/findReplace.py b/sw/qa/uitest/findReplace/findReplace.py
index 1f6f607ec5b4..3321ebd108c8 100644
--- a/sw/qa/uitest/findReplace/findReplace.py
+++ b/sw/qa/uitest/findReplace/findReplace.py
@@ -107,13 +107,17 @@ class findReplace(UITestCase):
xSimilarity.executeAction("CLICK", tuple())
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())
#verify
self.assertEqual(document.Text.String[0:27], "replacedest number1 testnot")
+ # Deselect regex button, otherwise it might affect other tests
+ regexp.executeAction("CLICK", tuple())
+ self.assertEqual("false", get_state_as_dict(regexp)['Selected'])
+
#tdf116242 ţ ț
def test_tdf116242_replace_t_with_cedilla(self):
with self.ui_test.load_file(get_url_for_data_file("tdf116242.odt")) as writer_doc:
diff --git a/sw/qa/uitest/findReplace/findSimilarity.py b/sw/qa/uitest/findReplace/findSimilarity.py
index 741feb8b50b8..7c532cc20c16 100644
--- a/sw/qa/uitest/findReplace/findSimilarity.py
+++ b/sw/qa/uitest/findReplace/findSimilarity.py
@@ -26,11 +26,6 @@ class findSimilarities(UITestCase):
searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"seco"})) #seco
# check similarities, button similarities, set values = 1; close dialog with OK
- # Deselect regex before selecting similarity
- xRegexp = xDialog.getChild("regexp")
- if get_state_as_dict(xRegexp)['Selected'] == 'true':
- xRegexp.executeAction("CLICK", tuple())
-
similarity = xDialog.getChild("similarity")
if get_state_as_dict(similarity)['Selected'] == 'false':
similarity.executeAction("CLICK", tuple())
diff --git a/sw/qa/uitest/findReplace/tdf137737.py b/sw/qa/uitest/findReplace/tdf137737.py
index 64a155834c85..b2abf3f95acb 100644
--- a/sw/qa/uitest/findReplace/tdf137737.py
+++ b/sw/qa/uitest/findReplace/tdf137737.py
@@ -35,12 +35,16 @@ class tdf137737(UITestCase):
xSimilarity.executeAction("CLICK", tuple())
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'])
replaceall = xDialog.getChild("replaceall")
replaceall.executeAction("CLICK", tuple())
+ # Deselect regex button, otherwise it might affect other tests
+ xRegexp.executeAction("CLICK", tuple())
+ self.assertEqual("false", get_state_as_dict(xRegexp)['Selected'])
+
# Without the fix in place, this test would have failed with
# AssertionError: 0 != 1
self.assertEqual(0, writer_doc.Endnotes.Count)
diff --git a/sw/qa/uitest/findReplace/tdf144089.py b/sw/qa/uitest/findReplace/tdf144089.py
index bd2c89403a96..ae26ffd24a34 100644
--- a/sw/qa/uitest/findReplace/tdf144089.py
+++ b/sw/qa/uitest/findReplace/tdf144089.py
@@ -41,12 +41,16 @@ class tdf144089(UITestCase):
xSimilarity.executeAction("CLICK", tuple())
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'])
replaceall = xDialog.getChild("replaceall")
replaceall.executeAction("CLICK", tuple())
+ # Deselect regex button, otherwise it might affect other tests
+ xRegexp.executeAction("CLICK", tuple())
+ self.assertEqual("false", get_state_as_dict(xRegexp)['Selected'])
+
# Without the fix in place, this test would have failed with
# AssertionError: 'This is a test' != 'This is a AAAA'
self.assertEqual("This is a test", document.Text.String)
diff --git a/sw/qa/uitest/macro_tests/tdf64690.py b/sw/qa/uitest/macro_tests/tdf64690.py
index 27ca45767c1f..5e691117bb3d 100644
--- a/sw/qa/uitest/macro_tests/tdf64690.py
+++ b/sw/qa/uitest/macro_tests/tdf64690.py
@@ -47,8 +47,7 @@ class tdf64690(UITestCase):
replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"ABC"}))
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'])
selection = xDialog.getChild("selection")
@@ -62,6 +61,10 @@ class tdf64690(UITestCase):
with self.ui_test.execute_blocking_action(replaceall.executeAction, args=('CLICK', ())):
pass
+ # Deselect regex button, otherwise it might affect other tests
+ regexp.executeAction("CLICK", tuple())
+ self.assertEqual("false", get_state_as_dict(regexp)['Selected'])
+
self.assertEqual("ABCABCABCABC\nABCABCABCABC\n", get_state_as_dict(xEditWin)['Text'])