summaryrefslogtreecommitdiff
path: root/sw/qa/uitest/writer_tests7
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-06-23 16:16:58 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-06-27 21:45:32 +0200
commiteef1a5f3aa0f1b11024aa6760cf92181b9bf0a96 (patch)
treed4e46ce25ba5214a6e5820712c84e55035e8874e /sw/qa/uitest/writer_tests7
parent241c37a6ad2a444ddf2eb48385041318d4e7e8ee (diff)
uitest: remove duplicated calls to get_component()
after 8298aa62726312eee6f8fbb64a9fc9b12680447f < uitest: guard execute_blocking_action > Change-Id: I954c11c42620660afd48a585f5c59ff2196f4b6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117738 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/uitest/writer_tests7')
-rw-r--r--sw/qa/uitest/writer_tests7/forms.py3
-rw-r--r--sw/qa/uitest/writer_tests7/tdf132169.py3
-rw-r--r--sw/qa/uitest/writer_tests7/tdf137802.py3
-rw-r--r--sw/qa/uitest/writer_tests7/tdf137803.py3
-rw-r--r--sw/qa/uitest/writer_tests7/tdf140117.py3
-rw-r--r--sw/qa/uitest/writer_tests7/tdf90401.py6
6 files changed, 7 insertions, 14 deletions
diff --git a/sw/qa/uitest/writer_tests7/forms.py b/sw/qa/uitest/writer_tests7/forms.py
index d58d9a15ae91..8bf828f2e704 100644
--- a/sw/qa/uitest/writer_tests7/forms.py
+++ b/sw/qa/uitest/writer_tests7/forms.py
@@ -125,13 +125,12 @@ class Forms(UITestCase):
def test_tdf139486(self):
# Reuse file from another test
- with self.ui_test.load_file(get_url_for_data_file("tdf140198.odt")):
+ with self.ui_test.load_file(get_url_for_data_file("tdf140198.odt")) as document:
change_measurement_unit(self, "Centimeter")
self.xUITest.executeCommand(".uno:JumpToNextFrame")
- document = self.ui_test.get_component()
drawPage = document.getDrawPages().getByIndex(0)
shape = drawPage.getByIndex(0)
self.assertEqual(13996, shape.getSize().Width)
diff --git a/sw/qa/uitest/writer_tests7/tdf132169.py b/sw/qa/uitest/writer_tests7/tdf132169.py
index ef1ec666c029..e535ebbc3326 100644
--- a/sw/qa/uitest/writer_tests7/tdf132169.py
+++ b/sw/qa/uitest/writer_tests7/tdf132169.py
@@ -35,8 +35,7 @@ class tdf132169(UITestCase):
xLineMetric.executeAction("UP", tuple())
- document = self.ui_test.get_component()
- drawPage = document.getDrawPages().getByIndex(0)
+ drawPage = writer_doc.getDrawPages().getByIndex(0)
shape = drawPage.getByIndex(0)
#Without the fix in place, it would have been 310
diff --git a/sw/qa/uitest/writer_tests7/tdf137802.py b/sw/qa/uitest/writer_tests7/tdf137802.py
index 99c6085f29dd..df7deea94522 100644
--- a/sw/qa/uitest/writer_tests7/tdf137802.py
+++ b/sw/qa/uitest/writer_tests7/tdf137802.py
@@ -13,11 +13,10 @@ class tdf137802(UITestCase):
def test_tdf137802(self):
- with self.ui_test.load_file(get_url_for_data_file("tdf137802.odt")):
+ with self.ui_test.load_file(get_url_for_data_file("tdf137802.odt")) as document:
xWriterDoc = self.xUITest.getTopFocusWindow()
xWriterEdit = xWriterDoc.getChild("writer_edit")
- document = self.ui_test.get_component()
self.assertEqual(document.DrawPage.getCount(), 2)
self.assertEqual(AT_PARAGRAPH, document.DrawPage.getByIndex(0).AnchorType)
diff --git a/sw/qa/uitest/writer_tests7/tdf137803.py b/sw/qa/uitest/writer_tests7/tdf137803.py
index 3549cc9d0b77..3116dd609dd9 100644
--- a/sw/qa/uitest/writer_tests7/tdf137803.py
+++ b/sw/qa/uitest/writer_tests7/tdf137803.py
@@ -11,8 +11,7 @@ from uitest.uihelper.common import get_url_for_data_file
class tdf137803(UITestCase):
def test_tdf137803(self):
# load the sample file
- with self.ui_test.load_file(get_url_for_data_file("tdf137803.odt")):
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf137803.odt")) as document:
# select the shape
self.xUITest.executeCommand(".uno:JumpToNextFrame")
diff --git a/sw/qa/uitest/writer_tests7/tdf140117.py b/sw/qa/uitest/writer_tests7/tdf140117.py
index a1790e642a64..e0d79893f188 100644
--- a/sw/qa/uitest/writer_tests7/tdf140117.py
+++ b/sw/qa/uitest/writer_tests7/tdf140117.py
@@ -13,10 +13,9 @@ from uitest.uihelper.common import get_url_for_data_file
class tdf140117(UITestCase):
def test_tdf140117(self):
# load the sample file
- with self.ui_test.load_file(get_url_for_data_file("tdf140117.fodt")):
+ with self.ui_test.load_file(get_url_for_data_file("tdf140117.fodt")) as document:
xWriterDoc = self.xUITest.getTopFocusWindow()
xWriterEdit = xWriterDoc.getChild("writer_edit")
- document = self.ui_test.get_component()
for i in range(3):
xWriterEdit.executeAction("GOTO", mkPropertyValues({"PAGE": "2"}))
diff --git a/sw/qa/uitest/writer_tests7/tdf90401.py b/sw/qa/uitest/writer_tests7/tdf90401.py
index cb70c401b142..b6d100cb6241 100644
--- a/sw/qa/uitest/writer_tests7/tdf90401.py
+++ b/sw/qa/uitest/writer_tests7/tdf90401.py
@@ -25,7 +25,6 @@ class tdf90401(UITestCase):
xWriterDoc = self.xUITest.getTopFocusWindow()
xWriterEdit = xWriterDoc.getChild('writer_edit')
- document = self.ui_test.get_component()
selection = self.xUITest.executeCommand('.uno:SelectAll')
self.xUITest.executeCommand('.uno:InsertAnnotation')
@@ -72,12 +71,11 @@ class tdf90401(UITestCase):
# Close the Writer document
self.ui_test.close_doc()
- with self.ui_test.load_file(systemPathToFileUrl(xFilePath)):
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as writer_doc2:
# check removed personal info on comments
- textfields = document.getTextFields()
+ textfields = writer_doc2.getTextFields()
author = ""
year = -1
for textfield in textfields: