[Libreoffice-commits] core.git: sd/qa sw/qa uitest/demo_ui

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Thu Jan 14 23:20:22 UTC 2021


 sd/qa/uitest/findReplace/findReplace.py                         |   11 ----------
 sw/qa/uitest/chapterNumbering/tdf123547.py                      |    9 --------
 sw/qa/uitest/classification/classification.py                   |    7 ------
 sw/qa/uitest/findReplace/findReplace.py                         |    9 --------
 sw/qa/uitest/findReplace/tdf118208.py                           |   11 +---------
 sw/qa/uitest/findSimilarity/findSimilarity.py                   |    9 --------
 sw/qa/uitest/navigator/tdf114724.py                             |    7 ------
 sw/qa/uitest/styleInspector/styleInspector.py                   |    7 ------
 sw/qa/uitest/styleInspector/tdf137105.py                        |    7 ------
 sw/qa/uitest/table/sheetToTable.py                              |    8 -------
 sw/qa/uitest/table/splitTable.py                                |    8 -------
 sw/qa/uitest/table/tableProperties.py                           |    8 -------
 sw/qa/uitest/table/tableToText.py                               |    8 -------
 sw/qa/uitest/table/tdf134881_colProportionalAdjust.py           |    6 -----
 sw/qa/uitest/table/tdf135693.py                                 |   11 ++++------
 sw/qa/uitest/table/tdf81292.py                                  |    9 --------
 sw/qa/uitest/table/tdf99334.py                                  |    9 --------
 sw/qa/uitest/table/textToTable.py                               |    8 -------
 sw/qa/uitest/writer_tests/compareDocuments.py                   |    7 ------
 sw/qa/uitest/writer_tests/tdf81457.py                           |    9 --------
 sw/qa/uitest/writer_tests/trackedChanges.py                     |    7 ------
 sw/qa/uitest/writer_tests/versionDialog.py                      |    7 ------
 sw/qa/uitest/writer_tests/wordCount.py                          |    7 ------
 sw/qa/uitest/writer_tests2/tdf116474.py                         |    7 ------
 sw/qa/uitest/writer_tests3/goToPage.py                          |    7 ------
 sw/qa/uitest/writer_tests4/spellDialog.py                       |    8 -------
 sw/qa/uitest/writer_tests4/tdf108124.py                         |    9 --------
 sw/qa/uitest/writer_tests4/tdf113284.py                         |    7 ------
 sw/qa/uitest/writer_tests4/tdf122449.py                         |    8 -------
 sw/qa/uitest/writer_tests4/tdf134439.py                         |    7 ------
 sw/qa/uitest/writer_tests4/tdf135636.py                         |    7 ------
 sw/qa/uitest/writer_tests4/tdf136578.py                         |    6 -----
 sw/qa/uitest/writer_tests4/tdf49683.py                          |    7 ------
 sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py     |    8 -------
 sw/qa/uitest/writer_tests5/DropDownFormFieldPropertiesDialog.py |    8 -------
 sw/qa/uitest/writer_tests5/tdf107494.py                         |    7 ------
 sw/qa/uitest/writer_tests5/tdf117039.py                         |    7 ------
 sw/qa/uitest/writer_tests5/tdf118540.py                         |    8 -------
 sw/qa/uitest/writer_tests5/titlePageWizard.py                   |    7 ------
 sw/qa/uitest/writer_tests6/tdf120731.py                         |    8 -------
 sw/qa/uitest/writer_tests6/tdf124586.py                         |    8 -------
 sw/qa/uitest/writer_tests6/tdf124675.py                         |    9 --------
 sw/qa/uitest/writer_tests6/tdf126017.py                         |    9 --------
 sw/qa/uitest/writer_tests6/tdf126627.py                         |    8 -------
 sw/qa/uitest/writer_tests7/tdf131936.py                         |    7 ------
 sw/qa/uitest/writer_tests7/tdf131963.py                         |    7 ------
 sw/qa/uitest/writer_tests7/tdf132169.py                         |    7 ------
 sw/qa/uitest/writer_tests7/tdf132596.py                         |    7 ------
 sw/qa/uitest/writer_tests7/tdf132597.py                         |    7 ------
 sw/qa/uitest/writer_tests7/tdf134243.py                         |    6 -----
 sw/qa/uitest/writer_tests7/tdf137802.py                         |    7 ------
 sw/qa/uitest/writer_tests7/tdf99711.py                          |    7 ------
 uitest/demo_ui/handle_multiple_files.py                         |   11 ----------
 53 files changed, 57 insertions(+), 358 deletions(-)

