[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2023-11-02 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/run.py |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 149aa9a75e9d6950e80ea64e479655e500fb91be
Author: Xisco Fauli 
AuthorDate: Thu Nov 2 21:09:13 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Nov 2 21:09:13 2023 +0100

mass-testing: remove --debug argument

Since aa95913dd8e505123ba8974d5de27ac0ec928cce "uitest: remove debug
option"

Change-Id: Ib2796bff1d158551864166605df477856420a87b

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index 595bc02b..424c8214 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -115,7 +115,6 @@ def launchLibreOffice(logger, fileName, sofficePath, 
component, countInfo, isDeb
 
 process = Popen(["python3",
 './uitest/test_main.py',
-"--debug",
 "--soffice=path:" + sofficePath,
 "--userdir=file://" + profilePath,
 "--file=" + component + ".py"], stdin=PIPE, stdout=PIPE, 
stderr=PIPE,


[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2023-06-02 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/calc.py |  156 +---
 uitest/mass-testing/run.py  |1 
 2 files changed, 117 insertions(+), 40 deletions(-)

New commits:
commit 0225e909b8c8da089c1bbe2f6b4f162dd6d46188
Author: Xisco Fauli 
AuthorDate: Fri Jun 2 12:28:47 2023 +0200
Commit: Xisco Fauli 
CommitDate: Fri Jun 2 12:29:58 2023 +0200

mass-uitesting: improve calc tests

make use of states added in 30391deaf6e1726450378bbe5d320bfbbd213abf
"uitest: sc: check whether current row/column/table has data"

Change-Id: Ic575c19f09dac445fc1f1d7f32688e6787fb2e17

diff --git a/uitest/mass-testing/calc.py b/uitest/mass-testing/calc.py
index ed11b826..8b9f3bbc 100755
--- a/uitest/mass-testing/calc.py
+++ b/uitest/mass-testing/calc.py
@@ -7,6 +7,7 @@
 import os
 import signal
 from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from contextlib import contextmanager
 
@@ -44,7 +45,7 @@ class massTesting(UITestCase):
 document = self.ui_test.get_component()
 nrSheets = document.Sheets.getCount()  #number of sheets in the 
document
 #go to first sheet
-for i in range(nrSheets - 1):
+for sheet in range(nrSheets - 1):
 self.xUITest.executeCommand(".uno:JumpToPrevTable")
 
 #Just in case more than 1 sheet is selected
@@ -63,43 +64,69 @@ class massTesting(UITestCase):
 with self.load_file() as xEdit:
 nrSheets = self.go_to_first_sheet()
 
-for i in range(nrSheets)[:maxSheets]:
-self.xUITest.executeCommand(".uno:SelectAll")
-xEdit.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"DELETE"}))
+document = self.ui_test.get_component()
+for sheet in range(nrSheets)[:maxSheets]:
+if not document.Sheets[sheet].isProtected() and \
+get_state_as_dict(xEdit)["CurrentTableHasData"] == 
"true":
+self.xUITest.executeCommand(".uno:SelectAll")
+xEdit.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"DELETE"}))
+
+self.xUITest.executeCommand(".uno:Undo")
 
-self.xUITest.executeCommand(".uno:Undo")
 self.xUITest.executeCommand(".uno:JumpToNextTable")
 
 def test_insert_column_and_undo(self):
 with self.load_file() as xEdit:
 nrSheets = self.go_to_first_sheet()
 
-for i in range(nrSheets)[:maxSheets]:
-self.xUITest.executeCommand(".uno:InsertColumnsBefore")
-self.xUITest.executeCommand(".uno:Undo")
+document = self.ui_test.get_component()
+for sheet in range(nrSheets)[:maxSheets]:
+if not document.Sheets[sheet].isProtected() and \
+get_state_as_dict(xEdit)["CurrentTableHasData"] == 
"true":
+for column in range(10):
+if get_state_as_dict(xEdit)["CurrentColumnHasData"] == 
"true":
+
self.xUITest.executeCommand(".uno:InsertColumnsBefore")
+self.xUITest.executeCommand(".uno:Undo")
+
self.xUITest.executeCommand(".uno:InsertColumnsAfter")
+self.xUITest.executeCommand(".uno:Undo")
+
+self.xUITest.executeCommand(".uno:GoRight")
+
 self.xUITest.executeCommand(".uno:JumpToNextTable")
 
 def test_insert_row_and_undo(self):
 with self.load_file() as xEdit:
 nrSheets = self.go_to_first_sheet()
+document = self.ui_test.get_component()
+for sheet in range(nrSheets)[:maxSheets]:
+if not document.Sheets[sheet].isProtected() and \
+get_state_as_dict(xEdit)["CurrentTableHasData"] == 
"true":
+for row in range(10):
+if get_state_as_dict(xEdit)["CurrentRowHasData"] == 
"true":
+
self.xUITest.executeCommand(".uno:InsertRowsBefore")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:InsertRowsAfter")
+self.xUITest.executeCommand(".uno:Undo")
+
+self.xUITest.executeCommand(".uno:GoDown")
 
