[Libreoffice-commits] core.git: sc/qa uitest/uitest
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jan 12 20:24:59 UTC 2021
sc/qa/uitest/autofilter/autofilter.py | 7 +------
sc/qa/uitest/autofilter/autofilterBugs.py | 8 +-------
sc/qa/uitest/autofilter/tdf101165.py | 6 +-----
sc/qa/uitest/autofilter/tdf117276.py | 6 +-----
sc/qa/uitest/autofilter/tdf117276_autofilter_reset.py | 6 +-----
sc/qa/uitest/autofilter/tdf122260.py | 6 +-----
sc/qa/uitest/autofilter/tdf130070.py | 6 +-----
sc/qa/uitest/autofilter/tdf97340.py | 7 +------
sc/qa/uitest/calc_tests/autofill.py | 8 +-------
sc/qa/uitest/calc_tests/autosum.py | 8 ++------
sc/qa/uitest/calc_tests/mergedRowsColumns.py | 9 +--------
sc/qa/uitest/calc_tests/tdf120161.py | 8 +-------
sc/qa/uitest/calc_tests/tdf133855.py | 6 +-----
sc/qa/uitest/calc_tests2/consolidate.py | 8 +-------
sc/qa/uitest/calc_tests2/stableSorting.py | 8 ++------
sc/qa/uitest/calc_tests2/standardFilter.py | 7 ++-----
sc/qa/uitest/calc_tests2/subtotals.py | 9 +--------
sc/qa/uitest/calc_tests2/tdf114992.py | 6 ++----
sc/qa/uitest/calc_tests2/tdf118189.py | 8 +-------
sc/qa/uitest/calc_tests2/tdf120174.py | 6 +-----
sc/qa/uitest/calc_tests2/tdf37623.py | 7 +------
sc/qa/uitest/calc_tests2/tdf53482.py | 8 ++------
sc/qa/uitest/calc_tests3/tdf77509.py | 9 +--------
sc/qa/uitest/calc_tests3/tdf81351.py | 7 +------
sc/qa/uitest/calc_tests4/tdf131170.py | 7 +------
sc/qa/uitest/calc_tests4/tdf95192.py | 7 +------
sc/qa/uitest/calc_tests4/tdf99386.py | 9 +--------
sc/qa/uitest/calc_tests4/textToColumns.py | 10 ++--------
sc/qa/uitest/calc_tests4/trackedChanges.py | 7 +------
sc/qa/uitest/calc_tests6/tdf107869.py | 8 +-------
sc/qa/uitest/calc_tests6/tdf108654.py | 7 +------
sc/qa/uitest/calc_tests6/tdf118638.py | 9 +--------
sc/qa/uitest/calc_tests7/tdf120660.py | 8 +-------
sc/qa/uitest/calc_tests7/tdf122509.py | 8 +-------
sc/qa/uitest/calc_tests7/tdf124818.py | 8 +-------
sc/qa/uitest/calc_tests7/tdf137397.py | 7 +------
sc/qa/uitest/calc_tests7/tdf31805.py | 6 +-----
sc/qa/uitest/calc_tests8/navigator.py | 7 +------
sc/qa/uitest/calc_tests8/tdf119343.py | 7 +------
sc/qa/uitest/calc_tests8/tdf124829.py | 8 +-------
sc/qa/uitest/calc_tests9/tdf126673.py | 6 +-----
sc/qa/uitest/calc_tests9/tdf130371.py | 7 +------
sc/qa/uitest/calc_tests9/tdf137446.py | 7 +------
sc/qa/uitest/calc_tests9/tdf91217.py | 7 +------
sc/qa/uitest/chart/chartArea.py | 8 +-------
sc/qa/uitest/chart/chartAxes.py | 9 +--------
sc/qa/uitest/chart/formatDataSeries.py | 9 +--------
sc/qa/uitest/chart/tdf122398.py | 9 +--------
uitest/uitest/uihelper/common.py | 5 +++++
49 files changed, 59 insertions(+), 305 deletions(-)
New commits:
commit 82cb5a3bb27bb70c97b3d04b9de97a3ff67231c5
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Jan 12 12:29:07 2021 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Jan 12 21:24:20 2021 +0100
uitest: sc: factor out common code ( part 1 )
Change-Id: Ib0b84349c138d361001af4547d91a81d8b5d8e63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109166
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sc/qa/uitest/autofilter/autofilter.py b/sc/qa/uitest/autofilter/autofilter.py
index 78a5887a6c4c..bef8d43c6ef6 100644
--- a/sc/qa/uitest/autofilter/autofilter.py
+++ b/sc/qa/uitest/autofilter/autofilter.py
@@ -6,15 +6,10 @@
#
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 libreoffice.calc.document import get_row
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()
def is_row_hidden(doc, index):
row = get_row(doc, index)
diff --git a/sc/qa/uitest/autofilter/autofilterBugs.py b/sc/qa/uitest/autofilter/autofilterBugs.py
index e1d0cd19d524..9eb45d83a3a0 100644
--- a/sc/qa/uitest/autofilter/autofilterBugs.py
+++ b/sc/qa/uitest/autofilter/autofilterBugs.py
@@ -6,15 +6,9 @@
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.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()
-
class autofilter(UITestCase):
def test_tdf115046(self):
diff --git a/sc/qa/uitest/autofilter/tdf101165.py b/sc/qa/uitest/autofilter/tdf101165.py
index 22605170f319..1eda0193b69c 100644
--- a/sc/qa/uitest/autofilter/tdf101165.py
+++ b/sc/qa/uitest/autofilter/tdf101165.py
@@ -7,11 +7,7 @@
from uitest.framework import UITestCase
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()
+from uitest.uihelper.common import get_url_for_data_file
#Bug 101165 - Crashing on a filter selection, every time
diff --git a/sc/qa/uitest/autofilter/tdf117276.py b/sc/qa/uitest/autofilter/tdf117276.py
index 6ea392fc787b..b4e71ed6d9f3 100644
--- a/sc/qa/uitest/autofilter/tdf117276.py
+++ b/sc/qa/uitest/autofilter/tdf117276.py
@@ -7,11 +7,7 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
from libreoffice.calc.document import get_row
-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
def is_row_hidden(doc, index):
row = get_row(doc, index)
diff --git a/sc/qa/uitest/autofilter/tdf117276_autofilter_reset.py b/sc/qa/uitest/autofilter/tdf117276_autofilter_reset.py
index f065e6455ebf..ef900f77040f 100644
--- a/sc/qa/uitest/autofilter/tdf117276_autofilter_reset.py
+++ b/sc/qa/uitest/autofilter/tdf117276_autofilter_reset.py
@@ -8,11 +8,7 @@ from uitest.framework import UITestCase
from uitest.uihelper.calc import enter_text_to_cell
from libreoffice.uno.propertyvalue import mkPropertyValues
from libreoffice.calc.document import get_row
-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
def is_row_hidden(doc, index):
row = get_row(doc, index)
diff --git a/sc/qa/uitest/autofilter/tdf122260.py b/sc/qa/uitest/autofilter/tdf122260.py
index 5d9977b7f731..7e2b8f8d3e39 100644
--- a/sc/qa/uitest/autofilter/tdf122260.py
+++ b/sc/qa/uitest/autofilter/tdf122260.py
@@ -7,11 +7,7 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
from libreoffice.calc.document import get_row
-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
def is_row_hidden(doc, index):
row = get_row(doc, index)
diff --git a/sc/qa/uitest/autofilter/tdf130070.py b/sc/qa/uitest/autofilter/tdf130070.py
index 4afea4dc821d..e74bd035f2fe 100644
--- a/sc/qa/uitest/autofilter/tdf130070.py
+++ b/sc/qa/uitest/autofilter/tdf130070.py
@@ -7,11 +7,7 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
from libreoffice.calc.document import get_row
-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
def is_row_hidden(doc, index):
row = get_row(doc, index)
diff --git a/sc/qa/uitest/autofilter/tdf97340.py b/sc/qa/uitest/autofilter/tdf97340.py
index 602586836622..7ef59bf6b641 100644
--- a/sc/qa/uitest/autofilter/tdf97340.py
+++ b/sc/qa/uitest/autofilter/tdf97340.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()
#Bug 97340 - Calc crashes on filtering with select checkbox with space bar
diff --git a/sc/qa/uitest/calc_tests/autofill.py b/sc/qa/uitest/calc_tests/autofill.py
index 09b37d6a6258..7112506b43a2 100644
--- a/sc/qa/uitest/calc_tests/autofill.py
+++ b/sc/qa/uitest/calc_tests/autofill.py
@@ -5,19 +5,13 @@
# 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 uitest.debug import sleep
from libreoffice.calc.document import get_cell_by_position
-import org.libreoffice.unotest
-import pathlib
from libreoffice.uno.propertyvalue import mkPropertyValues
#Test for the AutoFill feature - auto-fill can't increment last octet of ip addresses
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
class CalcAutofill(UITestCase):
def test_autofill(self):
diff --git a/sc/qa/uitest/calc_tests/autosum.py b/sc/qa/uitest/calc_tests/autosum.py
index 2bb4cff76dc8..abb4b40253a5 100644
--- a/sc/qa/uitest/calc_tests/autosum.py
+++ b/sc/qa/uitest/calc_tests/autosum.py
@@ -5,18 +5,14 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from uitest.framework import UITestCase
-import org.libreoffice.unotest
import os
-import pathlib
-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.calc.document import get_sheet_from_doc
from libreoffice.calc.conditional_format import get_conditional_format_from_sheet
-from uitest.debug import sleep
from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
+
#AutoSum feature test
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
class calcAutosum(UITestCase):
diff --git a/sc/qa/uitest/calc_tests/mergedRowsColumns.py b/sc/qa/uitest/calc_tests/mergedRowsColumns.py
index 1302c7b64bd5..96900afbc0dd 100644
--- a/sc/qa/uitest/calc_tests/mergedRowsColumns.py
+++ b/sc/qa/uitest/calc_tests/mergedRowsColumns.py
@@ -8,15 +8,8 @@
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.framework import UITestCase
from libreoffice.calc.document import get_column
-import org.libreoffice.unotest
-import pathlib
-import time
-from uitest.debug import sleep
from libreoffice.calc.document import get_cell_by_position
-from uitest.uihelper.common import get_state_as_dict
-
-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 mergedRowsColumns(UITestCase):
diff --git a/sc/qa/uitest/calc_tests/tdf120161.py b/sc/qa/uitest/calc_tests/tdf120161.py
index 18c5f3ed4b79..a15384c1a0cc 100755
--- a/sc/qa/uitest/calc_tests/tdf120161.py
+++ b/sc/qa/uitest/calc_tests/tdf120161.py
@@ -6,15 +6,9 @@
#
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
-import org.libreoffice.unotest
import os
-import pathlib
from tempfile import TemporaryDirectory
-
-
-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
# Bug 120161: PRINTING, PDF Export: Problem with selected cells which cross pages
class tdf120161(UITestCase):
diff --git a/sc/qa/uitest/calc_tests/tdf133855.py b/sc/qa/uitest/calc_tests/tdf133855.py
index a48701d26e4c..8f347e87c080 100644
--- a/sc/qa/uitest/calc_tests/tdf133855.py
+++ b/sc/qa/uitest/calc_tests/tdf133855.py
@@ -7,11 +7,7 @@
from uitest.framework import UITestCase
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()
+from uitest.uihelper.common import get_url_for_data_file
class tdf133855(UITestCase):
diff --git a/sc/qa/uitest/calc_tests2/consolidate.py b/sc/qa/uitest/calc_tests2/consolidate.py
index b52e3be8f10b..4798372ab059 100644
--- a/sc/qa/uitest/calc_tests2/consolidate.py
+++ b/sc/qa/uitest/calc_tests2/consolidate.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 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()
-
-#consolidatedialog.ui
class consolidate(UITestCase):
def test_consolidate(self):
calc_doc = self.ui_test.load_file(get_url_for_data_file("consolidate.ods"))
diff --git a/sc/qa/uitest/calc_tests2/stableSorting.py b/sc/qa/uitest/calc_tests2/stableSorting.py
index 986c7cc3d612..269bd5252f2b 100644
--- a/sc/qa/uitest/calc_tests2/stableSorting.py
+++ b/sc/qa/uitest/calc_tests2/stableSorting.py
@@ -5,20 +5,16 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-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 uitest.uihelper.common import select_pos
from uitest.uihelper.calc import enter_text_to_cell
from libreoffice.calc.document import get_sheet_from_doc
from libreoffice.calc.conditional_format import get_conditional_format_from_sheet
-from uitest.debug import sleep
from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
+
#Testcases Sorting TCS_Sorting Stable sorting
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
class CalcStableSorting(UITestCase):
diff --git a/sc/qa/uitest/calc_tests2/standardFilter.py b/sc/qa/uitest/calc_tests2/standardFilter.py
index 6519fe6af6c2..e5b5d1f6ba8d 100644
--- a/sc/qa/uitest/calc_tests2/standardFilter.py
+++ b/sc/qa/uitest/calc_tests2/standardFilter.py
@@ -5,16 +5,13 @@
# 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
+
#Bug 113979 - Paste unformatted text does not ignore empty cells
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
class standardFilter(UITestCase):
def test_standard_filter(self):
diff --git a/sc/qa/uitest/calc_tests2/subtotals.py b/sc/qa/uitest/calc_tests2/subtotals.py
index 31e87d9acdf3..3a48cd21335a 100644
--- a/sc/qa/uitest/calc_tests2/subtotals.py
+++ b/sc/qa/uitest/calc_tests2/subtotals.py
@@ -11,14 +11,7 @@ from libreoffice.calc.document import get_column
from uitest.uihelper.calc import enter_text_to_cell
from libreoffice.calc.document import get_cell_by_position
from uitest.uihelper.common import select_pos
-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 Subtotals(UITestCase):
diff --git a/sc/qa/uitest/calc_tests2/tdf114992.py b/sc/qa/uitest/calc_tests2/tdf114992.py
index 0e4b30c2ae9e..38c5568171f6 100644
--- a/sc/qa/uitest/calc_tests2/tdf114992.py
+++ b/sc/qa/uitest/calc_tests2/tdf114992.py
@@ -5,11 +5,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
from uitest.framework import UITestCase
-import org.libreoffice.unotest
-import pathlib
+from uitest.uihelper.common import get_url_for_data_file
+
#Bug: Delete a sheet in a calc document and LO crashes
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
class tdf114992(UITestCase):
def test_tdf114992_delete_sheet_crash(self):
diff --git a/sc/qa/uitest/calc_tests2/tdf118189.py b/sc/qa/uitest/calc_tests2/tdf118189.py
index e49a471fd40a..bd5bd41bafec 100644
--- a/sc/qa/uitest/calc_tests2/tdf118189.py
+++ b/sc/qa/uitest/calc_tests2/tdf118189.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 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 uitest.debug import sleep
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 118189 - EDITING Crashes on Undo after Cut conditional formatting data
diff --git a/sc/qa/uitest/calc_tests2/tdf120174.py b/sc/qa/uitest/calc_tests2/tdf120174.py
index e078147a9c6f..d9e0de2aa0d0 100644
--- a/sc/qa/uitest/calc_tests2/tdf120174.py
+++ b/sc/qa/uitest/calc_tests2/tdf120174.py
@@ -8,11 +8,7 @@ from uitest.framework import UITestCase
from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
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()
+from uitest.uihelper.common import get_url_for_data_file
class tdf120174(UITestCase):
def test_tdf120174(self):
diff --git a/sc/qa/uitest/calc_tests2/tdf37623.py b/sc/qa/uitest/calc_tests2/tdf37623.py
index d129cc3d0f1d..6981b8ad21f2 100644
--- a/sc/qa/uitest/calc_tests2/tdf37623.py
+++ b/sc/qa/uitest/calc_tests2/tdf37623.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.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()
class tdf37623(UITestCase):
diff --git a/sc/qa/uitest/calc_tests2/tdf53482.py b/sc/qa/uitest/calc_tests2/tdf53482.py
index 33ffa71d6283..95e2533849f0 100644
--- a/sc/qa/uitest/calc_tests2/tdf53482.py
+++ b/sc/qa/uitest/calc_tests2/tdf53482.py
@@ -5,17 +5,13 @@
# 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
-#Bug 53482 - UI: Option 'Range contains column headings' ignored
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+#Bug 53482 - UI: Option 'Range contains column headings' ignored
class tdf53482(UITestCase):
diff --git a/sc/qa/uitest/calc_tests3/tdf77509.py b/sc/qa/uitest/calc_tests3/tdf77509.py
index 216a6f763aed..19ae4e31640b 100644
--- a/sc/qa/uitest/calc_tests3/tdf77509.py
+++ b/sc/qa/uitest/calc_tests3/tdf77509.py
@@ -5,19 +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 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
-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()
-
-#consolidatedialog.ui
class tdf77509(UITestCase):
def test_tdf77509_consolidate(self):
calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf77509.xls"))
diff --git a/sc/qa/uitest/calc_tests3/tdf81351.py b/sc/qa/uitest/calc_tests3/tdf81351.py
index 520f1c3c64c8..afe320559871 100644
--- a/sc/qa/uitest/calc_tests3/tdf81351.py
+++ b/sc/qa/uitest/calc_tests3/tdf81351.py
@@ -10,12 +10,7 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.framework import UITestCase
from libreoffice.calc.document import get_column
from libreoffice.calc.document import get_cell_by_position
-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()
+from uitest.uihelper.common import get_url_for_data_file
class tdf81351(UITestCase):
diff --git a/sc/qa/uitest/calc_tests4/tdf131170.py b/sc/qa/uitest/calc_tests4/tdf131170.py
index e05a7052a902..fc7b097a8b2d 100644
--- a/sc/qa/uitest/calc_tests4/tdf131170.py
+++ b/sc/qa/uitest/calc_tests4/tdf131170.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 tdf131170(UITestCase):
def test_DefineLabelRange(self):
diff --git a/sc/qa/uitest/calc_tests4/tdf95192.py b/sc/qa/uitest/calc_tests4/tdf95192.py
index 5e1292d9d3b9..be310f6a4eb1 100644
--- a/sc/qa/uitest/calc_tests4/tdf95192.py
+++ b/sc/qa/uitest/calc_tests4/tdf95192.py
@@ -5,18 +5,13 @@
# 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
#Bug 95192 - SORTING Natural sorting not working with non-letter,non-number content
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
class tdf95192(UITestCase):
def test_td99627_natural_sort(self):
calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf95192.ods"))
diff --git a/sc/qa/uitest/calc_tests4/tdf99386.py b/sc/qa/uitest/calc_tests4/tdf99386.py
index ff9286b61288..0d2617e4ec80 100644
--- a/sc/qa/uitest/calc_tests4/tdf99386.py
+++ b/sc/qa/uitest/calc_tests4/tdf99386.py
@@ -6,17 +6,10 @@
#
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.debug import sleep
from uitest.uihelper.calc import enter_text_to_cell
from libreoffice.calc.document import get_cell_by_position
-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 tdf99386(UITestCase):
diff --git a/sc/qa/uitest/calc_tests4/textToColumns.py b/sc/qa/uitest/calc_tests4/textToColumns.py
index 6e2aad2c23fe..993ea69cb36d 100644
--- a/sc/qa/uitest/calc_tests4/textToColumns.py
+++ b/sc/qa/uitest/calc_tests4/textToColumns.py
@@ -5,21 +5,15 @@
# 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_sheet_from_doc
from libreoffice.calc.conditional_format import get_conditional_format_from_sheet
-from uitest.debug import sleep
from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
-import org.libreoffice.unotest
-import pathlib
-#text to column testcase
-
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+#text to column testcase
class CalcTextToColumns(UITestCase):
diff --git a/sc/qa/uitest/calc_tests4/trackedChanges.py b/sc/qa/uitest/calc_tests4/trackedChanges.py
index 1aef34d7e327..eb16ed5c7cc3 100644
--- a/sc/qa/uitest/calc_tests4/trackedChanges.py
+++ b/sc/qa/uitest/calc_tests4/trackedChanges.py
@@ -9,13 +9,8 @@ from uitest.framework import UITestCase
from libreoffice.calc.document import get_cell_by_position
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.calc import enter_text_to_cell
-from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
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 CalcTrackedChanges(UITestCase):
diff --git a/sc/qa/uitest/calc_tests6/tdf107869.py b/sc/qa/uitest/calc_tests6/tdf107869.py
index d388610433b2..3fc73f7e8e02 100644
--- a/sc/qa/uitest/calc_tests6/tdf107869.py
+++ b/sc/qa/uitest/calc_tests6/tdf107869.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 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
-
-#https://bugs.documentfoundation.org/show_bug.cgi?id=107869
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
class tdf107869(UITestCase):
def test_tdf107869_undo_redo_delete_row_with_comment(self):
diff --git a/sc/qa/uitest/calc_tests6/tdf108654.py b/sc/qa/uitest/calc_tests6/tdf108654.py
index 93576fe41379..3f806b7024b1 100644
--- a/sc/qa/uitest/calc_tests6/tdf108654.py
+++ b/sc/qa/uitest/calc_tests6/tdf108654.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 108654 - CRASH while undoing paste on a new sheet
class tdf108654(UITestCase):
diff --git a/sc/qa/uitest/calc_tests6/tdf118638.py b/sc/qa/uitest/calc_tests6/tdf118638.py
index b6e700e01939..284c423fe2b2 100644
--- a/sc/qa/uitest/calc_tests6/tdf118638.py
+++ b/sc/qa/uitest/calc_tests6/tdf118638.py
@@ -11,14 +11,7 @@ from libreoffice.calc.document import get_column
from uitest.uihelper.calc import enter_text_to_cell
from libreoffice.calc.document import get_cell_by_position
from uitest.uihelper.common import select_pos
-from uitest.uihelper.common import get_state_as_dict
-import time
-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 118638 - subtotal option loses doesn't contain existing format for column
class Subtotals(UITestCase):
diff --git a/sc/qa/uitest/calc_tests7/tdf120660.py b/sc/qa/uitest/calc_tests7/tdf120660.py
index d36ad13bc365..4fcef5787b06 100644
--- a/sc/qa/uitest/calc_tests7/tdf120660.py
+++ b/sc/qa/uitest/calc_tests7/tdf120660.py
@@ -5,19 +5,13 @@
# 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_sheet_from_doc
from libreoffice.calc.conditional_format import get_conditional_format_from_sheet
-from uitest.debug import sleep
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 120660 - cells not recalculated after copy/paste different range of cells
diff --git a/sc/qa/uitest/calc_tests7/tdf122509.py b/sc/qa/uitest/calc_tests7/tdf122509.py
index 87b28cb69b22..9804b23ec528 100644
--- a/sc/qa/uitest/calc_tests7/tdf122509.py
+++ b/sc/qa/uitest/calc_tests7/tdf122509.py
@@ -5,19 +5,13 @@
# 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_sheet_from_doc
from libreoffice.calc.conditional_format import get_conditional_format_from_sheet
-from uitest.debug import sleep
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 122509 - EDITING Calc crashes when manipulating Negative numbers in red on Currency ( not gtk3 )
diff --git a/sc/qa/uitest/calc_tests7/tdf124818.py b/sc/qa/uitest/calc_tests7/tdf124818.py
index 1345484268b7..e1fabbf65940 100644
--- a/sc/qa/uitest/calc_tests7/tdf124818.py
+++ b/sc/qa/uitest/calc_tests7/tdf124818.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 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
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()
#Bug 124818 - CRASH: selecting all and switching spreadsheet
diff --git a/sc/qa/uitest/calc_tests7/tdf137397.py b/sc/qa/uitest/calc_tests7/tdf137397.py
index fe8b34a31d48..48ac40f27dcd 100644
--- a/sc/qa/uitest/calc_tests7/tdf137397.py
+++ b/sc/qa/uitest/calc_tests7/tdf137397.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 tdf137397(UITestCase):
diff --git a/sc/qa/uitest/calc_tests7/tdf31805.py b/sc/qa/uitest/calc_tests7/tdf31805.py
index 76d30cf221df..c8a5882e9696 100644
--- a/sc/qa/uitest/calc_tests7/tdf31805.py
+++ b/sc/qa/uitest/calc_tests7/tdf31805.py
@@ -5,17 +5,13 @@
# 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
#Bug 31805 - Deleting a column or row from merged cells
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
class tdf31805(UITestCase):
def test_tdf31805_delete_column_merged(self):
diff --git a/sc/qa/uitest/calc_tests8/navigator.py b/sc/qa/uitest/calc_tests8/navigator.py
index 360a2c47e058..abbb8ce1cf73 100644
--- a/sc/qa/uitest/calc_tests8/navigator.py
+++ b/sc/qa/uitest/calc_tests8/navigator.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 navigator(UITestCase):
diff --git a/sc/qa/uitest/calc_tests8/tdf119343.py b/sc/qa/uitest/calc_tests8/tdf119343.py
index 693b2b1b9520..a5128c488429 100644
--- a/sc/qa/uitest/calc_tests8/tdf119343.py
+++ b/sc/qa/uitest/calc_tests8/tdf119343.py
@@ -5,18 +5,13 @@
# 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_sheet_from_doc
from libreoffice.calc.conditional_format import get_conditional_format_from_sheet
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 119343 - EDITING: copied and pasted cells containing formulas are not recalculated (2)
diff --git a/sc/qa/uitest/calc_tests8/tdf124829.py b/sc/qa/uitest/calc_tests8/tdf124829.py
index 97a43f641472..e41ee01eb093 100644
--- a/sc/qa/uitest/calc_tests8/tdf124829.py
+++ b/sc/qa/uitest/calc_tests8/tdf124829.py
@@ -5,19 +5,13 @@
# 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_sheet_from_doc
from libreoffice.calc.conditional_format import get_conditional_format_from_sheet
-from uitest.debug import sleep
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 124829 - CRASH: cutting and undoing a sheet with external links
diff --git a/sc/qa/uitest/calc_tests9/tdf126673.py b/sc/qa/uitest/calc_tests9/tdf126673.py
index 8cdebfe5d6af..f01844bddd3a 100644
--- a/sc/qa/uitest/calc_tests9/tdf126673.py
+++ b/sc/qa/uitest/calc_tests9/tdf126673.py
@@ -5,16 +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 get_state_as_dict, get_url_for_data_file
from uitest.uihelper.common import select_pos
from uitest.uihelper.common import change_measurement_unit
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 126673 - Calc: Auto-fit column and auto-fit row don't work with line break
diff --git a/sc/qa/uitest/calc_tests9/tdf130371.py b/sc/qa/uitest/calc_tests9/tdf130371.py
index 6a8f00cbf7ef..e2930e855b9a 100644
--- a/sc/qa/uitest/calc_tests9/tdf130371.py
+++ b/sc/qa/uitest/calc_tests9/tdf130371.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
-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 namedRanges(UITestCase):
diff --git a/sc/qa/uitest/calc_tests9/tdf137446.py b/sc/qa/uitest/calc_tests9/tdf137446.py
index fe5c2db14c47..06a716121c28 100644
--- a/sc/qa/uitest/calc_tests9/tdf137446.py
+++ b/sc/qa/uitest/calc_tests9/tdf137446.py
@@ -6,13 +6,8 @@
#
from uitest.framework import UITestCase
from uitest.uihelper.common import change_measurement_unit
-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 tdf137446(UITestCase):
diff --git a/sc/qa/uitest/calc_tests9/tdf91217.py b/sc/qa/uitest/calc_tests9/tdf91217.py
index 54f56a9fd06d..765271c8a8e2 100644
--- a/sc/qa/uitest/calc_tests9/tdf91217.py
+++ b/sc/qa/uitest/calc_tests9/tdf91217.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 91217 - Crash when deleting rows
diff --git a/sc/qa/uitest/chart/chartArea.py b/sc/qa/uitest/chart/chartArea.py
index d2cd4fe259f3..2e5b99b92ea5 100644
--- a/sc/qa/uitest/chart/chartArea.py
+++ b/sc/qa/uitest/chart/chartArea.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.common import change_measurement_unit
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, type_text, get_url_for_data_file
#Chart Area dialog
diff --git a/sc/qa/uitest/chart/chartAxes.py b/sc/qa/uitest/chart/chartAxes.py
index 883ec8306c5d..b0ceb6df5fc6 100644
--- a/sc/qa/uitest/chart/chartAxes.py
+++ b/sc/qa/uitest/chart/chartAxes.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, type_text, get_url_for_data_file
#Chart Enable Axes dialog
diff --git a/sc/qa/uitest/chart/formatDataSeries.py b/sc/qa/uitest/chart/formatDataSeries.py
index 8f487e636c49..4aeaebe66ce8 100644
--- a/sc/qa/uitest/chart/formatDataSeries.py
+++ b/sc/qa/uitest/chart/formatDataSeries.py
@@ -5,19 +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.common import change_measurement_unit
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, type_text, get_url_for_data_file
# test Chart - Data series dialog /core/chart2/uiconfig/ui/tp_SeriesToAxis.ui
diff --git a/sc/qa/uitest/chart/tdf122398.py b/sc/qa/uitest/chart/tdf122398.py
index 48842e37486b..279d46ccce4c 100644
--- a/sc/qa/uitest/chart/tdf122398.py
+++ b/sc/qa/uitest/chart/tdf122398.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, type_text, get_url_for_data_file
# Bug 122398 - UI: Cannot specify min/max in axis scale or axis position. Limited between 0 and 100
diff --git a/uitest/uitest/uihelper/common.py b/uitest/uitest/uihelper/common.py
index 7af57ea2fa92..cb9a761cb7f9 100644
--- a/uitest/uitest/uihelper/common.py
+++ b/uitest/uitest/uihelper/common.py
@@ -6,6 +6,8 @@
#
from libreoffice.uno.propertyvalue import convert_property_values_to_dict, mkPropertyValues
+import org.libreoffice.unotest
+import pathlib
def get_state_as_dict(ui_object):
return convert_property_values_to_dict(ui_object.getState())
@@ -19,6 +21,9 @@ def select_pos(ui_object, pos):
def select_text(ui_object, from_pos, to):
ui_object.executeAction("SELECT", mkPropertyValues({"FROM": from_pos, "TO": to}))
+def get_url_for_data_file(file_name):
+ return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+
def change_measurement_unit(UITestCase, unit):
UITestCase.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
xDialogOpt = UITestCase.xUITest.getTopFocusWindow()
More information about the Libreoffice-commits
mailing list