From a77e2ded1298fa64592c5e26345fd024ca7601fb Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Fri, 23 Oct 2020 13:46:56 +0200 Subject: uitest: sw: get_url_for_data_file -> pathlib.Path Change-Id: I9abfeabe8d86bee3f3724356e2d174d7839ab09d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104725 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- sw/UITest_writer_tests7.mk | 2 +- sw/qa/uitest/chapterNumbering/chapterNumbering.py | 1 - sw/qa/uitest/findReplace/findReplace.py | 1 - sw/qa/uitest/table/tdf115026.py | 1 - sw/qa/uitest/table/tdf135693.py | 5 +++-- sw/qa/uitest/writer_tests/compareDocuments.py | 6 +++--- sw/qa/uitest/writer_tests/data/tdf131936.docx | Bin 0 -> 4326 bytes sw/qa/uitest/writer_tests/trackedChanges.py | 8 +++----- sw/qa/uitest/writer_tests/wordCount.py | 6 +++--- sw/qa/uitest/writer_tests2/tdf116474.py | 7 +++---- sw/qa/uitest/writer_tests3/insertEnvelope.py | 2 -- sw/qa/uitest/writer_tests3/insertPageFooter.py | 2 -- sw/qa/uitest/writer_tests3/lineNumbering.py | 2 -- sw/qa/uitest/writer_tests4/tdf49683.py | 9 ++++----- sw/qa/uitest/writer_tests5/tdf107494.py | 6 +++--- sw/qa/uitest/writer_tests6/tdf126627.py | 3 +-- sw/qa/uitest/writer_tests7/data/tdf131936.docx | Bin 4326 -> 0 bytes sw/qa/uitest/writer_tests7/tdf131936.py | 5 +++-- sw/qa/uitest/writer_tests7/tdf131963.py | 5 +++-- sw/qa/uitest/writer_tests7/tdf132169.py | 5 +++-- sw/qa/uitest/writer_tests7/tdf132596.py | 5 +++-- sw/qa/uitest/writer_tests7/tdf132597.py | 5 +++-- sw/qa/uitest/writer_tests7/tdf134243.py | 5 +++-- sw/qa/uitest/writer_tests7/tdf99711.py | 5 +++-- 24 files changed, 45 insertions(+), 51 deletions(-) create mode 100644 sw/qa/uitest/writer_tests/data/tdf131936.docx delete mode 100644 sw/qa/uitest/writer_tests7/data/tdf131936.docx (limited to 'sw') diff --git a/sw/UITest_writer_tests7.mk b/sw/UITest_writer_tests7.mk index b6de351eed13..06c50de2d3dc 100644 --- a/sw/UITest_writer_tests7.mk +++ b/sw/UITest_writer_tests7.mk @@ -12,5 +12,5 @@ $(eval $(call gb_UITest_add_modules,writer_tests7,$(SRCDIR)/sw/qa/uitest,\ )) $(eval $(call gb_UITest_set_defs,writer_tests7, \ - TDOC="$(SRCDIR)/sw/qa/uitest/writer_tests7/data" \ + TDOC="$(SRCDIR)/sw/qa/uitest/writer_tests/data" \ )) diff --git a/sw/qa/uitest/chapterNumbering/chapterNumbering.py b/sw/qa/uitest/chapterNumbering/chapterNumbering.py index d7df9062f32d..67e82a40014f 100644 --- a/sw/qa/uitest/chapterNumbering/chapterNumbering.py +++ b/sw/qa/uitest/chapterNumbering/chapterNumbering.py @@ -7,7 +7,6 @@ from uitest.framework import UITestCase from uitest.debug import sleep -from uitest.path import get_srcdir_url from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict, type_text from uitest.uihelper.common import select_pos diff --git a/sw/qa/uitest/findReplace/findReplace.py b/sw/qa/uitest/findReplace/findReplace.py index 1c841c0f0de7..ed302174d19e 100644 --- a/sw/qa/uitest/findReplace/findReplace.py +++ b/sw/qa/uitest/findReplace/findReplace.py @@ -14,7 +14,6 @@ from uitest.uihelper.common import get_state_as_dict, type_text from uitest.debug import sleep import org.libreoffice.unotest import pathlib -from uitest.path import get_srcdir_url def get_url_for_data_file(file_name): return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() diff --git a/sw/qa/uitest/table/tdf115026.py b/sw/qa/uitest/table/tdf115026.py index 610804948086..7e8edcf4260c 100644 --- a/sw/qa/uitest/table/tdf115026.py +++ b/sw/qa/uitest/table/tdf115026.py @@ -6,7 +6,6 @@ # from uitest.framework import UITestCase -from uitest.path import get_srcdir_url from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict diff --git a/sw/qa/uitest/table/tdf135693.py b/sw/qa/uitest/table/tdf135693.py index 31a6a176bb00..d25f396dc91f 100644 --- a/sw/qa/uitest/table/tdf135693.py +++ b/sw/qa/uitest/table/tdf135693.py @@ -1,12 +1,13 @@ # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- from uitest.framework import UITestCase -from uitest.path import get_srcdir_url 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 get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() class tdf135693(UITestCase): diff --git a/sw/qa/uitest/writer_tests/compareDocuments.py b/sw/qa/uitest/writer_tests/compareDocuments.py index 310d9cd7336d..2013fac42bb8 100644 --- a/sw/qa/uitest/writer_tests/compareDocuments.py +++ b/sw/qa/uitest/writer_tests/compareDocuments.py @@ -8,14 +8,14 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # from uitest.framework import UITestCase -from uitest.path import get_srcdir_url from uitest.uihelper.common import get_state_as_dict from libreoffice.uno.propertyvalue import mkPropertyValues import datetime +import org.libreoffice.unotest +import pathlib def get_url_for_data_file(file_name): - return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name - + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() class compareDocuments(UITestCase): diff --git a/sw/qa/uitest/writer_tests/data/tdf131936.docx b/sw/qa/uitest/writer_tests/data/tdf131936.docx new file mode 100644 index 000000000000..f993d6ee327f Binary files /dev/null and b/sw/qa/uitest/writer_tests/data/tdf131936.docx differ diff --git a/sw/qa/uitest/writer_tests/trackedChanges.py b/sw/qa/uitest/writer_tests/trackedChanges.py index 82554aa6aeca..3fa4dd776cfa 100644 --- a/sw/qa/uitest/writer_tests/trackedChanges.py +++ b/sw/qa/uitest/writer_tests/trackedChanges.py @@ -6,14 +6,12 @@ # tests for tracked changes ; tdf912270 from uitest.framework import UITestCase -from uitest.debug import sleep -from uitest.path import get_srcdir_url -import time 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 get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() class trackedchanges(UITestCase): diff --git a/sw/qa/uitest/writer_tests/wordCount.py b/sw/qa/uitest/writer_tests/wordCount.py index 1e43c3fb0fe7..b71656eb2b65 100644 --- a/sw/qa/uitest/writer_tests/wordCount.py +++ b/sw/qa/uitest/writer_tests/wordCount.py @@ -7,12 +7,12 @@ 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 -from uitest.path import get_srcdir_url +import org.libreoffice.unotest +import pathlib def get_url_for_data_file(file_name): - return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() class writerWordCount(UITestCase): diff --git a/sw/qa/uitest/writer_tests2/tdf116474.py b/sw/qa/uitest/writer_tests2/tdf116474.py index e5bb89209835..fe2ed1c488b0 100644 --- a/sw/qa/uitest/writer_tests2/tdf116474.py +++ b/sw/qa/uitest/writer_tests2/tdf116474.py @@ -5,15 +5,14 @@ from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict -import time -from uitest.path import get_srcdir_url -from uitest.debug import sleep 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 get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() class tdf116474(UITestCase): diff --git a/sw/qa/uitest/writer_tests3/insertEnvelope.py b/sw/qa/uitest/writer_tests3/insertEnvelope.py index a7ccb64e55bf..2d6e3ffefbe2 100644 --- a/sw/qa/uitest/writer_tests3/insertEnvelope.py +++ b/sw/qa/uitest/writer_tests3/insertEnvelope.py @@ -6,8 +6,6 @@ # from uitest.framework import UITestCase -from uitest.debug import sleep -from uitest.path import get_srcdir_url from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict, type_text diff --git a/sw/qa/uitest/writer_tests3/insertPageFooter.py b/sw/qa/uitest/writer_tests3/insertPageFooter.py index 94bd3e23e1ce..4bec545965f0 100644 --- a/sw/qa/uitest/writer_tests3/insertPageFooter.py +++ b/sw/qa/uitest/writer_tests3/insertPageFooter.py @@ -6,8 +6,6 @@ # from uitest.framework import UITestCase -from uitest.debug import sleep -from uitest.path import get_srcdir_url class WriterInsertPageFooter(UITestCase): diff --git a/sw/qa/uitest/writer_tests3/lineNumbering.py b/sw/qa/uitest/writer_tests3/lineNumbering.py index 50e48948dade..ad1db1ce0921 100644 --- a/sw/qa/uitest/writer_tests3/lineNumbering.py +++ b/sw/qa/uitest/writer_tests3/lineNumbering.py @@ -6,8 +6,6 @@ # from uitest.framework import UITestCase -from uitest.debug import sleep -from uitest.path import get_srcdir_url from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict, type_text from uitest.uihelper.common import select_pos diff --git a/sw/qa/uitest/writer_tests4/tdf49683.py b/sw/qa/uitest/writer_tests4/tdf49683.py index 3d5af6a71f14..48cd641d39f4 100644 --- a/sw/qa/uitest/writer_tests4/tdf49683.py +++ b/sw/qa/uitest/writer_tests4/tdf49683.py @@ -9,14 +9,13 @@ from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues -from uitest.path import get_srcdir_url from uitest.uihelper.common import get_state_as_dict -import time -from uitest.debug import sleep from uitest.uihelper.common import select_pos +import org.libreoffice.unotest +import pathlib def get_url_for_data_file(file_name): - return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() class tdf49683(UITestCase): @@ -35,4 +34,4 @@ class tdf49683(UITestCase): self.ui_test.close_doc() -# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/uitest/writer_tests5/tdf107494.py b/sw/qa/uitest/writer_tests5/tdf107494.py index 0828e26bfbd1..72d32f439eca 100644 --- a/sw/qa/uitest/writer_tests5/tdf107494.py +++ b/sw/qa/uitest/writer_tests5/tdf107494.py @@ -10,11 +10,11 @@ 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 -from uitest.path import get_srcdir_url +import org.libreoffice.unotest +import pathlib def get_url_for_data_file(file_name): - return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + 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_tests6/tdf126627.py b/sw/qa/uitest/writer_tests6/tdf126627.py index dcce155b3454..4ba4f17d9a9b 100644 --- a/sw/qa/uitest/writer_tests6/tdf126627.py +++ b/sw/qa/uitest/writer_tests6/tdf126627.py @@ -11,10 +11,9 @@ 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 -from uitest.path import get_srcdir_url + def get_url_for_data_file(file_name): return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() diff --git a/sw/qa/uitest/writer_tests7/data/tdf131936.docx b/sw/qa/uitest/writer_tests7/data/tdf131936.docx deleted file mode 100644 index f993d6ee327f..000000000000 Binary files a/sw/qa/uitest/writer_tests7/data/tdf131936.docx and /dev/null differ diff --git a/sw/qa/uitest/writer_tests7/tdf131936.py b/sw/qa/uitest/writer_tests7/tdf131936.py index 5d2de2c3a697..97b9192c3b30 100644 --- a/sw/qa/uitest/writer_tests7/tdf131936.py +++ b/sw/qa/uitest/writer_tests7/tdf131936.py @@ -5,12 +5,13 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from libreoffice.uno.propertyvalue import mkPropertyValues -from uitest.path import get_srcdir_url from uitest.config import DEFAULT_SLEEP import time +import org.libreoffice.unotest +import pathlib def get_url_for_data_file(file_name): - return get_srcdir_url() + "/sw/qa/uitest/writer_tests7/data/" + 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 97cebcc4cedc..853de13375b5 100644 --- a/sw/qa/uitest/writer_tests7/tdf131963.py +++ b/sw/qa/uitest/writer_tests7/tdf131963.py @@ -7,10 +7,11 @@ from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict -from uitest.path import get_srcdir_url +import org.libreoffice.unotest +import pathlib def get_url_for_data_file(file_name): - return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() class tdf131963(UITestCase): diff --git a/sw/qa/uitest/writer_tests7/tdf132169.py b/sw/qa/uitest/writer_tests7/tdf132169.py index 78487a00c2f8..3ac183c6578d 100644 --- a/sw/qa/uitest/writer_tests7/tdf132169.py +++ b/sw/qa/uitest/writer_tests7/tdf132169.py @@ -5,13 +5,14 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # from uitest.framework import UITestCase -from uitest.path import get_srcdir_url from uitest.uihelper.common import get_state_as_dict, 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 get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + 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 6cfbf5e94be2..4c2b9bc3745f 100644 --- a/sw/qa/uitest/writer_tests7/tdf132596.py +++ b/sw/qa/uitest/writer_tests7/tdf132596.py @@ -7,10 +7,11 @@ from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict -from uitest.path import get_srcdir_url +import org.libreoffice.unotest +import pathlib def get_url_for_data_file(file_name): - return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() class tdf132596(UITestCase): diff --git a/sw/qa/uitest/writer_tests7/tdf132597.py b/sw/qa/uitest/writer_tests7/tdf132597.py index 60ec581095fd..0bc2116779ff 100644 --- a/sw/qa/uitest/writer_tests7/tdf132597.py +++ b/sw/qa/uitest/writer_tests7/tdf132597.py @@ -7,10 +7,11 @@ from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict -from uitest.path import get_srcdir_url +import org.libreoffice.unotest +import pathlib def get_url_for_data_file(file_name): - return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() class tdf132597(UITestCase): diff --git a/sw/qa/uitest/writer_tests7/tdf134243.py b/sw/qa/uitest/writer_tests7/tdf134243.py index 49faa4bbb1bd..2cb66e8e4b9f 100644 --- a/sw/qa/uitest/writer_tests7/tdf134243.py +++ b/sw/qa/uitest/writer_tests7/tdf134243.py @@ -5,10 +5,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # from uitest.framework import UITestCase -from uitest.path import get_srcdir_url +import org.libreoffice.unotest +import pathlib def get_url_for_data_file(file_name): - return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() class tdf134243(UITestCase): diff --git a/sw/qa/uitest/writer_tests7/tdf99711.py b/sw/qa/uitest/writer_tests7/tdf99711.py index e99f38cc60b1..140372bc0b63 100644 --- a/sw/qa/uitest/writer_tests7/tdf99711.py +++ b/sw/qa/uitest/writer_tests7/tdf99711.py @@ -5,13 +5,14 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # from uitest.framework import UITestCase -from uitest.path import get_srcdir_url from uitest.uihelper.common import get_state_as_dict 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 get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() class tdf99711(UITestCase): def test_tdf99711(self): -- cgit