New commits:
commit fd2dbccefa27f4d24b3d92ba2477202c9963cc9a
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Jan 14 10:02:16 2021 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Jan 15 00:19:42 2021 +0100

    uitest: sw: factor out common code ( part 3 )
    
    Change-Id: I8c65b9729b4a5c91c77c278282b54a9410876ca9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109259
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sd/qa/uitest/findReplace/findReplace.py b/sd/qa/uitest/findReplace/findReplace.py
index e298565fe5ef..2d300e249517 100644
--- a/sd/qa/uitest/findReplace/findReplace.py
+++ b/sd/qa/uitest/findReplace/findReplace.py
@@ -5,20 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
-#Find and replace
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 class findReplace(UITestCase):
     def test_find_impress(self):
diff --git a/sw/qa/uitest/chapterNumbering/tdf123547.py b/sw/qa/uitest/chapterNumbering/tdf123547.py
index 116ac3dfe0b4..5e0698f8bd1e 100644
--- a/sw/qa/uitest/chapterNumbering/tdf123547.py
+++ b/sw/qa/uitest/chapterNumbering/tdf123547.py
@@ -6,16 +6,9 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-import time
-from uitest.debug import sleep
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import select_pos
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 #Bug 123547 - Systematic crash after opening Tools > Chapter Numbering
 
diff --git a/sw/qa/uitest/classification/classification.py b/sw/qa/uitest/classification/classification.py
index e7fde9d70ec7..181c00417397 100644
--- a/sw/qa/uitest/classification/classification.py
+++ b/sw/qa/uitest/classification/classification.py
@@ -10,13 +10,6 @@ from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 #TSCP: add advanced classification dialog https://cgit.freedesktop.org/libreoffice/core/commit/?id=71ee09947d5a71105d64fd225bb3672dfa7ce834
 # This adds an advanced classification dialog, which enables the user
diff --git a/sw/qa/uitest/findReplace/findReplace.py b/sw/qa/uitest/findReplace/findReplace.py
index ed302174d19e..9ce377f38292 100644
--- a/sw/qa/uitest/findReplace/findReplace.py
+++ b/sw/qa/uitest/findReplace/findReplace.py
@@ -5,18 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 class findReplace(UITestCase):
     def test_find_writer(self):
diff --git a/sw/qa/uitest/findReplace/tdf118208.py b/sw/qa/uitest/findReplace/tdf118208.py
index 2d98a7a446da..3e2b4373221f 100644
--- a/sw/qa/uitest/findReplace/tdf118208.py
+++ b/sw/qa/uitest/findReplace/tdf118208.py
@@ -5,18 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 #Find and replace
 #tdf118208/118212 - enabling either CJK or CTL, or both (Tools -> Options -> Language Settings -> Languages: Default Languages for Documents checkboxes)
@@ -66,7 +59,7 @@ class tdf118208(UITestCase):
         self.assertEqual(document.Text.String[0:14], "Aaaaaaaaaaaaaa")
         xcloseBtn = xDialog.getChild("close")
         self.ui_test.close_dialog_through_button(xcloseBtn)
-        sleep(1)
+
         #enable lang support again
         self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")  #optionsdialog
         xDialog = self.xUITest.getTopFocusWindow()
diff --git a/sw/qa/uitest/findSimilarity/findSimilarity.py b/sw/qa/uitest/findSimilarity/findSimilarity.py
index ac5b62fac499..cb62e5528c4f 100644
--- a/sw/qa/uitest/findSimilarity/findSimilarity.py
+++ b/sw/qa/uitest/findSimilarity/findSimilarity.py
@@ -5,18 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 #Find similarities
 
diff --git a/sw/qa/uitest/navigator/tdf114724.py b/sw/qa/uitest/navigator/tdf114724.py
index d7d69b8f2e53..9c538739048f 100644
--- a/sw/qa/uitest/navigator/tdf114724.py
+++ b/sw/qa/uitest/navigator/tdf114724.py
@@ -5,12 +5,7 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 class tdf114724(UITestCase):
 