-for i in range(nrSheets)[:maxSheets]:
-self.xUITest.executeCommand(".uno:InsertRowsBefore")
-self.xUITest.executeCommand(".uno:Undo")
 self.xUITest.executeCommand(".uno:JumpToNextTable")
 
-def test_copy_all_paste_undo(self):
+def xtest_copy_all_paste_undo(self):
 with self.load_file() as xEdit:
 nrSheets = self.go_to_first_sheet()
 
-for i in range(nrSheets)[:maxSheets]:
-self.xUITest.executeCommand(".uno:SelectAll")
+  

[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2023-03-08 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/run.py |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 2d29d88af7bd400840a244a9134e2146a33d56ec
Author: Xisco Fauli 
AuthorDate: Wed Mar 8 12:14:01 2023 +0100
Commit: Xisco Fauli 
CommitDate: Wed Mar 8 12:15:16 2023 +0100

mass-testing: handle ProcessLookupError

and just use half of the cpus, which seems to be more stable

Change-Id: Ib1a938bb021c86e715d017f3cdd2623e5a8db11e

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index 1f6b884d..35485fc8 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -46,7 +46,10 @@ def kill_soffice():
 if b'soffice' in line:
 pid = int(line.split(None, 1)[0])
 print("Killing process: " + str(pid))
-os.kill(pid, signal.SIGKILL)
+try:
+os.kill(pid, signal.SIGKILL)
+except ProcessLookupError:
+pass
 
 # Also clean leftovers in /tmp
 for filename in glob.glob("/tmp/OSL_PIPE_*"):
@@ -206,7 +209,8 @@ def run_tests_and_get_results(sofficePath, listFiles, 
isDebug):
 previousLog = file.read()
 
 kill_soffice()
-cpuCount = multiprocessing.cpu_count() #use all CPUs
+cpuCount = int(multiprocessing.cpu_count() / 2) #Use half of the CPUs
+print(cpuCount)
 chunkSplit = cpuCount * 16
 chunks = [listFiles[x:x+chunkSplit] for x in range(0, len(listFiles), 
chunkSplit)]
 totalCount = len(listFiles)


[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2022-06-24 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/run.py |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit f00b7b25d3ffa7ce22c421f95304790668aaf94f
Author: Xisco Fauli 
AuthorDate: Fri Jun 24 10:57:30 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Jun 24 10:57:54 2022 +0200

mass-testing: fix removal of files and folders

Change-Id: I5604fe254049f96635560ffa9b2663edbbd8c74e

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index 69cf3cb..1f6b884 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -53,7 +53,10 @@ def kill_soffice():
 os.remove(filename)
 
 for filename in glob.glob("/tmp/lu*.tmp"):
-shutil.rmtree(filename)
+if os.path.isfile(filename):
+os.remove(filename)
+else:
+shutil.rmtree(filename)
 
 def start_logger(name):
 rootLogger = logging.getLogger()


[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2022-06-14 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/calc.py |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit d9956b1c24f5b8947ae9f1c544330cea497cdb7c
Author: Xisco Fauli 
AuthorDate: Wed Jun 15 07:29:50 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed Jun 15 07:30:55 2022 +0200

mass-testing: just copy and undo once

Otherwise, it might cause memory problems with some sheets

Change-Id: I5ac0f45c8b15833453ec1fe5ce39607d1f749f40

diff --git a/uitest/mass-testing/calc.py b/uitest/mass-testing/calc.py
index 580a99a..ed11b82 100755
--- a/uitest/mass-testing/calc.py
+++ b/uitest/mass-testing/calc.py
@@ -97,11 +97,9 @@ class massTesting(UITestCase):
 
 self.xUITest.executeCommand(".uno:Copy")
 
-for i in range(5):
-self.xUITest.executeCommand(".uno:Paste")
+self.xUITest.executeCommand(".uno:Paste")
 
-for i in range(5):
-self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:Undo")
 
 self.xUITest.executeCommand(".uno:JumpToNextTable")
 


[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2022-05-26 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/run.py |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit a057dfd38d8309e15499370f5a23eb9a6a824da8
Author: Xisco Fauli 
AuthorDate: Thu May 26 11:32:13 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu May 26 11:32:13 2022 +0200

mass-testing: use magic to ignore csv files

Change-Id: I4c3b85acc7b7dbbb1fe11c70ab6d564dd799cb2b

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index 7bf4967..69cf3cb 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -17,6 +17,7 @@ from shutil import copyfile
 import time
 import fcntl
 import tempfile
+import magic
 import multiprocessing
 from multiprocessing_logging import install_mp_handler
 
@@ -74,7 +75,13 @@ def get_file_names(filesPath):
 for key, val in extensions.items():
 extension = os.path.splitext(fileName)[1][1:]
 if extension in val:
-auxNames.append("file:///" + filesPath + fileName)
+fullName = filesPath + fileName
+mimetype = magic.from_file(fullName, mime=True)
+
+# Ignore CSV files since they prompt the CSV import dialog
+if mimetype == "application/csv":
+continue
+auxNames.append("file:///" + fullName)
 
 #Remove previous lock files
 lockFilePath = filesPath + '.~lock.' + fileName + '#'


[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2022-05-26 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/calc.py|   11 +++
 uitest/mass-testing/impress.py |   11 +++
 uitest/mass-testing/writer.py  |   12 
 3 files changed, 34 insertions(+)

New commits:
commit 74c3fe7017ca1eecba1b8524ff8234b6c63b0fd0
Author: Xisco Fauli 
AuthorDate: Wed May 25 13:51:59 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu May 26 10:39:21 2022 +0200

mass-testing: Add tests for the sidebar

In order to find bugs like tdf#149268

Change-Id: I799fcfc4bc6ac92126d97ceab747187ac5065bf2

diff --git a/uitest/mass-testing/calc.py b/uitest/mass-testing/calc.py
index 6b9c5c5..580a99a 100755
--- a/uitest/mass-testing/calc.py
+++ b/uitest/mass-testing/calc.py
@@ -212,4 +212,15 @@ class massTesting(UITestCase):
 
 self.xUITest.executeCommand(".uno:JumpToNextTable")
 
+def test_sidebar(self):
+with self.load_file() as xEdit:
+self.xUITest.executeCommand(".uno:Sidebar")
+
+panels = [ "TextPropertyPanel", "StyleListPanel", "GalleryPanel", 
"ScNavigatorPanel", "ScFunctionsPanel" ]
+
+for panel in panels:
+xEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": 
panel}))
+
+self.xUITest.executeCommand(".uno:Sidebar")
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/uitest/mass-testing/impress.py b/uitest/mass-testing/impress.py
index 7ffc3de..a885d0a 100755
--- a/uitest/mass-testing/impress.py
+++ b/uitest/mass-testing/impress.py
@@ -93,4 +93,15 @@ class massTesting(UITestCase):
 
 self.xUITest.executeCommand(".uno:Undo")
 
+def test_sidebar(self):
+with self.load_file() as xEdit:
+# The sidebar is already displayed
+
+panels = [ "TextPropertyPanel", "StyleListPanel", "GalleryPanel",
+"SdNavigatorPanel", "DefaultShapesPanel", 
"SdSlideTransitionPanel",
+"SdCustomAnimationPanel", "SdAllMasterPagesPanel" ]
+
+for panel in panels:
+xEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": 
panel}))
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/uitest/mass-testing/writer.py b/uitest/mass-testing/writer.py
index 3d84770..83ead78 100755
--- a/uitest/mass-testing/writer.py
+++ b/uitest/mass-testing/writer.py
@@ -86,4 +86,16 @@ class massTesting(UITestCase):
 for i in range(pageCount):
 xEdit.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"PAGEUP"}))
 