diff --git a/sw/qa/uitest/styleInspector/styleInspector.py b/sw/qa/uitest/styleInspector/styleInspector.py
index 8469d274ee3c..49337ee61761 100644
--- a/sw/qa/uitest/styleInspector/styleInspector.py
+++ b/sw/qa/uitest/styleInspector/styleInspector.py
@@ -5,13 +5,8 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from libreoffice.uno.propertyvalue import mkPropertyValues
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 class styleNavigator(UITestCase):
 
diff --git a/sw/qa/uitest/styleInspector/tdf137105.py b/sw/qa/uitest/styleInspector/tdf137105.py
index bbe8eaae93f5..b0a6b709d1e8 100644
--- a/sw/qa/uitest/styleInspector/tdf137105.py
+++ b/sw/qa/uitest/styleInspector/tdf137105.py
@@ -4,12 +4,7 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 class tdf137105(UITestCase):
 
diff --git a/sw/qa/uitest/table/sheetToTable.py b/sw/qa/uitest/table/sheetToTable.py
index d14529d4af9e..e47d26a52dc4 100644
--- a/sw/qa/uitest/table/sheetToTable.py
+++ b/sw/qa/uitest/table/sheetToTable.py
@@ -5,16 +5,10 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 from uitest.uihelper.calc import enter_text_to_cell
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 #Calc sheet to Writer table
 
diff --git a/sw/qa/uitest/table/splitTable.py b/sw/qa/uitest/table/splitTable.py
index 589673b2b28e..8994273c4633 100644
--- a/sw/qa/uitest/table/splitTable.py
+++ b/sw/qa/uitest/table/splitTable.py
@@ -5,17 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 #Writer Split Table
 
diff --git a/sw/qa/uitest/table/tableProperties.py b/sw/qa/uitest/table/tableProperties.py
index 962c78384be4..d74260892f01 100644
--- a/sw/qa/uitest/table/tableProperties.py
+++ b/sw/qa/uitest/table/tableProperties.py
@@ -5,18 +5,12 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 from uitest.uihelper.common import change_measurement_unit
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 #Writer Table Properties
 
diff --git a/sw/qa/uitest/table/tableToText.py b/sw/qa/uitest/table/tableToText.py
index f47eeeef2d52..003f46e20548 100644
--- a/sw/qa/uitest/table/tableToText.py
+++ b/sw/qa/uitest/table/tableToText.py
@@ -5,17 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 #Writer Table to text
 
diff --git a/sw/qa/uitest/table/tdf134881_colProportionalAdjust.py b/sw/qa/uitest/table/tdf134881_colProportionalAdjust.py
index cb467c4019fb..c1b4aea8b4eb 100644
--- a/sw/qa/uitest/table/tdf134881_colProportionalAdjust.py
+++ b/sw/qa/uitest/table/tdf134881_colProportionalAdjust.py
@@ -6,13 +6,9 @@
 #
 from uitest.framework import UITestCase
 from uitest.uihelper.common import select_pos
-from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 from uitest.uihelper.common import change_measurement_unit
 from libreoffice.uno.propertyvalue import mkPropertyValues
-import org.libreoffice.unotest
-import pathlib
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 #Writer Table Properties
 
diff --git a/sw/qa/uitest/table/tdf135693.py b/sw/qa/uitest/table/tdf135693.py
index d25f396dc91f..39026fcbfd27 100644
--- a/sw/qa/uitest/table/tdf135693.py
+++ b/sw/qa/uitest/table/tdf135693.py
@@ -1,13 +1,12 @@
 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from uitest.framework import UITestCase
 from uitest.uihelper.common import select_pos
-from uitest.uihelper.common import get_state_as_dict
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 class tdf135693(UITestCase):
 
diff --git a/sw/qa/uitest/table/tdf81292.py b/sw/qa/uitest/table/tdf81292.py
index 019219f4115a..68a79e6733d7 100644
--- a/sw/qa/uitest/table/tdf81292.py
+++ b/sw/qa/uitest/table/tdf81292.py
@@ -6,17 +6,10 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-import time
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 #Bug 81292 - TABLE: Crashes on sorting table
 
-def get_url_for_data_file(file_name):
-   return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
 class tdf81292(UITestCase):
 
    def test_tdf81292_table_sort(self):