+def test_sidebar(self):
+with self.load_file() as xEdit:
+self.xUITest.executeCommand(".uno:Sidebar")
+
+panels = [ "TextPropertyPanel", "StyleListPanel", "GalleryPanel",
+"SwNavigatorPanel", "PageFormatPanel", 
"InspectorTextPanel", "SwManageChangesPanel" ]
+
+for panel in panels:
+xEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": 
panel}))
+
+self.xUITest.executeCommand(".uno:Sidebar")
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2022-03-09 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/run.py |9 +
 1 file changed, 9 insertions(+)

New commits:
commit e203e20e5d64408bc5fbcbba6866343f9198baeb
Author: Xisco Fauli 
AuthorDate: Wed Mar 9 16:40:27 2022 +0100
Commit: Xisco Fauli 
CommitDate: Wed Mar 9 16:40:27 2022 +0100

mass-testing: clean leftovers in tmp regularly

Change-Id: I7fccb96b56e3dded851492edd5b90a65fdb19c29

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index af1b47d..7bf4967 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -7,6 +7,8 @@
 
 import os
 import argparse
+import glob
+import shutil
 from subprocess import Popen, PIPE, TimeoutExpired
 import sys
 import signal
@@ -45,6 +47,13 @@ def kill_soffice():
 print("Killing process: " + str(pid))
 os.kill(pid, signal.SIGKILL)
 
+# Also clean leftovers in /tmp
+for filename in glob.glob("/tmp/OSL_PIPE_*"):
+os.remove(filename)
+
+for filename in glob.glob("/tmp/lu*.tmp"):
+shutil.rmtree(filename)
+
 def start_logger(name):
 rootLogger = logging.getLogger()
 rootLogger.setLevel(os.environ.get("LOGLEVEL", "INFO"))


[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2022-01-25 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/registrymodifications.xcu |1 +
 1 file changed, 1 insertion(+)

New commits:
commit fa743edde732847dc8fe237f53c55b408bbc367e
Author: Xisco Fauli 
AuthorDate: Tue Jan 25 20:12:56 2022 +0100
Commit: Xisco Fauli 
CommitDate: Tue Jan 25 20:12:56 2022 +0100

mass-testing: disable ReplaceCellsWarning

Change-Id: If33c42b72f638cbe6f1a80342be98de91d263391

diff --git a/uitest/mass-testing/registrymodifications.xcu 
b/uitest/mass-testing/registrymodifications.xcu
index f992e48..55c7228 100644
--- a/uitest/mass-testing/registrymodifications.xcu
+++ b/uitest/mass-testing/registrymodifications.xcu
@@ -15,4 +15,5 @@
 true
 false
 false
+false
 


[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2022-01-25 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/calc.py|   94 +
 uitest/mass-testing/impress.py |   54 +--
 uitest/mass-testing/run.py |8 +++
 uitest/mass-testing/writer.py  |   60 +-
 4 files changed, 80 insertions(+), 136 deletions(-)

New commits:
commit 440b0829fbc323910644b93b395b14392984b2c9
Author: Xisco Fauli 
AuthorDate: Tue Jan 25 18:32:25 2022 +0100
Commit: Xisco Fauli 
CommitDate: Tue Jan 25 20:10:11 2022 +0100

mass-testing: Adapt code to new uitest code

Change-Id: Iee0161d1e404436fb3a23a740ecb2418eb5caaf5

diff --git a/uitest/mass-testing/calc.py b/uitest/mass-testing/calc.py
index b8c1879..6b9c5c5 100755
--- a/uitest/mass-testing/calc.py
+++ b/uitest/mass-testing/calc.py
@@ -8,40 +8,37 @@ import os
 import signal
 from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
-import time
+from contextlib import contextmanager
 
 #Max number of sheets to jump to
 maxSheets = 10
 
 class massTesting(UITestCase):
 
+@contextmanager
 def load_file(self):
 #TODO: Ignore password protected files
 
 fileName = os.environ["TESTFILENAME"]
 
-self.ui_test.create_doc_in_start_center("calc")
+with self.ui_test.load_file(fileName) as document:
 
-self.ui_test.load_file(fileName)
-document = self.ui_test.get_component()
-
-
-# Ignore read-only or protected files
-if not hasattr(document, 'isReadonly') or document.isReadonly() or 
document.isProtected():
-print("mass-uitesting:skipped", flush=True)
-return
+# Ignore read-only or protected files
+if not hasattr(document, 'isReadonly') or document.isReadonly() or 
document.isProtected():
+print("mass-uitesting:skipped", flush=True)
+raise
 
-try:
-xDoc = self.xUITest.getTopFocusWindow()
-xEdit = xDoc.getChild("grid_window")
-except:
-#In case the mimetype is wrong and the file is open with another 
component
-print("mass-uitesting:skipped", flush=True)
-return
+try:
+xDoc = self.xUITest.getTopFocusWindow()
+xEdit = xDoc.getChild("grid_window")
+except:
+#In case the mimetype is wrong and the file is open with 
another component
+print("mass-uitesting:skipped", flush=True)
+raise
 
-print("mass-uitesting:loaded", flush=True)
+print("mass-uitesting:loaded", flush=True)
 
-return xEdit
+yield xEdit
 
 def go_to_first_sheet(self):
 document = self.ui_test.get_component()
@@ -63,8 +60,7 @@ class massTesting(UITestCase):
 return nrSheets
 
 def test_remove_all_and_undo(self):
-xEdit = self.load_file()
-if xEdit:
+with self.load_file() as xEdit:
 nrSheets = self.go_to_first_sheet()
 
 for i in range(nrSheets)[:maxSheets]:
@@ -74,11 +70,8 @@ class massTesting(UITestCase):
 self.xUITest.executeCommand(".uno:Undo")
 self.xUITest.executeCommand(".uno:JumpToNextTable")
 
-self.ui_test.close_doc()
-
 def test_insert_column_and_undo(self):
-xEdit = self.load_file()
-if xEdit:
+with self.load_file() as xEdit:
 nrSheets = self.go_to_first_sheet()
 
 for i in range(nrSheets)[:maxSheets]:
@@ -86,11 +79,8 @@ class massTesting(UITestCase):
 self.xUITest.executeCommand(".uno:Undo")
 self.xUITest.executeCommand(".uno:JumpToNextTable")
 
-self.ui_test.close_doc()
-
 def test_insert_row_and_undo(self):
-xEdit = self.load_file()
-if xEdit:
+with self.load_file() as xEdit:
 nrSheets = self.go_to_first_sheet()
 
 for i in range(nrSheets)[:maxSheets]:
@@ -98,11 +88,8 @@ class massTesting(UITestCase):
 self.xUITest.executeCommand(".uno:Undo")
 self.xUITest.executeCommand(".uno:JumpToNextTable")
 
-self.ui_test.close_doc()
-
 def test_copy_all_paste_undo(self):
-xEdit = self.load_file()
-if xEdit:
+with self.load_file() as xEdit:
 nrSheets = self.go_to_first_sheet()
 
 for i in range(nrSheets)[:maxSheets]:
@@ -118,11 +105,8 @@ class massTesting(UITestCase):
 
 self.xUITest.executeCommand(".uno:JumpToNextTable")
 
-self.ui_test.close_doc()
-
 def test_print_preview(self):
-xEdit = self.load_file()
-if xEdit:
+with self.load_file() as xEdit:
 nrSheets = self.go_to_first_sheet()
 
 for i in range(nrSheets)[:maxSheets]:
@@ -132,11 +116,8 @@ class massTesting(UITestCase):
 
 self.xUITest.getTopFocusWindow()
 
-self.ui_test.close_doc()
-
 def 

[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2020-06-22 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/run.py |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1b58aeda6b26a57fde7893594a949d88921b1656
Author: Xisco Fauli 
AuthorDate: Mon Jun 22 21:47:59 2020 +0200
Commit: Xisco Fauli 
CommitDate: Mon Jun 22 21:48:38 2020 +0200

mass-uitesting: increase timeout interval and reduce sleep time

Change-Id: Idd8e24376cb4956cf274ef9b24fef2bdc90557ae

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index a10f82f..3acd8bc 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -105,12 +105,12 @@ def launchLibreOffice(logger, fileName, sofficePath, 
component, countInfo, isDeb
 # Kill the process if:
 # 1. The file can't be loaded in 'fileInterval' seconds
 # 2. The test can't be executed in 'testInterval' seconds
-fileInterval = 20
+fileInterval = 30
 testInterval = 20
 timeout = time.time() + fileInterval
 notLoaded = True
 while True:
-time.sleep(1)
+time.sleep(0.1)
 
 if time.time() > timeout:
 if notLoaded:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2020-06-16 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/writer.py |4 
 1 file changed, 4 insertions(+)

New commits:
commit 53d7d6165feab6e3fdb10cac0fde93e3a2a90f7b
Author: Xisco Fauli 
AuthorDate: Tue Jun 16 09:33:16 2020 +0200
Commit: Xisco Fauli 
CommitDate: Tue Jun 16 09:33:16 2020 +0200

mass-uitesting: use select all three times

Change-Id: I0f2c263784203e527f72e59f037e7d5c4aaa814a

diff --git a/uitest/mass-testing/writer.py b/uitest/mass-testing/writer.py
index 104e4c7..9f93ed8 100755
--- a/uitest/mass-testing/writer.py
+++ b/uitest/mass-testing/writer.py
@@ -42,6 +42,8 @@ class massTesting(UITestCase):
 def test_remove_all_and_undo(self):
 xEdit = self.load_file()
 if xEdit:
+self.xUITest.executeCommand(".uno:SelectAll")
+self.xUITest.executeCommand(".uno:SelectAll")
 self.xUITest.executeCommand(".uno:SelectAll")
 xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DELETE"}))
 
@@ -75,6 +77,8 @@ class massTesting(UITestCase):
 xEdit = self.load_file()
 if xEdit:
 self.xUITest.executeCommand(".uno:SelectAll")
+self.xUITest.executeCommand(".uno:SelectAll")
+self.xUITest.executeCommand(".uno:SelectAll")
 
 self.xUITest.executeCommand(".uno:Copy")
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2020-05-12 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/run.py |   24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

New commits:
commit deb8069cb7b5110b6eb59e87df8e5b789fabde77
Author: Xisco Fauli 
AuthorDate: Tue May 12 13:03:46 2020 +0200
Commit: Xisco Fauli 
CommitDate: Tue May 12 13:03:46 2020 +0200

mass-uitesting: fix uitest and soffice pathes

so it can be executed without having the whole LibreOffice codebase

Change-Id: I795ac5b9736e1b5ab90bea011f41b01d28f11c4a

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index 7f9efab..92cf32e 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -61,7 +61,7 @@ def get_file_names(filesPath):
 
 return auxNames
 
-def run_tests_and_get_results(liboPath, listFiles, isDebug, isResume):
+def run_tests_and_get_results(sofficePath, listFiles, isDebug, isResume):
 
 results = {
 'pass' : 0,
@@ -69,7 +69,6 @@ def run_tests_and_get_results(liboPath, listFiles, isDebug, 
isResume):
 'timeout' : 0,
 'skip' : 0}
 
-sofficePath = liboPath + "instdir/program/soffice"
 process = Popen([sofficePath, "--version"], stdout=PIPE, stderr=PIPE)
 stdout = process.communicate()[0].decode("utf-8")
 sourceHash = stdout.split(" ")[2].strip()
@@ -121,7 +120,7 @@ def run_tests_and_get_results(liboPath, listFiles, isDebug, 
isResume):
 os.environ["TESTFILENAME"] = fileName
 
 process = Popen(["python3",
-liboPath + "uitest/test_main.py",
+'./uitest/test_main.py',
 "--debug",
 "--soffice=path:" + sofficePath,
 "--userdir=file://" + profilePath,
@@ -225,6 +224,13 @@ def run_tests_and_get_results(liboPath, listFiles, 
isDebug, isResume):
 print("No test run!")
 
 if __name__ == '__main__':
+currentPath = os.path.dirname(os.path.realpath(__file__))
+uitestPath = os.path.join(currentPath, 'uitest/test_main.py')
+if not os.path.exists(uitestPath):
+print("ERROR: " + uitestPath + " doesn't exists. " + \
+"Copy uitest folder from LibreOffice codebase and paste it 
here")
+sys.exit(1)
+
 parser = DefaultHelpParser()
 
 parser.add_argument(
@@ -242,12 +248,12 @@ if __name__ == '__main__':
 if not os.path.exists(filesPath):
 parser.error(filesPath + " is an invalid directory path")
 
-liboPath = os.path.join(argument.soffice, '')
-if not os.path.exists(liboPath) or not os.path.exists(liboPath + 
"instdir/program/"):
-parser.error(liboPath + " is an invalid LibreOffice path")
+sofficePath = argument.soffice
+if not os.path.exists(sofficePath) or not sofficePath.endswith('/soffice'):
+parser.error(sofficePath + " is an invalid LibreOffice path")
 
-os.environ["PYTHONPATH"] = liboPath + "instdir/program/"
-os.environ["URE_BOOTSTRAP"] = "file://" + liboPath + 
"instdir/program/fundamentalrc"
+os.environ["PYTHONPATH"] = sofficePath.split('/soffice')[0]
+os.environ["URE_BOOTSTRAP"] = "file://" + sofficePath.split('/soffice')[0] 
+ '/fundamentalrc'
 os.environ["SAL_USE_VCLPLUGIN"] = "gen"
 
 if not os.path.exists('./logs'):
@@ -258,6 +264,6 @@ if __name__ == '__main__':
 listFiles = get_file_names(filesPath)
 listFiles.sort()
 
-run_tests_and_get_results(liboPath, listFiles, argument.debug, 
argument.resume)
+run_tests_and_get_results(sofficePath, listFiles, argument.debug, 
argument.resume)
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2019-07-03 Thread Artur Neumann (via logerrit)
 uitest/mass-testing/run.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 864307a03f5b3f60362994d02de8fcc2e636c078
Author: Artur Neumann 
AuthorDate: Wed Jul 3 20:24:19 2019 +0545
Commit: Xisco Faulí 
CommitDate: Wed Jul 3 16:45:36 2019 +0200

mass-uitesting: fix typo in comment

Change-Id: I4b97b06b4c86d081e562bea70ad53972980deb12
Reviewed-on: https://gerrit.libreoffice.org/75050
Reviewed-by: Xisco Faulí 
Tested-by: Xisco Faulí 

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index 0c20706..3d5bf28 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -125,7 +125,7 @@ def run_tests_and_get_results(liboPath, listFiles, isDebug, 
isResume):
 fcntl.fcntl(process.stdout.fileno(), fcntl.F_SETFL, os.O_NONBLOCK)
 
 # Kill the process if:
-# 1. The file can't be loaded in 'fielInterval' seconds
+# 1. The file can't be loaded in 'fileInterval' seconds
 # 2. The test can't be executed in 'testInterval' seconds
 fileInterval = 10
 testIternval = 20
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2019-04-29 Thread Libreoffice Gerrit user
 uitest/mass-testing/calc.py |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit a76301ebdcfe1bf4ecf61ff5e24d993d7fd02265
Author: Xisco Fauli 
AuthorDate: Mon Apr 29 15:03:16 2019 +0200
Commit: Xisco Fauli 
CommitDate: Mon Apr 29 15:03:16 2019 +0200

mass-uitesting: deselect all sheets before using hide/show

diff --git a/uitest/mass-testing/calc.py b/uitest/mass-testing/calc.py
index a6911ad..f26591d 100755
--- a/uitest/mass-testing/calc.py
+++ b/uitest/mass-testing/calc.py
@@ -50,6 +50,9 @@ class massTesting(UITestCase):
 for i in range(nrSheets - 1):
 self.xUITest.executeCommand(".uno:JumpToPrevTable")
 
+#Just in case more than 1 sheet is selected
+self.xUITest.executeCommand(".uno:TableDeselectAll")
+
 # Make sure all sheets are visible
 self.xUITest.executeCommand(".uno:Hide")
 self.xUITest.executeCommand(".uno:Show")
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2019-04-23 Thread Libreoffice Gerrit user
 uitest/mass-testing/calc.py |   84 
 1 file changed, 84 insertions(+)

New commits:
commit 9c71cc5c9e35060e153e026289edf89b09bb8303
Author: Zdeněk Crhonek 
AuthorDate: Sun Apr 21 21:42:31 2019 +0200
Commit: Xisco Faulí 
CommitDate: Tue Apr 23 14:26:59 2019 +0200

mass-uitesting: Add more Calc tests

Change-Id: Ie22d88160ec39170de2e5c4540d19ef8489aec85
Reviewed-on: https://gerrit.libreoffice.org/71044
Reviewed-by: Xisco Faulí 
Tested-by: Xisco Faulí 

diff --git a/uitest/mass-testing/calc.py b/uitest/mass-testing/calc.py
index 7217c3a..91bd21b 100755
--- a/uitest/mass-testing/calc.py
+++ b/uitest/mass-testing/calc.py
@@ -108,4 +108,88 @@ class massTesting(UITestCase):
 
 self.ui_test.close_doc()
 
+def test_copy_sheet_undo_delete_sheet(self):
+xEdit = self.load_file()
+if xEdit:
+document = self.ui_test.get_component()
+nrSheets = document.Sheets.getCount()  #number of sheets in the 
document
+if nrSheets == 1:
+#copy sheet and undo
+self.ui_test.execute_dialog_through_command(".uno:Move")
+xDialog = self.xUITest.getTopFocusWindow()
+xOKBtn = xDialog.getChild("ok")
+self.ui_test.close_dialog_through_button(xOKBtn)
+self.assertEqual(document.Sheets.getCount(), 2)
+self.xUITest.executeCommand(".uno:Undo")
+else:
+#copy sheet and undo and delete
+#go to first sheet
+for i in range(nrSheets - 1):
+self.xUITest.executeCommand(".uno:JumpToPrevTable")
+#copy sheet; delete sheet
+for i in range(nrSheets - 1):
+self.ui_test.execute_dialog_through_command(".uno:Move")
+xDialog = self.xUITest.getTopFocusWindow()
+xCopy = xDialog.getChild("copy")
+xCopy.executeAction("CLICK", tuple())
+xOKBtn = xDialog.getChild("ok")
+self.ui_test.close_dialog_through_button(xOKBtn)
+
+self.xUITest.executeCommand(".uno:Undo")
+
+self.ui_test.execute_dialog_through_command(".uno:Remove") 
 #delete sheet
+xDialog = self.xUITest.getTopFocusWindow()
+xOKButton = xDialog.getChild("yes")
+xOKButton.executeAction("CLICK", tuple())
+
+self.assertEqual(document.Sheets.getCount(), 1)
+
+self.ui_test.close_doc()
+
+def test_change_text_formatting_and_undo(self):
+xEdit = self.load_file()
+if xEdit:
+self.xUITest.executeCommand(".uno:SelectAll")
+self.xUITest.executeCommand(".uno:Bold")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:Italic")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:Underline")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:UnderlineDouble")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:Strikeout")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:Overline")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:SuperScript")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:SubScript")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:Shadowed")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:OutlineFont")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:Grow")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:Shrink")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:ChangeCaseToUpper")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:ChangeCaseToLower")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:ChangeCaseRotateCase")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:ChangeCaseToSentenceCase")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:ChangeCaseToToggleCase")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:SmallCaps")
+self.xUITest.executeCommand(".uno:Undo")
+