diff --git a/sw/qa/uitest/table/tdf99334.py b/sw/qa/uitest/table/tdf99334.py
index de013a1e869e..8c97aff57940 100644
--- a/sw/qa/uitest/table/tdf99334.py
+++ b/sw/qa/uitest/table/tdf99334.py
@@ -6,17 +6,10 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-import time
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 #Bug 99334 - Crashes when sorting table by columns with umlauts
 
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
 class tdf99334(UITestCase):
 
    def test_tdf99334_table_sort_umlauts(self):
diff --git a/sw/qa/uitest/table/textToTable.py b/sw/qa/uitest/table/textToTable.py
index 7d89a42d9051..d41c514d2716 100644
--- a/sw/qa/uitest/table/textToTable.py
+++ b/sw/qa/uitest/table/textToTable.py
@@ -5,17 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 #Writer Text to table
 
diff --git a/sw/qa/uitest/writer_tests/compareDocuments.py b/sw/qa/uitest/writer_tests/compareDocuments.py
index f18accf456c3..6cb90bf99466 100644
--- a/sw/qa/uitest/writer_tests/compareDocuments.py
+++ b/sw/qa/uitest/writer_tests/compareDocuments.py
@@ -8,14 +8,9 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from libreoffice.uno.propertyvalue import mkPropertyValues
 import datetime
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 class compareDocuments(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests/tdf81457.py b/sw/qa/uitest/writer_tests/tdf81457.py
index 436ed9cd7405..655d0c2f671b 100644
--- a/sw/qa/uitest/writer_tests/tdf81457.py
+++ b/sw/qa/uitest/writer_tests/tdf81457.py
@@ -9,16 +9,9 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-import org.libreoffice.unotest
-import pathlib
-import time
-from uitest.debug import sleep
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from uitest.uihelper.common import select_pos
 
-def get_url_for_data_file(file_name):
-   return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
 class tdf81457(UITestCase):
 
 #tdf 81457
diff --git a/sw/qa/uitest/writer_tests/trackedChanges.py b/sw/qa/uitest/writer_tests/trackedChanges.py
index 3fa4dd776cfa..a3ea2671c6c6 100644
--- a/sw/qa/uitest/writer_tests/trackedChanges.py
+++ b/sw/qa/uitest/writer_tests/trackedChanges.py
@@ -6,12 +6,7 @@
 # tests for tracked changes ; tdf912270
 
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict, type_text
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 class trackedchanges(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests/versionDialog.py b/sw/qa/uitest/writer_tests/versionDialog.py
index 011d5398ce1d..5d0e3c120b4e 100644
--- a/sw/qa/uitest/writer_tests/versionDialog.py
+++ b/sw/qa/uitest/writer_tests/versionDialog.py
@@ -8,12 +8,7 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 class versionDialog(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests/wordCount.py b/sw/qa/uitest/writer_tests/wordCount.py
index b71656eb2b65..b7b88dcb4f74 100644
--- a/sw/qa/uitest/writer_tests/wordCount.py
+++ b/sw/qa/uitest/writer_tests/wordCount.py
@@ -7,12 +7,7 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 class writerWordCount(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests2/tdf116474.py b/sw/qa/uitest/writer_tests2/tdf116474.py
index fe2ed1c488b0..9dbdd447171a 100644
--- a/sw/qa/uitest/writer_tests2/tdf116474.py
+++ b/sw/qa/uitest/writer_tests2/tdf116474.py
@@ -4,16 +4,11 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from uitest.uihelper.common import select_pos
-import org.libreoffice.unotest
-import pathlib
 
 #Bug 116474 - Undo/redo: The redo of adding caption to an image isn't working: no image
 
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
 class tdf116474(UITestCase):
 
    def test_tdf116474_insert_caption_undo(self):
diff --git a/sw/qa/uitest/writer_tests3/goToPage.py b/sw/qa/uitest/writer_tests3/goToPage.py
index 7c56791a9066..e8c0c6486a38 100644
--- a/sw/qa/uitest/writer_tests3/goToPage.py
+++ b/sw/qa/uitest/writer_tests3/goToPage.py
@@ -5,12 +5,7 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 class GoToPage_dialog(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests4/spellDialog.py b/sw/qa/uitest/writer_tests4/spellDialog.py
index 560bbb76e227..635a9abfb5e7 100644
--- a/sw/qa/uitest/writer_tests4/spellDialog.py
+++ b/sw/qa/uitest/writer_tests4/spellDialog.py
@@ -5,18 +5,12 @@
 #
 
 import re
-import org.libreoffice.unotest
-import pathlib
-
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 from libreoffice.linguistic.linguservice import get_spellchecker
 from com.sun.star.lang import Locale
 
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
 class SpellingAndGrammarDialog(UITestCase):
 
     def is_supported_locale(self, language, country):
diff --git a/sw/qa/uitest/writer_tests4/tdf108124.py b/sw/qa/uitest/writer_tests4/tdf108124.py
index 929a3d7b498d..e5f1a7f4979e 100644
--- a/sw/qa/uitest/writer_tests4/tdf108124.py
+++ b/sw/qa/uitest/writer_tests4/tdf108124.py
@@ -6,14 +6,7 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-import org.libreoffice.unotest
-import pathlib
-import time
-from uitest.debug import sleep
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 class tdf108124(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests4/tdf113284.py b/sw/qa/uitest/writer_tests4/tdf113284.py
index 4a4750b00349..8bb43962d8fb 100644
--- a/sw/qa/uitest/writer_tests4/tdf113284.py
+++ b/sw/qa/uitest/writer_tests4/tdf113284.py
@@ -5,12 +5,7 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 class tdf113284(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests4/tdf122449.py b/sw/qa/uitest/writer_tests4/tdf122449.py
index 06a603c5ccf1..76072dd057ab 100644
--- a/sw/qa/uitest/writer_tests4/tdf122449.py
+++ b/sw/qa/uitest/writer_tests4/tdf122449.py
@@ -7,13 +7,7 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.debug import sleep
-from uitest.uihelper.common import get_state_as_dict, type_text
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 #Bug 122449 - Crash in: mergedlo.dll when closing "Edit Index Entry" dialog (gen/gtk)
 
diff --git a/sw/qa/uitest/writer_tests4/tdf134439.py b/sw/qa/uitest/writer_tests4/tdf134439.py
index aec16c7ba849..738820c71fca 100644
--- a/sw/qa/uitest/writer_tests4/tdf134439.py
+++ b/sw/qa/uitest/writer_tests4/tdf134439.py
@@ -5,13 +5,8 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from libreoffice.uno.propertyvalue import mkPropertyValues
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 class tdf134439(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests4/tdf135636.py b/sw/qa/uitest/writer_tests4/tdf135636.py
index 0620f9a185bd..e4da391121e9 100644
--- a/sw/qa/uitest/writer_tests4/tdf135636.py
+++ b/sw/qa/uitest/writer_tests4/tdf135636.py
@@ -5,12 +5,7 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 class tdf135636(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests4/tdf136578.py b/sw/qa/uitest/writer_tests4/tdf136578.py
index 2ed8ff039bed..7475ffd7a606 100644
--- a/sw/qa/uitest/writer_tests4/tdf136578.py
+++ b/sw/qa/uitest/writer_tests4/tdf136578.py
@@ -5,11 +5,7 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 class tdf136578(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests4/tdf49683.py b/sw/qa/uitest/writer_tests4/tdf49683.py
index 48cd641d39f4..959b9015334c 100644
--- a/sw/qa/uitest/writer_tests4/tdf49683.py
+++ b/sw/qa/uitest/writer_tests4/tdf49683.py
@@ -9,13 +9,8 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from uitest.uihelper.common import select_pos
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 class tdf49683(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py b/sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py
index 0a32863d664c..4e87563f9c82 100644
--- a/sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py
+++ b/sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py
@@ -5,14 +5,8 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from libreoffice.uno.propertyvalue import mkPropertyValues
-import org.libreoffice.unotest
-import pathlib
-import time
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 class dateFormFieldDialog(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests5/DropDownFormFieldPropertiesDialog.py b/sw/qa/uitest/writer_tests5/DropDownFormFieldPropertiesDialog.py
index 08797d9bb3ee..48608e3ee95d 100644
--- a/sw/qa/uitest/writer_tests5/DropDownFormFieldPropertiesDialog.py
+++ b/sw/qa/uitest/writer_tests5/DropDownFormFieldPropertiesDialog.py
@@ -5,14 +5,8 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from libreoffice.uno.propertyvalue import mkPropertyValues
-import org.libreoffice.unotest
-import pathlib
-import time
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 class dropDownFormFieldDialog(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests5/tdf107494.py b/sw/qa/uitest/writer_tests5/tdf107494.py
index 72d32f439eca..f7eadf68a4c3 100644
--- a/sw/qa/uitest/writer_tests5/tdf107494.py
+++ b/sw/qa/uitest/writer_tests5/tdf107494.py
@@ -5,16 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 #Bug 107494 - CRASH: LibreOffice crashes while deleting the header containing an image
 
diff --git a/sw/qa/uitest/writer_tests5/tdf117039.py b/sw/qa/uitest/writer_tests5/tdf117039.py
index 9045f71c9f9c..0ec90810a7b3 100644
--- a/sw/qa/uitest/writer_tests5/tdf117039.py
+++ b/sw/qa/uitest/writer_tests5/tdf117039.py
@@ -9,12 +9,7 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-   return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 #Bug 117039 - Print Preview crashes on signed document
 
diff --git a/sw/qa/uitest/writer_tests5/tdf118540.py b/sw/qa/uitest/writer_tests5/tdf118540.py
index 9b8b34fa3200..1ae4a30c2055 100644
--- a/sw/qa/uitest/writer_tests5/tdf118540.py
+++ b/sw/qa/uitest/writer_tests5/tdf118540.py
@@ -9,13 +9,7 @@
 
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-   return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 #Bug 118540 - LO6.1b2: DOCX crashes when properties are opened in print preview mode
 
diff --git a/sw/qa/uitest/writer_tests5/titlePageWizard.py b/sw/qa/uitest/writer_tests5/titlePageWizard.py
index f23c79c68768..ca391a6d4010 100644
--- a/sw/qa/uitest/writer_tests5/titlePageWizard.py
+++ b/sw/qa/uitest/writer_tests5/titlePageWizard.py
@@ -5,13 +5,8 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from libreoffice.uno.propertyvalue import mkPropertyValues
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 # This tests the Format->Title Page wizard, specifically the reset page number portion.
 class tdf138907(UITestCase):
diff --git a/sw/qa/uitest/writer_tests6/tdf120731.py b/sw/qa/uitest/writer_tests6/tdf120731.py
index b2d7226630b6..b9d8f6afb9da 100644
--- a/sw/qa/uitest/writer_tests6/tdf120731.py
+++ b/sw/qa/uitest/writer_tests6/tdf120731.py
@@ -5,17 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
-def get_url_for_data_file(file_name):
-   return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 #Bug 120731 - Crash cuilo!makeAutoCorrEdit when open character dialog with large amount of text selected
 
diff --git a/sw/qa/uitest/writer_tests6/tdf124586.py b/sw/qa/uitest/writer_tests6/tdf124586.py
index fa71f0551317..8bb4f67e8888 100644
--- a/sw/qa/uitest/writer_tests6/tdf124586.py
+++ b/sw/qa/uitest/writer_tests6/tdf124586.py
@@ -5,17 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 #Bug 124586 - Crash if switch from user outline numbering to chapter numbering with same paragraph style
 
diff --git a/sw/qa/uitest/writer_tests6/tdf124675.py b/sw/qa/uitest/writer_tests6/tdf124675.py
index 6b4c4988f58a..f124a554dd08 100644
--- a/sw/qa/uitest/writer_tests6/tdf124675.py
+++ b/sw/qa/uitest/writer_tests6/tdf124675.py
@@ -5,18 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 #Bug 124675 - CRASH: after moving the content down and undoing
 
diff --git a/sw/qa/uitest/writer_tests6/tdf126017.py b/sw/qa/uitest/writer_tests6/tdf126017.py
index 99ca14759e5f..3639e9ed1b18 100644
--- a/sw/qa/uitest/writer_tests6/tdf126017.py
+++ b/sw/qa/uitest/writer_tests6/tdf126017.py
@@ -5,18 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-from uitest.debug import sleep
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-   return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 #Bug 126017 - Crash swlo!SwNode::EndOfSectionIndex
 
diff --git a/sw/qa/uitest/writer_tests6/tdf126627.py b/sw/qa/uitest/writer_tests6/tdf126627.py
index 4ba4f17d9a9b..0fa84b347910 100644
--- a/sw/qa/uitest/writer_tests6/tdf126627.py
+++ b/sw/qa/uitest/writer_tests6/tdf126627.py
@@ -5,17 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
 from uitest.uihelper.common import select_pos
 from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
 
 #Bug 126627 - CRASH: undoing redlinehide deletion
 
diff --git a/sw/qa/uitest/writer_tests7/tdf131936.py b/sw/qa/uitest/writer_tests7/tdf131936.py
index 97b9192c3b30..20a5e6b11517 100644
--- a/sw/qa/uitest/writer_tests7/tdf131936.py
+++ b/sw/qa/uitest/writer_tests7/tdf131936.py
@@ -3,15 +3,10 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.config import DEFAULT_SLEEP
 import time
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 class tdf131936(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests7/tdf131963.py b/sw/qa/uitest/writer_tests7/tdf131963.py
index 853de13375b5..3604a526d526 100644
--- a/sw/qa/uitest/writer_tests7/tdf131963.py
+++ b/sw/qa/uitest/writer_tests7/tdf131963.py
@@ -6,12 +6,7 @@
 #
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 class tdf131963(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests7/tdf132169.py b/sw/qa/uitest/writer_tests7/tdf132169.py
index 3ac183c6578d..90cc4c11dcc9 100644
--- a/sw/qa/uitest/writer_tests7/tdf132169.py
+++ b/sw/qa/uitest/writer_tests7/tdf132169.py
@@ -5,14 +5,9 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 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, get_url_for_data_file, type_text
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import change_measurement_unit
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 class tdf132169(UITestCase):
     def test_tdf132169(self):
diff --git a/sw/qa/uitest/writer_tests7/tdf132596.py b/sw/qa/uitest/writer_tests7/tdf132596.py
index 4c2b9bc3745f..daed846332be 100644
--- a/sw/qa/uitest/writer_tests7/tdf132596.py
+++ b/sw/qa/uitest/writer_tests7/tdf132596.py
@@ -6,12 +6,7 @@
 #
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 class tdf132596(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests7/tdf132597.py b/sw/qa/uitest/writer_tests7/tdf132597.py
index 0bc2116779ff..1666ecbfc21e 100644
--- a/sw/qa/uitest/writer_tests7/tdf132597.py
+++ b/sw/qa/uitest/writer_tests7/tdf132597.py
@@ -6,12 +6,7 @@
 #
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 
 class tdf132597(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests7/tdf134243.py b/sw/qa/uitest/writer_tests7/tdf134243.py
index 2cb66e8e4b9f..53e9109e22bb 100644
--- a/sw/qa/uitest/writer_tests7/tdf134243.py
+++ b/sw/qa/uitest/writer_tests7/tdf134243.py
@@ -5,11 +5,7 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_url_for_data_file
 
 class tdf134243(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests7/tdf137802.py b/sw/qa/uitest/writer_tests7/tdf137802.py
index 8f7a887e753c..96c2fa5193af 100644
--- a/sw/qa/uitest/writer_tests7/tdf137802.py
+++ b/sw/qa/uitest/writer_tests7/tdf137802.py
@@ -5,14 +5,9 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from com.sun.star.text.TextContentAnchorType import AT_PAGE, AT_PARAGRAPH
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 class tdf137802(UITestCase):
 
diff --git a/sw/qa/uitest/writer_tests7/tdf99711.py b/sw/qa/uitest/writer_tests7/tdf99711.py
index 140372bc0b63..776894431b92 100644
--- a/sw/qa/uitest/writer_tests7/tdf99711.py
+++ b/sw/qa/uitest/writer_tests7/tdf99711.py
@@ -5,14 +5,9 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import change_measurement_unit
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 class tdf99711(UITestCase):
     def test_tdf99711(self):
diff --git a/uitest/demo_ui/handle_multiple_files.py b/uitest/demo_ui/handle_multiple_files.py
index e60d3884b63e..01e086f3d422 100644
--- a/uitest/demo_ui/handle_multiple_files.py
+++ b/uitest/demo_ui/handle_multiple_files.py
@@ -7,18 +7,9 @@
 
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from libreoffice.uno.eventlistener import EventListener
-
 from uitest.framework import UITestCase
-
-from uitest.debug import sleep
-
+from uitest.uihelper.common import get_url_for_data_file
 import time
-import org.libreoffice.unotest
-import os
-import pathlib
-
-def get_url_for_data_file(file_name):
-    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 class HandleFiles(UITestCase):
 


More information about the Libreoffice-commits mailing list