[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2019-04-19 Thread Libreoffice Gerrit user
 uitest/mass-testing/calc.py |   24 
 1 file changed, 24 insertions(+)

New commits:
commit 64dedad18581fffc255e4fbd88bea6f837f5cf2c
Author: Zdeněk Crhonek 
AuthorDate: Fri Apr 19 17:09:59 2019 +0200
Commit: Xisco Faulí 
CommitDate: Fri Apr 19 18:54:07 2019 +0200

mass-uitesting: Add more Calc tests

Change-Id: Ie33c78ccc8444b5afda825a62471554355143b18
Reviewed-on: https://gerrit.libreoffice.org/70985
Reviewed-by: Xisco Faulí 
Tested-by: Xisco Faulí 

diff --git a/uitest/mass-testing/calc.py b/uitest/mass-testing/calc.py
index 14383a9..7aaa190 100755
--- a/uitest/mass-testing/calc.py
+++ b/uitest/mass-testing/calc.py
@@ -82,4 +82,28 @@ class massTesting(UITestCase):
 
 self.ui_test.close_doc()
 
+def test_print_preview(self):
+xEdit = self.load_file()
+if xEdit:
+self.xUITest.executeCommand(".uno:PrintPreview")  #open print 
preview
+self.xUITest.executeCommand(".uno:ClosePreview")  # close print 
preview
+
+self.ui_test.close_doc()
+
+def test_hide_column_and_undo(self):
+xEdit = self.load_file()
+if xEdit:
+self.xUITest.executeCommand(".uno:HideColumn")
+self.xUITest.executeCommand(".uno:Undo")
+
+self.ui_test.close_doc()
+
+def test_hide_row_and_undo(self):
+xEdit = self.load_file()
+if xEdit:
+self.xUITest.executeCommand(".uno:HideRow")
+self.xUITest.executeCommand(".uno:Undo")
+
+self.ui_test.close_doc()
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] dev-tools.git: uitest/mass-testing

2019-04-16 Thread Libreoffice Gerrit user
 uitest/mass-testing/calc.py   |   51 ++
 uitest/mass-testing/impress.py|  107 
 uitest/mass-testing/registrymodifications.xcu |   18 ++
 uitest/mass-testing/run.py|  169 +++
 uitest/mass-testing/writer.py |  221 ++
 5 files changed, 566 insertions(+)

New commits:
commit 1308c9141e389d6182075cde07615468221aad95
Author: Xisco Fauli 
AuthorDate: Tue Apr 16 17:15:56 2019 +0200
Commit: Xisco Fauli 
CommitDate: Tue Apr 16 17:19:45 2019 +0200

mass-uitesting: initial commit

diff --git a/uitest/mass-testing/calc.py b/uitest/mass-testing/calc.py
new file mode 100755
index 000..39cbcda
--- /dev/null
+++ b/uitest/mass-testing/calc.py
@@ -0,0 +1,51 @@
+#
+# 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/.
+#
+
+import os
+import signal
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+import time
+
+
+def handle_skip():
+#Kill the process so we don't have to open the same file for each test
+print("skipped")
+os.killpg(os.getpid(), signal.SIGINT)
+
+class massTesting(UITestCase):
+
+def load_file(self):
+#TODO: Ignore password protected files
+
+fileName = os.environ["TESTFILENAME"]
+
+self.ui_test.create_doc_in_start_center("calc")
+
+self.ui_test.load_file(fileName)
+document = self.ui_test.get_component()
+
+# Ignore read-only files
+if not hasattr(document, 'isReadonly') or document.isReadonly():
+handle_skip()
+
+try:
+xDoc = self.xUITest.getTopFocusWindow()
+xEdit = xDoc.getChild("edit")
+except:
+#In case the mimetype is wrong and the file is open with another 
component
+handle_skip()
+
+return xEdit
+
+def test_calc(self):
+xEdit = self.load_file()
+if xEdit:
+continue
+
+self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/uitest/mass-testing/impress.py b/uitest/mass-testing/impress.py
new file mode 100755
index 000..f2797b2
--- /dev/null
+++ b/uitest/mass-testing/impress.py
@@ -0,0 +1,107 @@
+#
+# 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/.
+#
+
+import os
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+import time
+
+def handle_skip():
+#Kill the process so we don't have to open the same file for each test
+print("skipped")
+os.killpg(os.getpid(), signal.SIGINT)
+
+class massTesting(UITestCase):
+
+def load_file(self):
+#TODO: Ignore password protected files
+
+fileName = os.environ["TESTFILENAME"]
+
+self.ui_test.create_doc_in_start_center("impress")
+
+self.ui_test.load_file(fileName)
+document = self.ui_test.get_component()
+
+# Ignore read-only files
+if not hasattr(document, 'isReadonly') or document.isReadonly():
+handle_skip()
+
+# Go to the normal view
+self.xUITest.executeCommand(".uno:NormalMultiPaneGUI")
+
+try:
+xDoc = self.xUITest.getTopFocusWindow()
+xEdit = xDoc.getChild("impress_win")
+except:
+#In case the mimetype is wrong and the file is open with another 
component
+handle_skip()
+
+return xEdit
+
+def test_copy_all_paste_undo(self):
+xEdit = self.load_file()
+if xEdit:
+self.xUITest.executeCommand(".uno:SelectAll")
+
+self.xUITest.executeCommand(".uno:Copy")
+
+for i in range(5):
+self.xUITest.executeCommand(".uno:Paste")
+
+for i in range(5):
+self.xUITest.executeCommand(".uno:Undo")
+self.ui_test.close_doc()
+
+def test_traverse_all_slides_and_delete_and_undo(self):
+xEdit = self.load_file()
+if xEdit:
+document = self.ui_test.get_component()
+slideCount = document.DrawPages.getCount()
+
+for i in range(slideCount):
+xEdit.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"PAGEDOWN"}))
+
+self.xUITest.executeCommand(".uno:SelectAll")
+
+xEdit.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"DELETE"}))
+
+self.xUITest.executeCommand(".uno:Undo")
+self.ui_test.close_doc()
+
+def test_duplicate_all_slides_and_undo(self):
+xEdit = self.load_file()
+if xEdit:
+# Go to the slide sorter view
+self.xUITest.executeCommand(".uno:DiaMode")
+
+xDoc =